pygplates.Property¶
-
class
pygplates.Property¶ Bases:
Boost.Python.instanceAssociates a property name with a property value.
Properties are equality (
==,!=) comparable (but not hashable - cannot be used as a key in adict). This includes comparing the property value in the two properties being compared (seePropertyValue) as well as the property name.-
__init__(property_name, property_value)¶ Create a property given a property name and a property value.
Parameters: - property_name (
PropertyName) – property name - property_value (
PropertyValue) – property value
property = pygplates.Property(property_name, property_value)
- property_name (
Methods
__init__(property_name, property_value)Create a property given a property name and a property value. clone()Create a duplicate of this property instance. get_name()Returns the name of the property. get_time_dependent_container()Returns the time-dependent property value container. get_time_dependent_value()Returns the property value for all times (unlike get_value()which returns for a specific time).get_value([time=0])Extracts the value, of our possibly time-dependent property, at the reconstruction time. -
clone()¶ Create a duplicate of this property instance.
Return type: PropertyThis clones the
PropertyNameand thePropertyValue.
-
get_name()¶ Returns the name of the property.
Return type: PropertyName
-
get_time_dependent_container()¶ Returns the time-dependent property value container.
Return type: PropertyValueor NoneReturns a time-dependent property value (
GpmlConstantValue,GpmlIrregularSamplingorGpmlPiecewiseAggregation), orNoneif the property value is not actually time-dependent.Deprecated since version 21: Use
get_time_dependent_value()instead, which differs slightly in that it returns a property value even if it’s not wrapped in aGpmlConstantValue,GpmlIrregularSamplingorGpmlPiecewiseAggregation.
-
get_time_dependent_value()¶ Returns the property value for all times (unlike
get_value()which returns for a specific time).Return type: PropertyValueAlternatively you can use
get_value()for extracting a contained property value at a specific time.Note
The returned
property valuecould be a time-dependent property value container (GpmlConstantValue,GpmlIrregularSamplingorGpmlPiecewiseAggregation) or just a regular property value.This method is useful if you want to access the time-dependent property value container directly. An example is
visitingthe time windows in aGpmlPiecewiseAggregation. Otherwiseget_value()is generally more useful since it extracts a value from the container (at a specific time).New in version 21.
-
get_value([time=0])¶ Extracts the value, of our possibly time-dependent property, at the reconstruction time.
Parameters: time (float or GeoTimeInstant) – the time to extract value (defaults to present day)Return type: PropertyValueor NoneIf this property has a time-dependent property value (
GpmlConstantValue,GpmlIrregularSamplingorGpmlPiecewiseAggregation) then a nested property value is extracted at the reconstruction time and returned. Otherwise our property value instance is simply returned as is (since it’s not a time-dependent property value). SeePropertyValue.get_value()for more details.Note
This method never returns a time-dependent property value (
GpmlConstantValue,GpmlIrregularSamplingorGpmlPiecewiseAggregation). You can useget_time_dependent_container()for that.See also
-