-
Notifications
You must be signed in to change notification settings - Fork 14
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
Question: how to create an epc of properties without including the grid #197
Comments
Now I realize that I confuse things badly in my example, but the question remains: how could I create an epc file with just a couple of properties all pointing to the same UUID for the supporting representation. I could look over derivedmodel.add_one_grid_property_array() and finally remove grid and crs; but that seems rather heavy. |
Ah, this is a good question @mgimhof ! In RESQML a property object includes a reference to a supporting representation. The RESQML standard allows such referenced parts to be absent from the dataset. However, resqpy often requires them to be present – and the processing of properties is one such situation, primarily to ascertain the expected shape of the property arrays (and also to determine default and/or valid indexable elements). Without some major work on the resqpy code, I think that adding in a mock grid is the way to go, for now at least. If the original grid is an IJK grid, then the resqpy RegularGrid class can be used, initialising with just the extent_kji argument. If the original grid is Unstructured, then you can use the brand new (= minimally tested) resqpy UnstructuredGrid class. Both of these should allow grids without a geometry to be created and used as a supporting representation. The difficult step is to patch the uuid – either inserting the uuid of the mock grid into the reference nodes of the properties (which would leave the xml relationships messed up, though one might get away with that for temporary processing), or changing the uuid of the mock grid to that of the original grid prior to creating the mock grid xml. There is some uuid patching functionality in the Model class but I will have to take a good look before advising further. In your example the add_part failed whilst trying to create xml relationships (reciprocal relationships) – the create_xml methods in resqpy usually allow this to be skipped by setting an add_relationships argument to False. |
The Model class now has a method for patching the uuid in xml supporting representation reference blocks. Here is some sketchy code outline showing possible use. Note that the _rels information is not modified in this sequence, which might cause problems for some workflows.
|
@andy-beer With regard to the rels files: The effect of |
Thanks for the feedback @mgimhof I'll leave this issue open for now, as a reminder that we could make the resqpy property module work better in this situation. |
@andy-beer In light of the script above, we need remote_grid_uuid and remote_grid_extent_kji remote grid extent I can get from the shape of the imported properties. To get the support representation uuid, I see 3 solutions:
|
@mgimhof Your 3 options make use of property.root which implies the Property object has been initialised, which might not be possible until after the substitution. So I would suggest for now going with option 1, but instead of property.root you will need to use the root from the Model object prior to instantiating a resqpy Property,. So, something like:
then use property_root instead of property.root in your option 1. |
@mgimhof
or more completely to handle the 3 numerical property types the first line above could be replaced with something like:
|
I have an application that creates an EPC file containing only ContinuousProperties and the EpcExternalPartReference to the h5 file. The use case is python as an external property calculator. The grid is not explicitly included because the app already contains the grid and it does not need to be round tripped (it is a very simple-minded calculator that does not account for grid geometry and topology!).
I can pick up properties and perform some calculation to create a new one. The problem is when trying to create an epc for the new property.
Happening to know the number of cells and the grid uuid, I expected that the return problem can be mocked up as
If the add_part line is included, then I fail with
Without the add_part line, I fail with
The text was updated successfully, but these errors were encountered: