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.9.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cordage-0.0.9-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cordage-0.0.9.tar.gz
  • Upload date:
  • Size: 44.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for cordage-0.0.9.tar.gz
Algorithm Hash digest
SHA256 e19f002970dbcba1a9f2590842443f0db3bb136d9e25cf4df986b3c276759d00
MD5 80a4c3651d0448149bae9caa533efb05
BLAKE2b-256 66cd15b45f187d253ed78aa146068077d6543a90c295e9b216b43a6e9e4131ee

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on plonerma/cordage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: cordage-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for cordage-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9e48206074f223ee3fc34f54fcd5e2c46cc67f6ccfe70a247787652b51f87d6d
MD5 e69dd38de60f6e0e99a04ec39f2c16a5
BLAKE2b-256 c7a0ac0cf368b69178185e7b37ef27600c7a0cfbc6120d9aa214c1db4bf5e21c

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on plonerma/cordage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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