Skip to content

Add option to use exact grid#14

Merged
jlogan-cfs merged 4 commits intoreleasefrom
jlogan/gridspec
Jul 14, 2025
Merged

Add option to use exact grid#14
jlogan-cfs merged 4 commits intoreleasefrom
jlogan/gridspec

Conversation

@jlogan-cfs
Copy link
Copy Markdown
Collaborator

3.1.0 - 2025-07-11

Added

  • Add grid module with types related to grid inputs
  • Add ability to pass in an exact gridspec as an alternative to the approximate min_extent
  • Add warnings when applying hidden defaults or accommodating deprecated kwargs

Changed

  • Update typical() and typical_outputs to use min_extent and gridspec inputs

@mdavids-cfs mdavids-cfs self-assigned this Jul 14, 2025
Copy link
Copy Markdown
Collaborator

@mdavids-cfs mdavids-cfs left a comment

Choose a reason for hiding this comment

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

I think it might be helpful to add a few sentences to grid.py to clarify the overwrites for rmin, zmin... at least I got a little lost there

@@ -0,0 +1,13 @@
"""Grid input definitions"""

GridSpec = tuple[float, int, float, int]
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.

Not entirely sure what this means... intuitively I would guess that Grid spec is a full definition of a given regular grid; wouldn't that mean we also need the resolution info? Maybe just another sentence of what exactly is defined here might help

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.

The resolution is already a required input (dxgrid), so adding it again here would be redundant.

rmesh, zmesh = np.meshgrid(rgrid, zgrid, indexing="ij") # [m]
if self.gridspec is not None:
# Make the grid
rmin, nr, zmin, nz = self.gridspec
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.

Slightly confused about the redundant quantities for rmin and zmin here; extent is overwriting info in gridspec?

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.

When an exact gridspec is provided, min_extent is updated to match the spec. So, they're the same number here.

@jlogan-cfs jlogan-cfs merged commit 01745de into release Jul 14, 2025
5 checks passed
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.

2 participants