dgbowl_schemas.yadg.dataschema_4_2 package
- class dgbowl_schemas.yadg.dataschema_4_2.DataSchema(*, metadata: Metadata, steps: Sequence[Dummy | BasicCSV | MeasCSV | FlowData | ElectroChem | ChromTrace | ChromData | MassTrace | QFTrace | XPSTrace | XRDTrace])
Bases:
BaseModel
- steps: Sequence[Dummy | BasicCSV | MeasCSV | FlowData | ElectroChem | ChromTrace | ChromData | MassTrace | QFTrace | XPSTrace | XRDTrace]
A sequence of parser steps.
- update()
Submodules
dgbowl_schemas.yadg.dataschema_4_2.externaldate module
- class dgbowl_schemas.yadg.dataschema_4_2.externaldate.ExternalDateFile(*, file: Content)
Bases:
BaseModel
Read external date information from file.
- class dgbowl_schemas.yadg.dataschema_4_2.externaldate.ExternalDateFilename(*, filename: Content)
Bases:
BaseModel
Read external date information from the file name.
- class dgbowl_schemas.yadg.dataschema_4_2.externaldate.ExternalDateISOString(*, isostring: str)
Bases:
BaseModel
Read a constant external date using an ISO-formatted string.
- isostring: str
- class dgbowl_schemas.yadg.dataschema_4_2.externaldate.ExternalDateUTSOffset(*, utsoffset: float)
Bases:
BaseModel
Read a constant external date using a Unix timestamp offset.
- utsoffset: float
- class dgbowl_schemas.yadg.dataschema_4_2.externaldate.ExternalDate(*, using: ExternalDateFile | ExternalDateFilename | ExternalDateISOString | ExternalDateUTSOffset, mode: Literal['add', 'replace'] = 'add')
Bases:
BaseModel
Supply timestamping information that are external to the processed file.
- using: ExternalDateFile | ExternalDateFilename | ExternalDateISOString | ExternalDateUTSOffset
Specification of the external date format.
- mode: Literal['add', 'replace']
Whether the external timestamps should be added to or should replace the parsed data.
dgbowl_schemas.yadg.dataschema_4_2.input module
- class dgbowl_schemas.yadg.dataschema_4_2.input.Input(*, folders: Sequence[str], prefix: str | None = None, suffix: str | None = None, contains: str | None = None, exclude: str | None = None, encoding: str = 'UTF-8')
Bases:
BaseModel
Specification of input files/folders to be processed by the
Step
.- files: Sequence[str]
Files, or folders to be searched for matching files.
- prefix: str | None
Prefix of the filenames to be matched.
- suffix: str | None
Suffix of the filenames to be matched.
- contains: str | None
A string the matched filenames must contain.
- exclude: str | None
A string the matched filenames must not contain.
- encoding: str
File encoding.
- paths() List[str]
Returns a list of files to be processed by the
Step
.
dgbowl_schemas.yadg.dataschema_4_2.metadata module
- class dgbowl_schemas.yadg.dataschema_4_2.metadata.Metadata(*, version: Literal['4.2'], provenance: Provenance, timezone: str = 'localtime')
Bases:
BaseModel
Metadata, including version and provenance of the
DataSchema
.- class Provenance(*, type: str, metadata: Mapping[str, Any] | None = None)
Bases:
BaseModel
- type: str
- metadata: Mapping[str, Any] | None
- version: Literal['4.2']
- provenance: Provenance
Provenance information.
- timezone: str
Timezone specification.
Note
This should be set to the timezone where the measurements have been performed, as opposed to the timezone where yadg is being executed, otherwise timezone offsets may not be accounted for correctly.
dgbowl_schemas.yadg.dataschema_4_2.parameters module
dgbowl_schemas.yadg.dataschema_4_2.step module
- class dgbowl_schemas.yadg.dataschema_4_2.step.Dummy(*, parser: Literal['dummy'], input: Input, parameters: Params | None = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Dummy parser type, useful for testing.
- class Params(**extra_data: Any)
Bases:
BaseModel
- parser: Literal['dummy']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.BasicCSV(*, parser: Literal['basiccsv'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Customisable tabulated file parser.
- class Params(*, sep: str = ',', strip: str = None, units: Mapping[str, str] | None = None, timestamp: Timestamp | TimeDate | UTS | None = None, sigma: Mapping[str, Tol] | None = None, calfile: str | None = None, convert: Any | None = None)
Bases:
BaseModel
- sep: str
Separator of table columns.
- strip: str
A
str
of characters to strip from headers & data.
- units: Mapping[str, str] | None
A
dict
containingcolumn: unit
keypairs.
- timestamp: Timestamp | TimeDate | UTS | None
Timestamp specification allowing calculation of Unix timestamp for each table row.
- sigma: Mapping[str, Tol] | None
External uncertainty specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- calfile: str | None
Column calibration specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- convert: Any | None
Column renaming specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- parser: Literal['basiccsv']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.MeasCSV(*, parser: Literal['meascsv'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Legacy file parser for
measurement.csv
files from FHI.Note
This parser is deprecated, and the
BasicCSV
parser should be used instead.- class Params(*, timestamp: Timestamp | TimeDate | UTS = Timestamp(timestamp=TimestampSpec(index=0, format='%Y-%m-%d-%H-%M-%S')), calfile: str | None = None, convert: Any | None = None)
Bases:
BaseModel
- calfile: str | None
Column calibration specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- convert: Any | None
Column renaming specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- parser: Literal['meascsv']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.FlowData(*, parser: Literal['flowdata'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for flow controller/meter data.
- class Params(*, filetype: Literal['drycal.csv', 'drycal.rtf', 'drycal.txt'] = 'drycal.csv', calfile: str | None = None, convert: Any | None = None)
Bases:
BaseModel
- filetype: Literal['drycal.csv', 'drycal.rtf', 'drycal.txt']
- calfile: str | None
Column calibration specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- convert: Any | None
Column renaming specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- parser: Literal['flowdata']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.ElectroChem(*, parser: Literal['electrochem'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for electrochemistry files.
- class Params(*, filetype: Literal['eclab.mpt', 'eclab.mpr', 'tomato.json'] = 'eclab.mpr', transpose: bool = True)
Bases:
BaseModel
- filetype: Literal['eclab.mpt', 'eclab.mpr', 'tomato.json']
- transpose: bool
Transpose impedance data into traces (default) or keep as timesteps.
- class Input(*, folders: Sequence[str], prefix: str | None = None, suffix: str | None = None, contains: str | None = None, exclude: str | None = None, encoding: str = 'windows-1252')
Bases:
Input
- encoding: str
File encoding.
- parser: Literal['electrochem']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.ChromTrace(*, parser: Literal['chromtrace'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for raw chromatography traces.
Note
For parsing processed (integrated) chromatographic data, use the
ChromData
parser.- class Params(*, filetype: Literal['ezchrom.asc', 'fusion.json', 'fusion.zip', 'agilent.ch', 'agilent.dx', 'agilent.csv'] = 'ezchrom.asc', calfile: str | None = None, species: Any | None = None, detectors: Any | None = None)
Bases:
BaseModel
- filetype: Literal['ezchrom.asc', 'fusion.json', 'fusion.zip', 'agilent.ch', 'agilent.dx', 'agilent.csv']
- calfile: str | None
Species calibration specification.
DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- species: Any | None
Species information as a
dict
.DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- detectors: Any | None
Detector integration parameters as a
dict
.DEPRECATED in
DataSchema-4.2
This feature is deprecated as of
yadg-4.2
and will stop working inyadg-5.0
.
- parser: Literal['chromtrace']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.ChromData(*, parser: Literal['chromdata'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for processed chromatography data.
- class Params(*, filetype: Literal['fusion.json', 'fusion.zip', 'fusion.csv', 'empalc.csv', 'empalc.xlsx'] = 'fusion.json')
Bases:
BaseModel
- filetype: Literal['fusion.json', 'fusion.zip', 'fusion.csv', 'empalc.csv', 'empalc.xlsx']
- parser: Literal['chromdata']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.MassTrace(*, parser: Literal['masstrace'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for mass spectroscopy traces.
- class Params(*, filetype: Literal['quadstar.sac'] = 'quadstar.sac')
Bases:
BaseModel
- filetype: Literal['quadstar.sac']
- parser: Literal['masstrace']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.QFTrace(*, parser: Literal['qftrace'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for network analyzer traces.
- class Params(*, filetype: Literal['labview.csv'] = 'labview.csv', method: Literal['naive', 'lorentz', 'kajfez'] = 'kajfez', height: float = 1.0, distance: float = 5000.0, cutoff: float = 0.4, threshold: float = 1e-06)
Bases:
BaseModel
- filetype: Literal['labview.csv']
- method: Literal['naive', 'lorentz', 'kajfez']
- height: float
- distance: float
- cutoff: float
- threshold: float
- parser: Literal['qftrace']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.XPSTrace(*, parser: Literal['xpstrace'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for XPS traces.
- class Params(*, filetype: Literal['phi.spe'] = 'phi.spe')
Bases:
BaseModel
- filetype: Literal['phi.spe']
- parser: Literal['xpstrace']
- tag: str | None
- externaldate: ExternalDate | None
- class dgbowl_schemas.yadg.dataschema_4_2.step.XRDTrace(*, parser: Literal['xrdtrace'], input: Input, parameters: Params = None, tag: str | None = None, externaldate: ExternalDate | None = None)
Bases:
BaseModel
Parser for XRD traces.
- class Params(*, filetype: Literal['panalytical.xy', 'panalytical.csv', 'panalytical.xrdml'] = 'panalytical.csv')
Bases:
BaseModel
- filetype: Literal['panalytical.xy', 'panalytical.csv', 'panalytical.xrdml']
- parser: Literal['xrdtrace']
- tag: str | None
- externaldate: ExternalDate | None
dgbowl_schemas.yadg.dataschema_4_2.timestamp module
- class dgbowl_schemas.yadg.dataschema_4_2.timestamp.TimestampSpec(*, index: int | None = None, format: str | None = None)
Bases:
BaseModel
Specification of the column index and string format of the timestamp.
- index: int | None
- format: str | None
- class dgbowl_schemas.yadg.dataschema_4_2.timestamp.Timestamp(*, timestamp: TimestampSpec)
Bases:
BaseModel
Timestamp from a column containing a single timestamp string.
- timestamp: TimestampSpec
- class dgbowl_schemas.yadg.dataschema_4_2.timestamp.UTS(*, uts: TimestampSpec)
Bases:
BaseModel
Timestamp from a column containing a Unix timestamp.
- uts: TimestampSpec
- class dgbowl_schemas.yadg.dataschema_4_2.timestamp.TimeDate(*, date: TimestampSpec | None = None, time: TimestampSpec | None = None)
Bases:
BaseModel
Timestamp from a separate date and/or time column.
- date: TimestampSpec | None
- time: TimestampSpec | None