Skip to content

Rats is a collection of tools to help researchers define and run experiments. It is designed to be a modular and extensible framework currently supporting building and running pipelines, integrating configs and services.

License

microsoft/rats

Repository files navigation

πŸ€ Research Analysis Tools (rats)

Main codecov pre-commit.ci status Checked with pyright Ruff License: MIT

PyPI - Version PyPI - Python Version PyPI - Wheel

Rats is a collection of tools to help researchers define and run experiments. It is designed to be a modular and extensible framework currently supporting building and running pipelines, integrating configs and services.

πŸ“” Documentation

https://microsoft.github.io/rats

πŸ§€ Components

rats-apps

A light package containing the interfaces and tools to organize your code in a modular way. It provides the mechanisms to define services (a.k.a., general purpose objects) and containers (classes containing service providers). These containers are then added to a general app as plugins providing an entry point to a whole ecosystem of general services.

rats-pipelines

A package to define and run pipelines of nodes (computational tasks) and edges (node dependencies or data dependencies). It provides a low-level API to define pipeline execution, task execution and IO management. It also provides a high level API to orchestrate running a pipeline locally or in a distributed environment.

rats-processors

A package to create and compose pipelines in a higher level API, where processors (classes or unbound methods) are mapped into pipeline nodes, node ports are inferred from the processors signature, and edges are created by connecting the node ports inputs and outputs. Pipelines defined this way are immutable objects that can be reused and composed into larger pipelines.

rats-devtools

A light component to help with the development of the other components. It provides a set of tools to generate documentation, run tests, format and lint code and help in the release process.

🐾 Getting started

Install the latest version of rats from PyPI for any component you want:

# With pip3.
pip3 install rats-apps rats-apps rats-pipelines rats-processors

# With poetry.
poetry add rats-apps rats-apps rats-pipelines rats-processors

# With uv.
uv pip install rats-apps rats-apps rats-pipelines rats-processors

# With pipenv.
pipenv install rats-apps rats-apps rats-pipelines rats-processors

πŸ‘©β€πŸ’» Development

Optional system dependencies

We use the following optional dependencies for development:

  • direnv: To manage environment variables and load python virtual environments automatically.
  • pyenv: To manage python versions.
  • pipx: To install python packages in isolated environments.
  • commitizen: To help with conventional commits.
  • cz-conventional-gitmoji: A commitizen plugin that combines gitmoji and conventional commits.
  • pre-commit: To run code formatting and linting before committing.

Required system dependencies

For setting up the development environment:

  • Clone the repository and cd into it.
  • Install the dependencies with poetry:
cd rats; poetry install; cd -
cd rats-apps; poetry install; cd -
cd rats-devtools; poetry install; cd -
cd rats-pipelines; poetry install; cd -
cd rats-processors; poetry install; cd -
  • Install rats-devtools command (optional):
pipx install -e rats-devtools  # installs in local environment

Devcontainer

Learn about Devcontainers. Requires Docker installed on your local machine.

πŸ‘‰ Follow instructions for VSCode and/or PyCharm.

GitHub Codespaces

Learn about codespaces.

Open in GitHub Codespaces

⛰️ Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

βš–οΈ Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

About

Rats is a collection of tools to help researchers define and run experiments. It is designed to be a modular and extensible framework currently supporting building and running pipelines, integrating configs and services.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages