yadg package
- yadg.run_with_arguments()
Main execution function.
This is the function executed when yadg is launched via its executable. The function has the following subcommands:
extract
: extracts (meta)data from a given file.process
: processes a given dataschema, extracting data into a NetCDF file.update
: updates a given dataschema to the current version.preset
: creates a dataschema from a preset file and a target folder.
Subpackages
- yadg.dgutils package
get_yadg_metadata()
now()
infer_timestamp_from()
str_to_uts()
ole_to_uts()
complete_timestamps()
complete_uts()
update_schema()
schema_from_preset()
read_value()
sanitize_units()
dicts_to_dataset()
append_dicts()
merge_dicttrees()
merge_meta()
- yadg.dgutils.btools module
- yadg.dgutils.dateutils module
- yadg.dgutils.dsutils module
- yadg.dgutils.helpers module
- yadg.dgutils.pintutils module
- yadg.dgutils.schemautils module
- yadg.extractors package
extract()
- Subpackages
- agilent: For Agilent chromatograms
- basic: For tabulated data
- drycal: For MesaLabs Drycal Pro data
- eclab: For BioLogic data files
- empalc: For Empa’s LC data
- example: For yadg testing
- ezchrom: For EZChrom chromatograms
- fhimcpt: For MCPT set-up at FHI
- fusion: For Fusion chromatograms
- panalytical: For Panalytical XRD data
- phi: For Phi XPS data
- picolog: For PicoTech PicoLog data
- quadstar: For Quadstar MS data
- tomato: For tomato outputs
- touchstone: For Touchstone VNA files
yadg.core module
- yadg.core.process_schema(dataschema: DataSchema, strict_merge: bool = False) DataTree
The main processing function of yadg.
Takes in a
DataSchema
object and returns a singleDataTree
created from theDataSchema
.
yadg.main module
- yadg.main.set_loglevel(delta: int)
- yadg.main.run_with_arguments()
Main execution function.
This is the function executed when yadg is launched via its executable. The function has the following subcommands:
extract
: extracts (meta)data from a given file.process
: processes a given dataschema, extracting data into a NetCDF file.update
: updates a given dataschema to the current version.preset
: creates a dataschema from a preset file and a target folder.
yadg.subcommands module
- yadg.subcommands.process(*, infile: str, outfile: str, ignore_merge_errors: bool, **kwargs: dict) None
The
process
subcommand of yadg.This function first checks that the supplied
infile
exists, is a valid dataschema, and if yes, proceeds to process the dataschema into a datatree. If this is successful, the datatree is written out intooutfile
(which is"datagram.nc"
by default).
- yadg.subcommands.update(*, infile: str, outfile: str, **kwargs: dict) None
The
update
subcommand of yadg.This function updates the dataschema present in the
infile
to comply with the newest version of dataschema, and saves the resulting object intooutfile
(which is theinfile
with a “.new.json” suffix by default).
- yadg.subcommands.preset(*, preset: str, folder: str, outfile: str, process: bool, archive: bool, packwith: str, ignore_merge_errors: bool, **kwargs: dict) None
The
preset
subcommand of yadg.If
folder
is an existing folder andpreset
a valid dataschema template file, this function will prepend the specifiedfolder
to all relative paths in thepreset
, converting them to absolute paths.The resulting dataschema will be saved in the supplied
outfile
.Alternatively, if
process
is specified, the created dataschema will be directly processed into a datatree, which is then saved inoutfile
.Additionally, the contents of the
folder
can be archived (ifarchive
is set), using a compression algorithm of your choice.
- yadg.subcommands.extract(*, filetype: str, infile: str, outfile: str, meta_only: bool, **kwargs: dict) None
The
extract
subcommand of yadg.If
filetype
is known to yadg, it will attempt to extract all data from the providedinfile
.The data is returned as a
xarray.Dataset
or a datatree, and is stored in a NetCDF file. The output location can be configured using theoutfile
argument, by default this is set to the stem ofinfile
with a.nc
suffix.Optionally, an export of just the metadata can be requested by setting the
meta_only
argument, in this case the output is a json file.