Small framework for computational research data management
Project description
Cordage: Computational Research Data Management
Parameterize experiments using dataclasses and use cordage to easily parse configuration files and command line options.
[!IMPORTANT]
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, and improvemnt ideas as github issues.
Motivation
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.
Quick Start
For more detailed information, check out the documentation.
Installation
In an environment of your choice (python>=3.8), run:
pip install cordage
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.
Features
The main purpose of cordage is to manage configurations to make configuring reproducible experiments easy.
Cordage automatically generates a commandline interface which can be used to parse configuration files and/or
set specific configuration fields via CLI options (run the experiment with the --help option
to get an overview
over the available configuration fields).
By using the __series__
key, it is possible ot invoke multiple repetitions of an experiment using the same
base configuration but varying some of the configuration fields. The resulting trial runs are (by default)
saved in a common series-level directory.
Additionally, cordage can provide an output directory (via the output_dir
) where cordage will store the used configuration
as well as some experimental metadata.
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
File details
Details for the file cordage-0.0.5.tar.gz
.
File metadata
- Download URL: cordage-0.0.5.tar.gz
- Upload date:
- Size: 42.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0f506288028f81cf526e108863d4c64128cdd8c4df3a27d6fbdef03dc74b0b0 |
|
MD5 | 1b5a2178fe98aea689d5025dffbc20f3 |
|
BLAKE2b-256 | a999673851be3ae42b8588190e4aecadeca27174fc8f8119e9b11383c6106e8f |
Provenance
The following attestation bundles were made for cordage-0.0.5.tar.gz
:
Publisher:
publish.yml
on plonerma/cordage
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
cordage-0.0.5.tar.gz
- Subject digest:
c0f506288028f81cf526e108863d4c64128cdd8c4df3a27d6fbdef03dc74b0b0
- Sigstore transparency entry: 148187989
- Sigstore integration time:
- Predicate type:
File details
Details for the file cordage-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: cordage-0.0.5-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24997d860a3c6445219150d96b78fa4028790fb662c6d9dab93577e906fec584 |
|
MD5 | 11240b437f015e844899ab5d2367617b |
|
BLAKE2b-256 | 00a17316126e21ca0e8f6cf0383b6670d0a278a8c2a4157e5861cd54cab8ca0d |
Provenance
The following attestation bundles were made for cordage-0.0.5-py3-none-any.whl
:
Publisher:
publish.yml
on plonerma/cordage
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
cordage-0.0.5-py3-none-any.whl
- Subject digest:
24997d860a3c6445219150d96b78fa4028790fb662c6d9dab93577e906fec584
- Sigstore transparency entry: 148187992
- Sigstore integration time:
- Predicate type: