Skip to content

[InputManager][Inputs] Implement null input blobs#3098

Merged
ew3361zh merged 23 commits into
devfrom
null-input-blobs
Jun 18, 2026
Merged

[InputManager][Inputs] Implement null input blobs#3098
ew3361zh merged 23 commits into
devfrom
null-input-blobs

Conversation

@ew3361zh

@ew3361zh ew3361zh commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Context

Issue(s) closed by this pull request: closes #3036

What

  1. Adds logic to check if data from an input blob should be added to the IM pool based on the existence of the exclude_from_pool bool.
  2. Logs when a particular input blob is skipped from being added to the pool.
  3. Updates nulled versions of input blobs to use this new boolean.
  4. Removes check in FieldManager for fertilizer/manure/tillage schedule data being required.
  5. Updates simulation types that don't use all biophysical modules to use null inputs for parts of model they don't need.
  6. Added required optional bool arg to IM.get_data() to accommodate the current setup in the C&S module where we're looking up schedule data that might not be there given the new functionality of this PR where data not needed for a simulation will not be added to the IM pool in any way.

Why

This prevents defaults from silently overriding the nulled inputs and adding the data to the pool.

How

Added helper function to IM to check for this new input exclude_from_pool and to skip the data validation process and not add anything to the pool if it's present and true.

Test plan

Switch to one of the simulation types that uses the nulled input blobs (field_only, field_and_feed, animals_only) and add a get_data() call somewhere down the line for one of the inputs that has a default but is from a nulled input blob.

Input Changes

Output Changes

  • N/A

Filter

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on null-input-blobs branch: 1144
Mypy errors on dev branch: 1144
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended.

Comment on lines -292 to -298
om = OutputManager()
info_map = {
"class": FieldManager.__class__.__name__,
"function": FieldManager._setup_fertilizer_events.__name__,
}
om.add_error("No fertilizer data", "Field data provided with empty fertilizer data.", info_map)
raise ValueError("No fertilizer data")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed these checks to make these required since that doesn't align with simulations where we have field but aren't using fertilizer/manure/tillage scheduling and the new logic to not add data to the pool if the user has specified they aren't using this part of the model. I think when we get the C&S inputs overhauled/updated, the place to require this data accurately and coherently is alongside the other input files in the REQUIRED_METADATA_BLOBS check in IM.

Comment thread RUFAS/input_manager.py
for metadata_property in metadata_properties.keys():
if metadata_property == "data_collection_app_compatible":
continue
validation_properties = [key for key in metadata_properties if key != "data_collection_app_compatible"]

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this to keep function under complexity limit.

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on null-input-blobs branch: 1220
Mypy errors on dev branch: 1144
76 more errors on null-input-blobs branch

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended.

@matthew7838 matthew7838 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor cleanups required. Great work, Niko.

Comment thread RUFAS/input_manager.py
Comment thread RUFAS/biophysical/field/manager/field_manager.py Outdated
Comment thread RUFAS/biophysical/field/manager/field_manager.py Outdated
Comment thread RUFAS/biophysical/field/manager/field_manager.py Outdated

@allisterakun allisterakun left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just two very minor comments

Comment thread RUFAS/input_manager.py Outdated
Comment thread RUFAS/input_manager.py Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on null-input-blobs branch: 1220
Mypy errors on dev branch: 1144
76 more errors on null-input-blobs branch

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended.

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on null-input-blobs branch: 1138
Mypy errors on dev branch: 1138
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended.

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on null-input-blobs branch: 1138
Mypy errors on dev branch: 1138
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended.

@ew3361zh ew3361zh merged commit 27759f1 into dev Jun 18, 2026
1 check passed
@ew3361zh ew3361zh deleted the null-input-blobs branch June 18, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Metadata] Use nulled metadata blobs for modules not initialized in simulation types

3 participants