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

fix: integrate field coords and object arrays for changing field shapes #34

Merged
merged 16 commits into from
Jan 9, 2025

Conversation

eckelsjd
Copy link
Owner

@eckelsjd eckelsjd commented Dec 3, 2024

fixes #31, fixes #32, fixes #33

Proposed Changes

  • System and Component predict functions handle the special {{ var }}_coords variables -- which are the field coordinates returned by a model associated with the {{ var }} field quantity.
  • Field coordinates and field values are now returned by Component.call_model as numpy object arrays, where each element is the field quantity itself for a given input sample. This allows variable shapes/sizes for field quantities between inputs to be stored in the same data structure.
  • Compression now handles interpolation to/from grids where field coordinates and values are passed as object arrays. This assumes 1d object arrays, and will only loop over the first axis when interpolating.
  • As a small unrelated fix, you can specify domains as a [ list ] in yaml for scalars, which will get converted to tuples internally as long as the length of the list is exactly equal to 2.
  • Another tacked-on fix -- YamlLoader will now fail if it can't find the specified yaml file. It will try to load from a path; if this fails, then it will try to load from a stream directly.

@eckelsjd eckelsjd merged commit 86a6a04 into main Jan 9, 2025
5 checks passed
@eckelsjd eckelsjd deleted the fix-33 branch January 9, 2025 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment