You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arrays are always homogeneous and often (but not always) represent some variable living on features of the grid. Xarray works very nicely where this is true.
Lists can be homogeneous (elements all having the same record type) or heterogeneous (elements can be any of several record types). The former are amenable to numpy, pandas, providing columns separately, etc. The latter not so. Period data for example.
You can stuff any kind of object you want into an xarray array, so there's nothing preventing us from defining classes for unions where only one field is expected to have a value at any time. We could also consider libraries like ragged or awkward, though I'm not sure how compatible they are with xarray. Maybe also worth considering where we can just avoid the problem — for instance output control period data, which is really just a selection of time steps (a list of integers), we could just convert that to the complicated mf6 keystring at write time.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
MF6 distinguishes array and list data.
Arrays are always homogeneous and often (but not always) represent some variable living on features of the grid. Xarray works very nicely where this is true.
Lists can be homogeneous (elements all having the same record type) or heterogeneous (elements can be any of several record types). The former are amenable to numpy, pandas, providing columns separately, etc. The latter not so. Period data for example.
You can stuff any kind of object you want into an xarray array, so there's nothing preventing us from defining classes for unions where only one field is expected to have a value at any time. We could also consider libraries like ragged or awkward, though I'm not sure how compatible they are with xarray. Maybe also worth considering where we can just avoid the problem — for instance output control period data, which is really just a selection of time steps (a list of integers), we could just convert that to the complicated mf6 keystring at write time.
Beta Was this translation helpful? Give feedback.
All reactions