GeoEco.Datasets.CollectibleObject
- class GeoEco.Datasets.CollectibleObject(parentCollection=None, queryableAttributes=None, queryableAttributeValues=None, lazyPropertyValues=None)
Bases:
objectBase class for objects that can appear in a
DatasetCollection, namelyDatasetandDatasetCollection.A
CollectibleObjecttypically represents a tabular or gridded dataset such as a table, shapefile, raster, netCDF variable, or OPeNDAP grid.CollectibleObjects are usually queried from aDatasetCollection, which is referred to as the parent of theCollectibleObjects within it.CollectibleObjects can also be defined independently of aDatasetCollection, and have no parent. However,CollectibleObjectis a base class that should not be instantiated directly; instead, users should instantiate one of the many derived classes representing the type of dataset they’re interested in.A
DatasetCollectionis also itself aCollectibleObjectand can be contained within anotherDatasetCollection. For example, aDatasetCollectionrepresenting a netCDF file, which containsCollectibleObjects representing netCDF variables, may be contained by aDatasetCollectionrepresenting a file system directory tree or an FTP server.CollectibleObjects have queryable attributes, which are metadata values used to retrieve a subset ofCollectibleObjects from aDatasetCollectionby callingQueryDatasets()and supplying a SQL-like expression. The values of queryable attributes are often extracted from file names or other dataset characteristics related to how they are organized or stored in their original source (which is represented by theDatasetCollection).The queryable attribute definitions for a
CollectibleObjectcan be obtained withGetAllQueryableAttributes()or retrieved individually by name withGetQueryableAttribute(). The queryable attribute values can be retrieved withGetQueryableAttributeValue().Queryable attributes defined for a
DatasetCollectionare also implicitly defined for any childCollectibleObjects that they contain (including childDatasetCollections). The children will also inherit the values of their parent’s queryable attributes, unless the children define their own values (these override the parent’s).CollectibleObjects also have lazy properties, which are additional metadata values that are often not related to how datasets are organized or stored but are needed for certain tasks. Different types ofCollectibleObjects have different lazy properties, and it is generally not possible to enumerate them; callers are expected to know the names of the lazy properties they are interested in ahead of time.Lazy properties may be expensive to retrieve; examples include the dimensions or data type of a netCDF variable, which might not be known until the netCDF file is downloaded and opened. The various types of
CollectibleObjects know how to retrieve them but typically defer this untilGetLazyPropertyValue()is called. To allow this potentially slow operation to be avoided entirely when the values are known a priori, the caller can supply lazy property values to theCollectibleObjectconstructor or set them after construction withSetLazyPropertyValue(). For example, if the caller knows the dimensions, data type, and geospatial characteristics of a netCDF variable, these can be supplied when theCollectibleObjects are instantiated, so that they can be utilized by various functions that need to know these values without actually having to download the netCDF files.The values of lazy properties can also be derived from queryable attributes. Please see the
QueryableAttributedocumentation for more information.- Parameters:
parentCollection (
DatasetCollection, optional) – ParentDatasetCollectionthat this object is part of (if any).queryableAttributes (
tupleofQueryableAttribute, optional) – Queryable attributes defined for this object.queryableAttributeValues (
dictmappingstrtoobject, optional) – Values of the queryable attributes, expressed as a dictionary mapping the case-insensitive names of queryable attributes to their values.lazyPropertyValues (
dictmappingstrtoobject, optional) – Lazy properties to set when this object is constructed, expressed as a dictionary mapping the names of lazy properties to their values.
- Returns:
CollectibleObjectinstance.- Return type:
Properties
- property DisplayName
(
str) Informal name of this object, suitable to be displayed to the user. Read only. Minimum length꞉ 1.
- property ParentCollection
(
DatasetCollectionorNone) ParentDatasetCollectionthat this object is part of (if any). Read only.
Methods
Closes any open files or connections associated with this object and releases any other resources allocated to access it.
Deletes the lazy property with the specified name.
Returns a list of all queryable attributes.
Returns the value of the lazy property with the specified name.
Returns the queryable attribute with the specified name.
Returns the value of the queryable attribute with the specified name.
Returns a list queryable attributes having the specified data type.
Returns True if the specified lazy property has a value.
Sets the lazy property with the specified name to the specified value.
Tests whether a capability is supported by this class or an instance of it.