Metadata-Version: 2.1
Name: rats-processors
Version: 0.1.3.dev18
Summary: Rats Processors
Home-page: https://github.com/microsoft/rats/
License: MIT
Keywords: pipelines,machine learning,research
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: dill (>=0.3.5,<0.4.0)
Requires-Dist: furl (>=2.1.3,<3.0.0)
Requires-Dist: hydra-core (>=1.3.2,<2.0.0)
Requires-Dist: hydra-zen
Requires-Dist: omegaconf
Requires-Dist: pydot (>=1.4.2,<2.0.0)
Requires-Dist: rats-apps (>=0.1.2,<0.2.0)
Requires-Dist: rats-pipelines (>=0.1.2,<0.2.0)
Project-URL: Documentation, https://microsoft.github.io/rats/
Project-URL: Repository, https://github.com/microsoft/rats/
Description-Content-Type: text/markdown

# rats-processors




In you python project or Jupyter notebook, you can compose a pipeline as follows:

```python
from typing import NamedTuple

import pandas as pd
from rats.apps import PipelineContainer
from rats.processors import CombinedPipeline, ExecutablePipeline, task, pipeline


class DataOut(NamedTuple):
    data: pd.DataFrame


class MyContainer(PipelineContainer):
    @task
    def load_data(self) -> DataOut:
        return DataOut(data=pd.read_csv("data.csv"))

    @task
    def train_model(self, data: pd.DataFrame):
        return {"model": "trained"}

    @pipeline
    def my_pipeline(self) -> ExecutablePipeline:
        load_data = self.load_data()
        train_model = self.get(train_model)
        return self.combine(
            pipelines=[load_data, train_model],
            dependencies=(train_model.inputs.data << load_data.outputs.data),
        )
```
and run it like this:

```python
container = MyContainer()  # initialize your container
p = container.get("my_pipeline")  # public method to get a service from a container
container.draw(p)
container.run(p)
```

