pygplates.Property
- class pygplates.Property
Bases:
Boost.Python.instance
Associates 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 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
PropertyName
and thePropertyValue
.
- get_name()
Returns the name of the property.
- Return type
- get_time_dependent_container()
Returns the time-dependent property value container.
- Return type
PropertyValue
or None
Returns a time-dependent property value (
GpmlConstantValue
,GpmlIrregularSampling
orGpmlPiecewiseAggregation
), orNone
if 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
,GpmlIrregularSampling
orGpmlPiecewiseAggregation
.
- 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 value
could be a time-dependent property value container (GpmlConstantValue
,GpmlIrregularSampling
orGpmlPiecewiseAggregation
) 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
visiting
the 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 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
PropertyValue
or None
If this property has a time-dependent property value (
GpmlConstantValue
,GpmlIrregularSampling
orGpmlPiecewiseAggregation
) 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
,GpmlIrregularSampling
orGpmlPiecewiseAggregation
). You can useget_time_dependent_container()
for that.See also