Skip to main content

Computational research data management tool

Project description

Cordage: Computational Research Data Management

Parameterize experiments using dataclasses and use cordage to easily parse configuration files and command line options.


Build status PyPI - Version PyPI - Python Version PyPI - License

Cordage Icon

Repository | Documentation | Package


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.

Check out the roadmap for an outline of the next steps that are planned for the development of this package.


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cordage-0.0.8.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

cordage-0.0.8-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file cordage-0.0.8.tar.gz.

File metadata

  • Download URL: cordage-0.0.8.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cordage-0.0.8.tar.gz
Algorithm Hash digest
SHA256 117ac9ad3d871bd36fbd2796f294eb1f738f6e14bc8d7eb323933f0208f0c4a1
MD5 584f835ec2d9b5bba995466cb321852d
BLAKE2b-256 1d0885e4365606f871e2d459e9017f4493bd55850ebbff4b4b890ade94704249

See more details on using hashes here.

Provenance

The following attestation bundles were made for cordage-0.0.8.tar.gz:

Publisher: publish.yml on plonerma/cordage

Attestations:

File details

Details for the file cordage-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: cordage-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for cordage-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7887d2f8d48823c86da172101ba1aaf54ca242b777a5f9eb213dae34266b2279
MD5 9319da8de82a7176db55704559b130fa
BLAKE2b-256 cf858f3a2aa62082bb9b54c7a1dfd69ee2853e8153877b07252e5e863982d7dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cordage-0.0.8-py3-none-any.whl:

Publisher: publish.yml on plonerma/cordage

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page