pygplates.Property
- class pygplates.Property
Bases:
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.A Property can also be pickled.
Changed in version 0.42: Added pickle support.
- __init__(property_name, property_value)
Create a property given a property name and a property value.
- Parameters:
property_name (
PropertyName) – property nameproperty_value (
PropertyValue) – property value
property = pygplates.Property(property_name, property_value)
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.
Returns the time-dependent property value container.
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:
This clones the
PropertyNameand thePropertyValue.
- get_name()
Returns the name of the property.
- Return type:
- get_time_dependent_container()
Returns the time-dependent property value container.
- Return type:
PropertyValueor None
Returns a time-dependent property value (
GpmlConstantValue,GpmlIrregularSamplingorGpmlPiecewiseAggregation), orNoneif the property value is not actually time-dependent.Deprecated since version 0.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:
Alternatively 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).Added in version 0.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 None
If 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_value()for that.See also