Input/Output#
datapipe_testbench.storable#
Classes for managing processed data.
- class ReqReport(name: str, value: float = nan, domain: str = 'unknown', status: MetricStatus = MetricStatus.UNKNOWN)[source]#
Bases:
StorableStores the final report of a benchmark.
- class Storable[source]#
Bases:
objectBase class for metric data that can be inserted into a DataSet.
datapipe_testbench.store#
Defines DataSets: collections of stored Data objects related to a single analysis.
- class Metadata(path)[source]#
Bases:
objectHandle metadata storage and retrieval from JSON.
Init function.
- class MetricsStore(base_path, *args, **kw)[source]#
Bases:
StoreManage storage of multiple related Data objects.
This class manages a directory structure defined by the
base_pathattribute under which data objects are stored and retrieved by identifier, which are simply relative paths. Additionally, this class manages global metadata that apply to all Data inside.Store designed for Metrics, i.e. reduced bins that were or will be produced using input_data.
- Parameters:
- label
By default, None.
- namestr, optional
By default, None.
- str base_path
Base path On the hard drive where all the store structure will be save.
- classmethod from_path_and_input_dataset(base_path: Path, input_dataset: InputDataset | dict)[source]#
Create MetricsStore from path and dict.
- Parameters:
- base_pathPath | str
Path on the hard drive where all the store structure will be save.
- input_datasetInputDataset | dict
Dict that can instantiate an InputDataset, requires a “name” key and one of the
InputDatasetdatalevel strings.
- get_inputdata()[source]#
Get all the necessary information for the input dataset, and provenance (if any).
- Returns:
- InputDataset
Get the input dataset defined for this MetricsStore instance.
- index_metrics()[source]#
Return all identified metrics in the store.
Structure of output dict is as follow:
key: data_level/BenchmarkClass
- value: dict of histograms:
key: tuple of all column names
value: Metric instance
- Returns:
- dict[str,dict[str,Metric]]
Dict of all Metrics in the store, sorted by data_level/Benchmark.
- set_inputdata(dataset: InputDataset)[source]#
Add input dataset metadata to metric store.
- Parameters:
- datasetInputDataset
Dataset object used for the benchmarks of this store. Subsequent use of set_inputdata will only work if preexisting sub_files in InputDataset are still the same in the new one.
- class RequirementStore(base_path, *args, **kw)[source]#
Bases:
StoreStore for requirement inputs.
Init function.
- class ResultStore(base_path, *args, **kw)[source]#
Bases:
StoreStorage of plots and reports.
Init function.
- class Store(base_path, *args, **kw)[source]#
Bases:
objectBase class for storage of sets of items and common metadata.
Init function.
- data_exists(path: Path) bool[source]#
Check if the corresponding path exist in this store.
- Parameters:
- pathPath
Path to an existing store to test.
- metadata_repr(indent=0)[source]#
List metadata in store as string representation.
- Parameters:
- indent
By default, 0.
- int indent
Number of space to add to each line.
- property name#
The name of this dataset, used as a label when comparing.
datapipe_testbench.inputdataset#
InputDataset class that wrap everything you need to define related to input files necessary to process a benchmark.
- class InputDataset(name: str, dl0: Path | None = None, dl1: Path | None = None, dl1_images: Path | None = None, dl2: Path | None = None, dl2_signal: Path | None = None, dl2_background: Path | None = None, dl3_irf: Path | None = None, dl3_benchmark: Path | None = None)[source]#
Bases:
objectAn inputDataset defines common inputs that can be used by Benchmarks.
- property dtypes#
Return list of field names.