yadg package
- yadg.run_with_arguments()
Main execution function.
This is the function executed when yadg is launched using the executable. The function has three subcommands:
process
: processes a given schema into a datagram.update
: updates a given schema or datagram to the current version.preset
: creates a schema from a preset file and a target folder.
Subpackages
- yadg.core package
- yadg.dgutils package
- yadg.extractors package
- yadg.parsers package
- Subpackages
- basiccsv: Common tabular file parser
- chromdata: Post-processed chromatography data parser
- chromtrace: Raw chromatogram trace file parser
- dummy: A dummy parser
- electrochem: Electrochemistry data parser
- flowdata: Flow data parser
- masstrace: Mass spectroscopy trace file parser
- meascsv: Legacy MCPT log file parser
- qftrace: Network analyser trace file parser
- xpstrace: XPS trace file parser
- xrdtrace: X-ray diffractogram trace file parser
- Subpackages
Submodules
- yadg.main.version_check(project='yadg')
- yadg.main.set_loglevel(delta)
- yadg.main.run_with_arguments()
Main execution function.
This is the function executed when yadg is launched using the executable. The function has three subcommands:
process
: processes a given schema into a datagram.update
: updates a given schema or datagram to the current version.preset
: creates a schema from a preset file and a target folder.
- yadg.subcommands.process(args)
The
process
subcommand of yadg.This function first checks that the supplied
args.infile
exists, is a valid schema, and if yes, proceeds to process the schema into a datagram. If this is successful, the datagram is checked for validity and written out intoargs.outfile
(which is “datagram.json” by default).- Return type:
None
- yadg.subcommands.update(args)
The
update
subcommand of yadg.This function updates the DataSchema present in the
args.infile
argument to comply with the newest version of DataSchema, and saves the resulting object intoargs.outfile
(which is theargs.infile
with a “.new.json” suffix by default).- Return type:
None
- yadg.subcommands.preset(args)
The
preset
subcommand of yadg.This function requires the
args.preset
andargs.folder
arguments. Ifargs.folder
is an existing folder andargs.preset
a valid schema file (with appropriately formated"import"
and"calfile"
entries), this function will prepend the specifiedargs.folder
to all paths in theargs.preset
, convert them to absolute paths, and save the resulting schema in the suppliedargs.outfile
.Alternatively, if
args.process
is specified, the created schema will be directly processed into a datagram, which is then saved inargs.outfile
.- Return type:
None
- yadg.subcommands.extract(args)
The
extract
subcommand of yadg.This function requires the
args.filetype
andargs.infile
positional arguments. Ifargs.filetype
(or it’s namespaced version, such asmarda:{args.filetype}
) is a knownFileType
,yadg
will attempt to extract metadata and data from the providedargs.infile
.The data is returned as a NetCDF file. The location can be configured using the
args.outfile
parameter, by default this is set to the stem ofargs.infile
with a.nc
suffix.- Return type:
None