Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Represent and resolve NextGen BMI module input and output variables #105

Merged
merged 2 commits into from
May 1, 2024

Conversation

aaraney
Copy link
Member

@aaraney aaraney commented Mar 11, 2024

This PR introduces the ngen.config.model_vars module (open to changing the name, please make suggestions). The module introduces functions and abstractions for representing and resolving NextGen BMI module input and output variables. For example, this feature set enables representing a set of BMI modules and determining which outputs map to which inputs. Likewise, it enables validating that a set of modules' output variables are valid under the NextGen frameworks invariants.

See tests for example usage.

ngen.config -- 0.3.0

Additions

  • ngen.config.model_vars functions and abstractions for representing and resolving NextGen BMI module input and output variables. Functions of note are:
    • resolve_model_inputs: Returns the input mappings and missing inputs for a single model.
    • resolve_inputs_mapping: Returns the input mappings and missing inputs for a list of models (often, multi-bmi).
    • resolve_outputs_mapping: Returns the set of invalid output names / aliases for a list of models.

Todos

  • Property resolve inputs that originate from the previous time step.
  • Bump ngen.config version before merging

@aaraney aaraney added enhancement New feature or request ngen.config Related to ngen.config package labels Mar 11, 2024
This module introduces functions and abstractions for representing and
resolving NextGen BMI module input and output variables. For example,
this feature set enables representing a set of BMI modules and
determining which outputs map to which inputs. Likewise, it enables
validating that a set of modules' output variables are valid under the
NextGen frameworks invariants.

TODOs:
- property resolve inputs that originate from the previous time step.
@aaraney aaraney force-pushed the inputs-and-outputs branch 2 times, most recently from 8cc4b63 to d6e5bea Compare March 11, 2024 15:08
Copy link
Contributor

@robertbartel robertbartel left a comment

Choose a reason for hiding this comment

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

I'm curious about a few things, but not enough to want to hold this up further.

- only the first provided alias to an input name is used

The general rules NextGen enforces for input variables in a Multi-BMI formulation are:
- input names and aliases are module scoped (i.e. ok to have 2 modules with same input name)
Copy link
Contributor

Choose a reason for hiding this comment

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

  • input names and aliases are module scoped (i.e. ok to have 2 modules with same input name)

Not sure what you are trying to convey with this. I initially think of aliases as formulation scoped, as they are used formulation-wide to pair with a data provider. But maybe this is not what you mean.

Copy link
Member Author

Choose a reason for hiding this comment

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

Your language is more accurate. I used module here instead of formulation in an attempt to distinguish between a multi bmi formulation vs a "module?" formulation.

@robertbartel robertbartel merged commit ef703dd into NOAA-OWP:master May 1, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ngen.config Related to ngen.config package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants