Model subset and/or iterator over sets of UUIDs
- Dominant language
- Python
- Stars
- 67
- Forks
- 18
- Avg merge
- 2h 26m
- Merged PRs (30d)
- 1
Description
Some kind of resqpy class for iterating over realizations or specific instances of a model would be ideal for running running applications on specific subsets of data (i.e. specific realizations or with certain wells included/excluded).
Maybe this could be done with sets of UUIDs
Something like this roughly:
wells_of_interest=['wellname0', 'wellname1']
```
model=resqpy.Model(epc_file=)
UUID_set=set([])
UUID_set.add( model.grid(realization=0).uuid )
UUID_set.add( model.property_uuid(title='pressure', realization=0)
for well in model.wells():
if well.well_name in [ 'wellname0', 'wellname1' ] :
UUID_set.add( well.uuid )
model_subset=model.subset( UUID_set ) #ideally model_subset would have an attribute like model_subset.parent which points to the original model. It seems like I wouldn't want this to create a new model/epc by default yet.
my_own_function(model_subset) #assume I've created a function that computes something by looping only over all the wells, the grid, and the pressure, for example, and appends some new properties to the model_subset I pass in. Maybe it creates new properties/UUIDS attached to this model subset
model_subset.write_epc(epc_file=) #maybe an option to write a model 'subset' seperately with only the resqml properties in my subset included
#possibly a model_subset.update(model_subset.parent_model) and model.store_epc() command if I just want to update the original epc file rather than writing new ones.
```
And then it would be easy to do this in a notebook or script where I implement one function called my_own_function and can test how that function performs and what the results are on different subsets of wells or different subsets/realizations of permeability.
If model.subset returned an object that could be pickled, then I /think/ that would also be enough to scale functions written like this into a loop over lists of UUID_subsets/model_subsets and scaled via e.g. dask?
Contributor guide
Research direction
Start with the resqpy.Model entry point and the existing UUID, wells, grid, property_uuid, write_epc, and store_epc behavior mentioned in the issue. Define the subset and parent-model behavior, including whether subsets can be pickled or written back, then verify that selected objects and newly created properties are handled as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100