hvl_ccb package¶
Subpackages¶
- hvl_ccb.comm package
- hvl_ccb.dev package
- Subpackages
- Submodules
- hvl_ccb.dev.base module
- hvl_ccb.dev.crylas module
- hvl_ccb.dev.ea_psi9000 module
- hvl_ccb.dev.fug module
- hvl_ccb.dev.heinzinger module
- hvl_ccb.dev.labjack module
- hvl_ccb.dev.mbw973 module
- hvl_ccb.dev.newport module
- hvl_ccb.dev.pfeiffer_tpg module
- hvl_ccb.dev.rs_rto1024 module
- hvl_ccb.dev.se_ils2t module
- hvl_ccb.dev.sst_luminox module
- hvl_ccb.dev.technix module
- hvl_ccb.dev.tiepie module
- hvl_ccb.dev.utils module
- hvl_ccb.dev.visa module
- Module contents
- hvl_ccb.utils package
Submodules¶
hvl_ccb.configuration module¶
Facilities providing classes for handling configuration for communication protocols and devices.
-
class
hvl_ccb.configuration.
ConfigurationMixin
(configuration)[source]¶ Bases:
abc.ABC
Mixin providing configuration to a class.
-
property
config
¶ ConfigDataclass property.
- Returns
the configuration
-
abstract static
config_cls
()[source]¶ Return the default configdataclass class.
- Returns
a reference to the default configdataclass class
-
property
-
class
hvl_ccb.configuration.
EmptyConfig
[source]¶ Bases:
object
Empty configuration dataclass.
-
clean_values
()¶ Cleans and enforces configuration values. Does nothing by default, but may be overridden to add custom configuration value checks.
-
force_value
(fieldname, value)¶ Forces a value to a dataclass field despite the class being frozen.
NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.
- Parameters
fieldname – name of the field
value – value to assign
-
is_configdataclass
= True¶
-
classmethod
keys
() → Sequence[str]¶ Returns a list of all configdataclass fields key-names.
- Returns
a list of strings containing all keys.
-
classmethod
optional_defaults
() → Dict[str, object]¶ Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.
- Returns
a list of strings containing all optional keys.
-
classmethod
required_keys
() → Sequence[str]¶ Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.
- Returns
a list of strings containing all required keys.
-
-
hvl_ccb.configuration.
configdataclass
(direct_decoration=None, frozen=True)[source]¶ Decorator to make a class a configdataclass. Types in these dataclasses are enforced. Implement a function clean_values(self) to do additional checking on value ranges etc.
It is possible to inherit from a configdataclass and re-decorate it with @configdataclass. In a subclass, default values can be added to existing fields. Note: adding additional non-default fields is prone to errors, since the order has to be respected through the whole chain (first non-default fields, only then default-fields).
- Parameters
frozen – defaults to True. False allows to later change configuration values. Attention: if configdataclass is not frozen and a value is changed, typing is not enforced anymore!
hvl_ccb.experiment_manager module¶
Main module containing the top level ExperimentManager class. Inherit from this class to implement your own experiment functionality in another project and it will help you start, stop and manage your devices.
-
exception
hvl_ccb.experiment_manager.
ExperimentError
[source]¶ Bases:
Exception
Exception to indicate that the current status of the experiment manager is on ERROR and thus no operations can be made until reset.
-
class
hvl_ccb.experiment_manager.
ExperimentManager
(*args, **kwargs)[source]¶ Bases:
hvl_ccb.dev.base.DeviceSequenceMixin
Experiment Manager can start and stop communication protocols and devices. It provides methods to queue commands to devices and collect results.
-
add_device
(name: str, device: hvl_ccb.dev.base.Device) → None[source]¶ Add a new device to the manager. If the experiment is running, automatically start the device. If a device with this name already exists, raise an exception.
- Parameters
name – is the name of the device.
device – is the instantiated Device object.
- Raises
-
is_error
() → bool[source]¶ Returns true, if the status of the experiment manager is error.
- Returns
True if on error, false otherwise
-
is_finished
() → bool[source]¶ Returns true, if the status of the experiment manager is finished.
- Returns
True if finished, false otherwise
-
is_running
() → bool[source]¶ Returns true, if the status of the experiment manager is running.
- Returns
True if running, false otherwise
-
property
status
¶ Get experiment status.
- Returns
experiment status enum code.
-
Module contents¶
Top-level package for HVL Common Code Base.