NEAT Package

Module contents

Submodules

neat.const module

Module constants object.

exception neat.const.ModuleConstantException(message: str, code: int = None)

Bases: Exception

Custom exception for constants namespace.

neat.client module

class neat.client.AbstractClient[source]

Bases: object

The basic class for all valid clients.

static from_config(config_path: str)[source]

Creates a client from a config file.

Parameters:config (str) – The path of the config file to load from
Returns:An instance of the created client
Return type:AbstractClient
start() → None[source]

Starts the engine.

Returns:Does not return
Return type:None
class neat.client.BasicClient(config: dict)[source]

Bases: neat.client.AbstractClient

A very basic client for engine initalization.

static from_config(config: str)[source]

Creates a BasicClient from a config file.

Parameters:config (str) – The path of the config file to load from
Returns:An instance of the created BasicClient
Return type:BasicClient
start() → None[source]

Starts the engine.

Returns:Does not return
Return type:None

neat.engine module

class neat.engine.Engine(register: Dict[neat.scheduler._common.AbstractScheduler, neat.requester._common.AbstractRequester] = {}, pipes: List[neat.pipe._common.AbstractPipe] = [])[source]

Bases: object

Provides communication between all of the subpackages.

on_commit(piper: neat.pipe._common.AbstractPipe, record: neat.models.record.Record) → None[source]

Event handler for when pipes finish writing out a record.

Parameters:
  • piper (AbstractPipe) – The pipe who wrote the record out
  • record (Record) – The record that was written
Returns:

Does not return

Return type:

None

on_data(requester: neat.requester._common.AbstractRequester, data: str, meta: dict) → None[source]

Event handler for when requesters get a response from their device.

Parameters:
  • requester (AbstractRequester) – The requester who retrieved the data
  • data (str) – The data returned from the device
  • meta (dict) – Any additional fields required to properly interpret data
Returns:

Does not return

Return type:

None

on_record(record: neat.models.record.Record) → None[source]

Event handler for when translators finish translation of some data.

Parameters:record (Record) – The translated record
Returns:Does not return
Return type:None
on_scheduled(scheduler: neat.scheduler._common.AbstractScheduler) → None[source]

Event handler for when schedulers trigger their mapped requesters.

Parameters:scheduler (AbstractScheduler) – The scheduler that needs to run its requester
Returns:Does not return
Return type:None
on_start = <blinker.base.Signal object>
on_stop = <blinker.base.Signal object>
pipes

The list of pipe objects that are handling created records.

register

The mapping of schedulers to requesters.

start() → None[source]

Starts the engine.

Returns:Does not return
Return type:None
stop() → None[source]

Stops the engine.

Returns:Does not return
Return type:None
translators

The list of translator objects that have been needed.

neat.device module

class neat.device.AbstractDevice[source]

Bases: object

The base class for all valid devices.

fields

The expected device fields.

name

The name of the device.

parse(record: neat.models.record.Record) → Dict[str, neat.models.record.RecordPoint][source]

Parses a given record for the necessary device fields.

Parameters:record (Record) – The record to parse
Returns:A dictionary of field names mapped to record points
Return type:dict
ureg

The unit registry for all devices.

class neat.device.DeviceType[source]

Bases: enum.Enum

An enumeration of available device types.

Note

Maps types to instances not classes

ENERGY = (5, <neat.device.EnergyDevice object>)
HVAC = (2, <neat.device.HVACDevice object>)
PV = (1, <neat.device.PVDevice object>)
SOLAR_THERM = (3, <neat.device.SolarThermalDevice object>)
TEMP = (6, <neat.device.TemperatureDevice object>)
UNKNOWN = (0, <neat.device.UnknownDevice object>)
WIND = (4, <neat.device.WindDevice object>)
class neat.device.EnergyDevice[source]

Bases: neat.device.AbstractDevice

Defines a generic energy device.

fields = {}
name = 'Energy Device'
class neat.device.HVACDevice[source]

Bases: neat.device.AbstractDevice

Defines a heating, ventilation, and cooling device.

fields = {}
name = 'HVAC Device'
class neat.device.PVDevice[source]

Bases: neat.device.AbstractDevice

Defines a photovoltaic device.

fields = {}
name = 'PV Device'
class neat.device.SolarThermalDevice[source]

Bases: neat.device.AbstractDevice

Defines a solar thermal device.

fields = {'energy_rate': 'btu / hour', 'energy_total': 'megabtu', 'flow_rate': 'gallon / minute', 'return_temp': 'degF', 'supply_temp': 'degF'}
name = 'Solar Thermal Device'
class neat.device.TemperatureDevice[source]

Bases: neat.device.AbstractDevice

Defines a generic temperature device.

fields = {}
name = 'Temperature Device'
class neat.device.UnknownDevice[source]

Bases: neat.device.AbstractDevice

Defines an unknown device type.

Note

Primarily used for Obvius virtual meters

fields = {}
name = 'Unknown Device'
class neat.device.WindDevice[source]

Bases: neat.device.AbstractDevice

Defines a wind based device.

fields = {'inverter_energy_total': 'kilowatthour', 'inverter_real': 'kilowatt', 'rotor_speed': 'rpm', 'wind_speed': 'mph'}
name = 'Wind Device'