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

More intuitive way to prescribe Flat topology on grids #4099

Open
navidcy opened this issue Feb 13, 2025 · 3 comments
Open

More intuitive way to prescribe Flat topology on grids #4099

navidcy opened this issue Feb 13, 2025 · 3 comments
Labels
good first issue 🐤 Let us know if you're interested in working on this! grids 🗺️ question 💭 No such thing as a stupid question

Comments

@navidcy
Copy link
Collaborator

navidcy commented Feb 13, 2025

At the moment when we build a grid, the topology kwarg requires all 3 dimensions! For example, to build a 2D grid we do something like:

grid = RectilinearGrid(size=(16, 16),
                       x=(0, 2π),
                       y=(0, 2π),
                       topology = (Periodic, Periodic, Flat))

But requiring that third 3rd topology with Flat might seem a bit counterintuitive?

I'd think that by doing this:

grid = RectilinearGrid(size=(16, 16),
                       x=(0, 2π),
                       y=(0, 2π),
                       topology = (Periodic, Periodic))

then given that I prescribed x and y but not z the constructor should be able to figure out which are the non-Flat dimensions?

Would that be more intuitive you reckon?

@navidcy navidcy added good first issue 🐤 Let us know if you're interested in working on this! grids 🗺️ question 💭 No such thing as a stupid question labels Feb 13, 2025
@simone-silvestri
Copy link
Collaborator

I like the suggestion!

@glwagner
Copy link
Member

I like this idea. The Flat dimension is inferred from the one that's omitted. I never thought of that!

@glwagner
Copy link
Member

glwagner commented Feb 28, 2025

If we do the indexing thing that @simone-silvestri suggested then we could claim a user interface that does truly reduce from 3 to 1 dimension. I'm still worried about developers using that though, but maybe I shouldn't be worried (its my job to worry about hypotheticals)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue 🐤 Let us know if you're interested in working on this! grids 🗺️ question 💭 No such thing as a stupid question
Projects
None yet
Development

No branches or pull requests

3 participants