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

Init code design #90

Open
JoyMonteiro opened this issue Oct 6, 2018 · 2 comments
Open

Init code design #90

JoyMonteiro opened this issue Oct 6, 2018 · 2 comments

Comments

@JoyMonteiro
Copy link
Member

A PR #88 is currently open to change the initialisation to be more predictable, allowing us to run all tests and be able to use NetCDFMonitor stably.

However, the design proposed there is not flexible enough to handle wildcards sensibly, and does not use
information that might be present in component properties to infer dimensions of wildcards.

It is also unclear whether it is required to maintain additional information about "domain" for all variables. Maybe it becomes redundant once we use component properties to infer array shapes.

In the case where there are no components which can provide full information about quantity shapes (when all components in the model use ['*', 'mid_levels'] for example, and the user asks for a state with more than one column), then we need fallback logic to infer shapes. I think the above PR provides this fallback logic, and not much else.

@mcgibbon
Copy link
Member

mcgibbon commented Oct 6, 2018

Using the init module data as a check against what the module has would be fine. An exception should be raised if the domains are not the same, based on the dictionary code I suggested. Otherwise it sounds good.

@JoyMonteiro
Copy link
Member Author

just to keep things in this issue, one option would be to us map like

     domain = {
          sorted(['*', 'mid_levels']): 'atmosphere',
          sorted(['*']): 'atmosphere_horizontal',
          'sorted(['latitude', 'longitude', 'mid_levels']): 'atmosphere',
          ...
    }[sorted(list(properties['dims']))]

if we end up retaining the domain logic.

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

No branches or pull requests

2 participants