Skip to content

Grid and time awareness #120

@wpbonelli

Description

@wpbonelli

A good first step toward #113 might be attaching Grid and ModelTime to models and simulations, respectively. I think we could have the grid as an extra attrs.field on the model class (likewise for time), so it becomes an init method parameter, but is ignored by xattree. update: this has been implemented

We also have the grid and time discretizations encoded as dimensions/coordinates in the backing data tree. This gives us alignment but we aren't taking full advantage yet of xarray's extension points.

Eventually I think we want

  • an xarray index, which accepts a flopy grid as an init param
  • an xarray accessor, a la xugrid's .ugrid, which exposes grid info in an xarray way

We could call the accessor .grid, so it's distinct from .ugrid. But it might use xugrid under the hood and/or redirect to .ugrid.

This way, models have a .grid which is the flopy.discretization.Grid, and the datatree .data also has a grid .data.grid which exposes grid-aware indexing, selection, plotting, etc. You choose between them as the situation calls for it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions