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()deprecated()removed()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
DataSchemaprocessing function of yadg.Takes in a
DataSchemaobject, updates it to the latest version compatible with the installed version of yadg, processes each step, and returns a singleDataTreecreated from theDataSchema.- Parameters:
dataschema – A
DataSchemaobject describing the extraction process.strict_merge – A
boolindicating whether metadata of the files processed in a single step has to be identical. Defaults toFalsewhich means conflicts will be dropped.
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
processsubcommand of yadg.This function first checks that the supplied
infileexists, 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
updatesubcommand of yadg.This function updates the dataschema present in the
infileto comply with the newest version of dataschema, and saves the resulting object intooutfile(which is theinfilewith 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
presetsubcommand of yadg.If
folderis an existing folder andpreseta valid dataschema template file, this function will prepend the specifiedfolderto all relative paths in thepreset, converting them to absolute paths.The resulting dataschema will be saved in the supplied
outfile.Alternatively, if
processis specified, the created dataschema will be directly processed into a datatree, which is then saved inoutfile.Additionally, the contents of the
foldercan be archived (ifarchiveis set), using a compression algorithm of your choice.
- yadg.subcommands.extract(*, filetype: str, infile: str, outfile: str, meta_only: bool, **kwargs: dict) None
The
extractsubcommand of yadg.If
filetypeis known to yadg, it will attempt to extract all data from the providedinfile.The data is returned as a
xarray.Datasetor a datatree, and is stored in a NetCDF file. The output location can be configured using theoutfileargument, by default this is set to the stem ofinfilewith a.ncsuffix.Optionally, an export of just the metadata can be requested by setting the
meta_onlyargument, in this case the output is a json file.