evefile.entities.metadata module

Metadata classes corresponding to the data entities.

Data without context (i.e. metadata) are mostly useless. Hence, to every class (type) of data in the evefile.entities.data module, there exists a corresponding metadata class in this module.

Overview

A first overview of the classes implemented in this module and their hierarchy is given in the UML diagram below.

../../_images/evefile.entities.metadata.svg

Fig. 13 Class hierarchy of the evefile.entities.metadata module. Each concrete class in the evefile.entities.data module has a corresponding metadata class in this module. You may click on the image for a larger view.

A note on the AbstractDeviceMetadata interface class: The eveH5 dataset corresponding to the TimestampMetadata class is special in sense of having no PV and transport type nor an id. Several options have been considered to address this problem:

  1. Moving these three attributes down the line and copying them multiple times (feels bad).

  2. Leaving the attributes blank for the “special” dataset (feels bad, too).

  3. Introduce another class in the hierarchy, breaking the parallel to the Data class hierarchy (potentially confusing).

  4. Create a mixin class (abstract interface) with the three attributes and use multiple inheritance/implements.

As obvious from the UML diagram, the last option has been chosen. The name “DeviceMetadata” clearly distinguishes actual devices from datasets not containing data read from some instrument.

The following is not a strict inheritance hierarchy, but rather a grouped hierarchical list of classes for quick access to their individual API documentation:

Module documentation

class evefile.entities.metadata.Metadata

Bases: object

Metadata for the devices involved in a measurement.

This is the base class for all data(sets) and not meant to be used directly. Rather, one of the individual subclasses should actually be used.

This class complements the class evefile.entities.data.Data.

name

Name of the device.

Devices are uniquely identified by an ID that usually corresponds to the EPICS process variable (PV). However, most devices have “given” names as well that provide a more human-readable alternative.

Type:

str

options

(Scalar) options of the device.

Devices can have options. Generally, there are two types of options: those whose values are not changing within a given scan module, and those whose values can potentially change for every individual position (count). The former are stored here as key–value pairs with the key corresponding to the option name. The latter are stored in the evefile.entities.data.Data.options attribute.

Type:

dict

Examples

The Metadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.AbstractDeviceMetadata

Bases: object

Mixin class (interface) for metadata of actual physical devices.

Each physical device has a unique ID and can be accessed by an EPICS process variable (PV).

id

Unique ID of the device.

Type:

str

pv

EPICS process variable (PV) used to access the physical device.

Type:

str

access_mode

Method used to access the EPICS PV.

Type:

str

Examples

The AbstractDeviceMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

class evefile.entities.metadata.MonitorMetadata

Bases: Metadata, AbstractDeviceMetadata

Metadata for monitor data.

This class complements the class evefile.entities.data.MonitorData.

Examples

The MonitorMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.MeasureMetadata

Bases: Metadata

Metadata for data that are actually measured.

This class complements the class evefile.entities.data.MeasureData.

unit

Name of the unit corresponding to the data.

Type:

string

Examples

The MeasureMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.DeviceMetadata

Bases: MeasureMetadata, AbstractDeviceMetadata

Metadata for device data.

This class complements the class evefile.entities.data.DeviceData.

Examples

The DeviceMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.AxisMetadata

Bases: MeasureMetadata, AbstractDeviceMetadata

Metadata for axis data.

This class complements the class evefile.entities.data.AxisData.

Examples

The AxisMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.ChannelMetadata

Bases: MeasureMetadata, AbstractDeviceMetadata

Metadata for channel data.

This class complements the class evefile.entities.data.ChannelData.

Examples

The ChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.TimestampMetadata

Bases: MeasureMetadata

Metadata for the special dataset mapping timestamps to positions.

This class complements the class evefile.entities.data.TimestampData.

Examples

The TimestampMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.SinglePointChannelMetadata

Bases: ChannelMetadata

Metadata for channels with numeric 0D data.

This class complements the class evefile.entities.data.SinglePointChannelData.

Examples

The SinglePointChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.AverageChannelMetadata

Bases: ChannelMetadata

Metadata for channels with averaged numeric 0D data.

This class complements the class evefile.entities.data.AverageChannelData.

n_averages

Number of averages

Type:

int

low_limit

Minimum value for first reading of the channel

If set, the value of the channel is read and needs to be larger than this minimum value to start the comparison phase.

Type:

float

max_attempts

Maximum number of attempts for reading the channel data.

Type:

float

max_deviation

Maximum deviation allowed between two values in the comparison phase.

If the low_limit is set, as soon as the value of the channel is larger than the low limit, the comparison phase starts. Here, two subsequent channel readouts need to be within the boundary set by max_deviation.

However, no more than max_attempts channel readouts are done.

Type:

float

Examples

The AverageChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.IntervalChannelMetadata

Bases: ChannelMetadata

Metadata for channels with numeric 0D data measured in a time interval.

This class complements the class evefile.entities.data.IntervalChannelData.

trigger_interval

The interval/rate measurements are taken in seconds

Type:

float

Examples

The IntervalChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.NormalizedChannelMetadata

Bases: object

Mixin class (interface) for metadata of normalized channel data.

normalize_id

Unique ID of the channel used to normalize the data

Type:

str

Examples

The NormalizedChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

class evefile.entities.metadata.SinglePointNormalizedChannelMetadata

Bases: ChannelMetadata, NormalizedChannelMetadata

Metadata for channels with normalized numeric 0D data.

This class complements the class evefile.entities.data.SinglePointNormalizedChannelData.

Examples

The SinglePointNormalizedChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.AverageNormalizedChannelMetadata

Bases: ChannelMetadata, NormalizedChannelMetadata

Metadata for channels with normalized averaged numeric 0D data.

This class complements the class evefile.entities.data.AverageNormalizedChannelData.

Examples

The AverageNormalizedChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.

class evefile.entities.metadata.IntervalNormalizedChannelMetadata

Bases: ChannelMetadata, NormalizedChannelMetadata

Metadata for channels with normalized interval-measured numeric 0D data.

This class complements the class evefile.entities.data.IntervalNormalizedChannelData.

Examples

The IntervalNormalizedChannelMetadata class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of the evefile package. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.

copy_attributes_from(source=None)

Obtain attributes from another Metadata object.

Sometimes, it is useful to obtain the (public) attributes from another Metadata object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.

Parameters:

source (Metadata) –

Object to copy attributes from.

Should typically be of the same (super)type.

Raises:

ValueError – Raised if no source is provided to copy attributes from.