Small framework for computational research data management
Project description
Cordage: Computational Research Data Management
Parameterize experiments using dataclasses and used cordage to easily parse configuration files and command line options.
Cordage is in a very early stage. Currently, it lacks a lot of documentation and wider range of features. If you think it could be useful for you, try it out and leave suggestions, complains, ideas for improvements as github issues.
Quick Start
Installation
In your environment of choice (with python >= 3.8), run:
pip install cordage
Usage
In many cases, we want to execute and parameterize a main function.
Since experiments can quickly become more complex and may use an increasing number of parameters,
it often makes sense to store these parameters in a dataclass
.
Cordage makes it easy to load configuration files or configure the experiment via the commandline.
Example
from dataclasses import dataclass
import cordage
@dataclass
class Config:
lr: float = 5e-5
name: str = "MNIST"
def train(config: Config):
"""Help text which will be shown."""
print(config)
if __name__ == "__main__":
cordage.run(train)
To use cordage, you need a main function (e.g. func
) which takes a dataclass configuration object as an argument.
Use cordage.run(func)
to execute this function with arguments passed via the command line. Cordage parses the
configuration and creates an output directory (if the function accepts output_dir
, it will be passed as such).
See the examples in the examples directory for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cordage-0.0.4.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb550508de67a6db6d6d0cc66f64826eb8ec949975667a054f9e81a03c591e3d |
|
MD5 | 5cacd9488ad05b3cdd824d3194ee6252 |
|
BLAKE2b-256 | 24b0fe91a08c961b371661ff9f3fd7e3be4e1c0affe2ba2891844b8df843d9c4 |