smif.convert.register module¶
Register, NDimensionalRegister and ResolutionSet abstract classes to contain area, interval and unit metadata.
Implemented by smif.convert.interval.TimeIntervalRegister
,
smif.convert.area.RegionRegister
and
smif.convert.unit.UnitRegister
.
Summary¶
Classes:
LogMixin |
|
NDimensionalRegister |
Abstract class which holds N-Dimensional ResolutionSets |
Register |
Abstract class which holds the ResolutionSets |
ResolutionSet |
Abstract class which holds the Resolution definitions |
Reference¶
-
class
smif.convert.register.
Register
(axis=None)[source]¶ Bases:
smif.convert.register.LogMixin
Abstract class which holds the ResolutionSets
Parameters: axis (int, default=None) – The axis over which operations on the data array are performed -
data_interface
= None¶
-
names
¶
-
convert
(data, from_set_name, to_set_name)[source]¶ Convert a list of data points for a given set to another set
Parameters: - data (numpy.ndarray) –
- from_set_name (str) –
- to_set_name (str) –
Returns: Return type:
-
-
class
smif.convert.register.
NDimensionalRegister
(axis=None)[source]¶ Bases:
smif.convert.register.Register
Abstract class which holds N-Dimensional ResolutionSets
Parameters: axis (int, default=None) – The axis over which operations on the data array are performed -
register
(resolution_set)[source]¶ Add a ResolutionSet to the register
Parameters: resolution_set ( smif.convert.ResolutionSet
) –Raises: ValueError
– If a ResolutionSet of the same name already exists in the register
-
names
¶ Names of registered region sets
Returns: sets Return type: list of str
-
get_entry
(name)[source]¶ Returns the ResolutionSet of name
Parameters: name (str) – The unique identifier of a ResolutionSet in the register Returns: Return type: smif.convert.ResolutionSet
-
-
class
smif.convert.register.
ResolutionSet
[source]¶ Bases:
object
Abstract class which holds the Resolution definitions
-
get_entry_names
()[source]¶ Get the names of the entries in the ResolutionSet
Returns: The set of names which identify each entry in the ResolutionSet Return type: set
-
get_proportion
(entry_a, entry_b)[source]¶ Calculate the proportion of entry_a and entry_b
Parameters: - entry_a (string) – Name of an entry in ResolutionSet
- entry_b (string) – Name of an entry in ResolutionSet
Returns: The proportion of entry_a and entry_b
Return type:
-
coverage
¶
-