Skip to content

Commit

Permalink
Merge pull request #804 from bp/standard_pks
Browse files Browse the repository at this point in the history
using weights and measures valid property kinds as supported property kind list
  • Loading branch information
andy-beer committed Jul 9, 2024
2 parents fa19031 + a573af7 commit 6791c3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion resqpy/property/_collection_create_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _create_xml_property_kind(collection, p_node, find_local_property_kinds, pro
property_kind = 'rock permeability'
p_kind_node = rqet.SubElement(p_node, ns['resqml2'] + 'PropertyKind')
p_kind_node.text = rqet.null_xml_text
if find_local_property_kinds and property_kind not in rqp_c.supported_property_kind_list:
if find_local_property_kinds and property_kind not in wam.valid_property_kinds():
property_kind_uuid = pcga._get_property_kind_uuid(collection, property_kind_uuid, property_kind, uom, discrete)

if property_kind_uuid is None:
Expand Down
11 changes: 3 additions & 8 deletions resqpy/property/property_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@
import resqpy.property as rqp
import resqpy.olio.uuid as bu
import resqpy.olio.xml_et as rqet
import resqpy.weights_and_measures as bwam
import resqpy.weights_and_measures as wam

# the following resqml property kinds and facet types are 'known about' by this module in relation to nexus
# other property kinds should be handled okay but without any special treatment
# see property_kind_and_facet_from_keyword() for simulator keyword to property kind and facet mapping

supported_property_kind_list = [
'continuous', 'discrete', 'categorical', 'code', 'index', 'depth', 'rock volume', 'pore volume', 'volume',
'thickness', 'length', 'cell length', 'area', 'net to gross ratio', 'porosity', 'permeability thickness',
'permeability length', 'permeability rock', 'rock permeability', 'fluid volume', 'transmissibility', 'pressure',
'saturation', 'solution gas-oil ratio', 'vapor oil-gas ratio', 'property multiplier', 'thermodynamic temperature'
]
supported_property_kind_list = list(wam.valid_property_kinds())

supported_local_property_kind_list = [
'active', 'transmissibility multiplier', 'fault transmissibility', 'mat transmissibility'
Expand Down Expand Up @@ -326,7 +321,7 @@ def infer_property_kind(name, unit):

# Currently unit is ignored

valid_kinds = bwam.valid_property_kinds()
valid_kinds = wam.valid_property_kinds()

if name in valid_kinds:
kind = name
Expand Down
7 changes: 7 additions & 0 deletions tests/unit_tests/property/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -3074,3 +3074,10 @@ def test_no_pack_unpack_bits_ni_one(example_model_and_crs):
b = rqp.Property(model, uuid = bp.uuid).array_ref(dtype = bool)
assert b is not None and b.shape == shape
assert np.all(b == brray)


def test_specific_property_kinds():

assert 'density' in rqp.supported_property_kind_list
assert 'thermal conductivity' in rqp.supported_property_kind_list
assert 'fluid volume' in rqp.supported_property_kind_list

0 comments on commit 6791c3a

Please sign in to comment.