DataTypes - ptidejteam/tools4cities-metamenth GitHub Wiki

The DataTypes package has classes that model custom data objects used by various MetamEnTh classes.

Classes and Their Relationships

AbstractDynamicEntity

This is a generic parent class for all MetamEnTh classes that have transducers, e.g., sensors

Parent Class

None

Relationships

  • AbstractDynamicEntity has a one-to-many relationship with AbstractTransducer.

Attributes

  • transducers: List[AbstractTransducer], transducers (sensors and actuators) that classes that inherit from AbstractDynamicEntity possess

Behaviours (Methods)

  • add_transducer(new_transducer: AbstractTransducer): adds a transducer to children classes of AbstractDynamicEntity
  • remove_transducer(new_transducer: AbstractTransducer): removes a transducer from children classes of AbstractDynamicEntity
  • get_transducer_by_name(name) -> AbstractTransducer: searches for a transducer by name
  • get_transducer_by_uid(name) -> AbstractTransducer: searches for a transducer by its unique identifier
  • get_transducers(search_terms: Dict) -> ['AbstractTransducer']: searches for transducers based on attributes and their values

AbstractMeasure

This is a generic parent class for all measurement-related classes in MetamEnTh

Parent Class

None

Relationships

None

Attributes

  • measurement_unit: MeasurementUnit, the unit of measurement, e.g., DEGREE_CELSIUS
  • measure_type: DataMeasurementType, the type of measurement, e.g., OUTSIDE_TEMPERATURE

Behaviours (Methods)

None

AbstractRangeMeasure

This is a generic parent class for all measurements with more than one data point, e.g., min and max values

Parent Class

AbstractMeasure

Relationships

None

Attributes

  • minimum: float, the minimum value of the measurement
  • maximum: float, the maximum value of the measurement

Behaviours (Methods)

None

Address

This class models the address of a building

Parent Class

None

Relationships

None

Attributes

  • city: string, the name of the city
  • street: string, the street name of the address e.g., 6911 Ave De la Pepiniere
  • state: string the state (or province) e.g., QC or Quebec
  • zip_code: string, the zip code e.g., H1N 1B9
  • country: string, the country where the building is located
  • what3word: string, the What3word address of the location
  • geocoordinate: Point the geographical coordinates of the location
  • north_orientation: BinaryMeasure (optiona), the north orientation of a building

Behaviours (Methods)

None

BinaryMeasure

This class models measurements with one data point

Parent Class

AbstractMeasure

Relationships

None

Attributes

  • value: float, the value of the data point

Behaviours (Methods)

None

ContinuousMeasure

ContinuousMeasure models measures with two data points, e.g., minimum and maximum

Parent Class

AbstractRangeMeasure

Relationships

None

Attributes

  • None, inherits all attributes from AbstractRangeMeasure

Behaviours (Methods)

None

ExponentialMeasure

ExponentialMeasure models measures with mantissa and an exponent in addition to minimum and maximum values

Parent Class

AbstractRangeMeasure

Relationships

None

Attributes

exponent: float, the exponent value of the measurement mantissa: float, the mantissa value of the measurement

Behaviours (Methods)

None

LinearMeasure

LinearMeasure models measures with minimum, maximum, and slope values

Parent Class

AbstractRangeMeasure

Relationships

None

Attributes

slope: float, the slope value of the measurement

Behaviours (Methods)

None

Measure

Measure models the various measurement data points, e.g., minimum, maximum, slope, mantissa, exponent, and the measurement unit

Parent Class

None

Relationships

None

Attributes

  • exponent: float (default is 0.0), the exponent value of the measurement
  • mantissa: float (default is 0.0), the mantissa value of the measurement
  • slope: float (default is 0.0), the slope value of the measurement
  • minimum: float (default is 0.0), the minimum value of the measurement
  • maximum: float (default is 0.0), the maximum value of the measurement
  • unit: Measurement Unit, the measurement unit

Behaviours (Methods)

None

Point

Point models geographical coordinates with latitude and longitude values

Parent Class

None

Relationships

None

Attributes

  • latitude: float, the latitude value of the geographical coordinate
  • longitude: float, the longitude value of the geographical coordinate

Behaviours (Methods)

None

RatedDeviceMeasure

Point models the rated device measure of entities in a building

Parent Class

None

Relationships

None

Attributes

  • voltage_rating: AbstractMeasure, the voltage rating of an entity
  • current_rating: AbstractMeasure, the current rating of an entity
  • frequency: AbstractMeasure (default is None), the frequency of the rated device measure of an entity
  • power_factor: float (default is 0.0), the power factor of the rated device measure of an entity
  • phase: float (default is 0.0), the phase of the rated device measure of an entity
  • voltage_output: AbstractMeasure (default is None), the voltage output of an entity
  • current_output: AbstractMeasure (default is None), the current output of an entity
  • power_output: AbstractMeasure (default is None), the power output of an entity
  • wave_form: WaveForm, the wave form of the rated device measure of an entity, e.g., SINUSOIDAL
  • efficiency: AbstractMeasure (default is None), the efficiency value of the rated device measure of an entity

Behaviours (Methods)

None