resqpy.strata.StratigraphicUnitFeature¶
- class resqpy.strata.StratigraphicUnitFeature(parent_model, uuid=None, top_unit_uuid=None, bottom_unit_uuid=None, title=None, originator=None, extra_metadata=None)¶
Bases:
BaseResqpy
Class for RESQML Stratigraphic Unit Feature objects.
RESQML documentation:
A stratigraphic unit that can have a well-known (e.g., “Jurassic”) chronostratigraphic top and chronostratigraphic bottom. These chronostratigraphic units have no associated interpretations or representations.
BUSINESS RULE: The name must reference a well-known chronostratigraphic unit (such as “Jurassic”), for example, from the International Commission on Stratigraphy (http://www.stratigraphy.org).
Public Data Attributes:
resqml_type
Inherited from
BaseResqpy
resqml_type
Standard part name corresponding to self.uuid.
XML node corresponding to self.uuid.
Citation block title equivalent to self.title.
Methods:
__init__
(parent_model[, uuid, ...])Initialises a stratigraphic unit feature object.
is_equivalent
(other[, check_extra_metadata])Returns True if this feature is essentially the same as the other; otherwise False.
create_xml
([add_as_part, originator, reuse, ...])Creates xml for this stratigraphic unit feature.
Inherited from
BaseResqpy
__init__
(parent_model[, uuid, ...])Initialises a stratigraphic unit feature object.
Look for an equivalent existing RESQML object and modify the uuid of this object if found.
create_xml
([add_as_part, originator, reuse, ...])Creates xml for this stratigraphic unit feature.
append_extra_metadata
(meta_dict)Append a given dictionary of metadata to the existing metadata.
__eq__
(other)Implements equals operator; uses is_equivalent() otherwise compares class type and uuid.
__ne__
(other)Implements not equal operator.
__repr__
()String representation.
- __init__(parent_model, uuid=None, top_unit_uuid=None, bottom_unit_uuid=None, title=None, originator=None, extra_metadata=None)[source]¶
Initialises a stratigraphic unit feature object.
- Parameters
parent_model (model.Model) – the model with which the new feature will be associated
uuid (uuid.UUID, optional) – the uuid of an existing RESQML stratigraphic unit feature from which this object will be initialised
top_unit_uuid (uuid.UUID, optional) – the uuid of a geologic or stratigraphic unit feature which is at the top of the new unit; ignored if uuid is not None
bottom_unit_uuid (uuid.UUID, optional) – the uuid of a geologic or stratigraphic unit feature which is at the bottom of the new unit; ignored if uuid is not None
title (str, optional) – the citation title (feature name) of the new feature; ignored if uuid is not None
originator (str, optional) – the name of the person creating the new feature; ignored if uuid is not None
extra_metadata (dict, optional) – extra metadata items for the new feature
- Returns
a new stratigraphic unit feature resqpy object
- append_extra_metadata(meta_dict)¶
Append a given dictionary of metadata to the existing metadata.
- property citation_title¶
Citation block title equivalent to self.title.
- create_xml(add_as_part=True, originator=None, reuse=True, add_relationships=True)[source]¶
Creates xml for this stratigraphic unit feature.
- Parameters
add_as_part (bool, default True) – if True, the feature is added to the parent model as a high level part
originator (str, optional) – if present, is used as the originator field of the citation block
reuse (bool, default True) – if True, the parent model is inspected for any equivalent feature and, if found, the uuid of this feature is set to that of the equivalent part
add_relationships (bool, default True) – if True and add_as_part is True, relationships are created with the referenced top and bottom units, if present
- Returns
lxml.etree._Element – the root node of the newly created xml tree for the feature
- is_equivalent(other, check_extra_metadata=True)[source]¶
Returns True if this feature is essentially the same as the other; otherwise False.
- Parameters
other (StratigraphicUnitFeature) – the other feature to compare this one against
check_extra_metadata (bool, default True) – if True, then extra metadata items must match for the two features to be deemed equivalent; if False, extra metadata is ignored in the comparison
- Returns
bool – True if this feature is essentially the same as the other feature; False otherwise
- property part¶
Standard part name corresponding to self.uuid.
- property root¶
XML node corresponding to self.uuid.
- try_reuse()¶
Look for an equivalent existing RESQML object and modify the uuid of this object if found.
- Returns
boolean – True if an equivalent object was found, False if not
Note
by design this method may change this object’s uuid as a side effect
- title¶
Citation title
- originator¶
Creator of object. By default, user id.
- uuid¶
Unique identifier