OSeMOSYS / otoole

OSeMOSYS Tools for Energy
https://otoole.readthedocs.io
MIT License
25 stars 19 forks source link

DataPackage writer should create a metadata file from the user config #122

Closed willu47 closed 1 year ago

willu47 commented 2 years ago

Problem

At present, the class method .write on the WriteDatapackage strategy does not generate the metadata file from the config.

Reason

When a custom user configuration file is used (as per PR #120), metadata is copied from a template file, so there is a mismatch between the user configuration and the written data package metadata.

Solution

Generate the metadata file from the user config, preferably using the new frictionless library.

Modify the WriteDatapackage class to use frictionless.Package and frictionless.Resource classes to generate the metadata. Or, programmatically create a YAML or JSON metadata file from the config dictionary.