detl
This page describes the signatures of public API of the detl module.
In most cases, you’ll be using detl.parse().
- detl.get_parser(filepath) DASwareParser
Analyzes a raw DASware CSV file and selects an appropiate parser.
- Args:
filepath (str or pathlib.Path): path pointing to the file of interest
- Returns:
DWDParser: a parser that can be used for the provided file type
- Raises:
NotImlementedError: when the file contents do not match with a known DASware CSV style
- detl.parse(filepath, *, inoculation_times: dict = None) DWData
Parses a raw DASware CSV file into a DWData object.
- Args:
filepath (str or pathlib.Path): path pointing to the file of interest inoculation_times (dict or None): optional overrides for inoculation timepoints
key (int): reactor number value (datetime.datetime): timezone-aware datetime object of the real inoculation time (computer clock!)
- Returns:
DWData: parsed data object
- Raises:
NotImlementedError: when the file contents do not match with a known DASware CSV style
Specifies the base types for parsing and representing DASware data.
- class detl.core.DASwareParser
Bases:
objectAbstract type for parsers that read DASware CSV files.
Methods
parse(filepath)Parses the provided DASware CSV file into a data object.
- class detl.core.DWData(version: DASwareVersion)
Bases:
Dict[str,ReactorData]Standardized data type for DASGIP data.
- Attributes:
coreinfoInformation about DASWARE and timezone settings.
eventsTable of events that happened during the process.
- external_servers
- external_values
- fb_pro
infoContains version numbers of software modules.
- internal_values
- modules
plantMetadata of the hardware
procedureMetadata of the experiment
- profile_columns
- projectinfo
sensorsMetadata of the connected sensors
tracksMetadata about logging settings.
unitsMetadata of the reactor units
versionSpecifies which DASWARE version was used.
Methods
clear()copy()fromkeys(iterable[, value])Create a new dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
get_narrow_data([kdim])Returns all data in a narrow DataFrame.
items()keys()pop(key[, default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem(/)Remove and return a (key, value) pair as a 2-tuple.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()- property coreinfo: DataFrame
Information about DASWARE and timezone settings.
- property events: DataFrame
Table of events that happened during the process.
- property external_servers: DataFrame
- property external_values: DataFrame
- property fb_pro: DataFrame
- get_narrow_data(kdim: str = 'process_time')
Returns all data in a narrow DataFrame.
- Args:
- kdim (str): name of the time axis which will be the time axis in the new format.
Can be ‘timestamp’, ‘duration’, or ‘process_time’. ‘process_time’ will drop all data before valid time information is available. ‘duration’ and ‘process_time’ will drop the timestamp information to get a clean float-type value column.
- Returns:
narrow_data: DataFrame containing all data in a narrow format
- Raises:
KeyError: when the reference column is not in the DataFrame
- property info: DataFrame
Contains version numbers of software modules.
- property internal_values: DataFrame
- property modules: DataFrame
- property plant: DataFrame
Metadata of the hardware
- property procedure: DataFrame
Metadata of the experiment
- property profile_columns: DataFrame
- property projectinfo: DataFrame
- property sensors: DataFrame
Metadata of the connected sensors
- property tracks: DataFrame
Metadata about logging settings.
- property units: DataFrame
Metadata of the reactor units
- property version: DASwareVersion
Specifies which DASWARE version was used.
- class detl.core.ReactorData(id: int)
Bases:
objectData structure containing data from one reactor.
- Attributes:
dataframePrimary table of setpoint (SP) and actual (PV) control parameters.
- device_channels
idNumber of the reactor.
- profiles
- requirements
sensor_elementsTable of connected sensors.
setupDataframe of overall process information.
trackdataContains timeseries of mass flows.
unitProperties of the reactor.
Methods
get_closest_data(points[, reference])Returns a subset of the reactor data at points closest to the given ones.
- property dataframe: DataFrame
Primary table of setpoint (SP) and actual (PV) control parameters.
- property device_channels: DataFrame
- get_closest_data(points: array, reference: str = 'process_time') DataFrame
Returns a subset of the reactor data at points closest to the given ones.
- Args:
points (numpy.array): the data from readings closest to these points will be returned reference (str): name of the column to look for points
- Returns:
filtered_data: DataFrame containing data closest to the given points
- Raises:
KeyError: when the reference column is not in the DataFrame
- property id: int
Number of the reactor.
- property profiles: DataFrame
- property requirements: DataFrame
- property sensor_elements: DataFrame
Table of connected sensors.
- property setup: DataFrame
Dataframe of overall process information.
- property trackdata: DataFrame
Contains timeseries of mass flows.
- property unit: DataFrame
Properties of the reactor.