archiver_test.pv_archive_events#

Data set module for the Dataset type and related functions.

Module Contents#

Classes#

Result

Result of a test.

DataSetDiff

Represent difference information between two datasets.

PVArchiveEvents

Representation of a data set of the pv information in an archiver.

Functions#

equal_but_status(→ bool)

val_to_number(→ float)

import_pv_archive_events(→ PVArchiveEvents)

Imports data.

compare_data(→ dict[str, DataSetDiff])

Compares an array of length 2 of datasets by using DeepDiff

Attributes#

LOG

archiver_test.pv_archive_events.LOG: logging.Logger[source]#
archiver_test.pv_archive_events.equal_but_status(event: epicsarchiver.ArchiveEvent, other: epicsarchiver.ArchiveEvent) bool[source]#
class archiver_test.pv_archive_events.Result(*args, **kwds)[source]#

Bases: enum.Flag

Result of a test.

PASS = True[source]#
FAIL = False[source]#
class archiver_test.pv_archive_events.DataSetDiff[source]#

Bases: NamedTuple

Represent difference information between two datasets.

added: set[str][source]#
removed: set[str][source]#
different: list[tuple[epicsarchiver.ArchiveEvent, epicsarchiver.ArchiveEvent]][source]#
means_diff: float[source]#
result: Result[source]#
class archiver_test.pv_archive_events.PVArchiveEvents[source]#

Representation of a data set of the pv information in an archiver.

pv_name: str[source]#
details: dict[archiver_test.details.Detail, str][source]#
data: dict[str, epicsarchiver.ArchiveEvent][source]#
means: dict[str, epicsarchiver.ArchiveEvent][source]#
async export_data(output_folder: pathlib.Path, archiver: str, filename: str) pathlib.Path[source]#
Stores the data from a dataset into a store folder with path:

output_folder/store/archiver/pv_name/filename.pickle

Parameters:
  • output_folder – Path of folder to store data.

  • archiver – Hostname of archiver

  • filename – Filename of file, usually “sop-eop”

size() int[source]#

Returns the number of events in the data set.

avg() float | None[source]#

Returns the average value over the events in the data.

async avg_mean_diff(other: PVArchiveEvents) float[source]#
Calculates the average difference between the values of the events in

the data vs the other dataset.

Parameters:

other – Another dataset.

async compare(other: PVArchiveEvents) DataSetDiff[source]#

Compares the current dataset with another. Calculates the number of different events in each set, and the average difference between the means.

Parameters:

other – Another dataset.

archiver_test.pv_archive_events.val_to_number(val: int | float | str | list[str] | list[int] | list[float] | bytes) float[source]#
async archiver_test.pv_archive_events.import_pv_archive_events(input_file: pathlib.Path) PVArchiveEvents[source]#

Imports data.

Parameters:

input_file – Path of file of data

async archiver_test.pv_archive_events.compare_data(datasets_old: dict[str, PVArchiveEvents], datasets_new: dict[str, PVArchiveEvents]) dict[str, DataSetDiff][source]#

Compares an array of length 2 of datasets by using DeepDiff

Parameters:
  • datasets_old – Datasets from the first archiver.

  • dataset_new – Datasets form the second archiver.