Skip to content

flywhl/diform

Repository files navigation



note: diform is still just an idea - don't install it


Features

Diform uses dependency injection to orchestrate data-transformation pipelines on-the-fly.

Installation

  • uv add diform

Usage

from typing import Any, NewType

import diform
import numpy as np

Tensor = NewType("tensor", np.ndarray)

def subtract_mean(data: Tensor) -> MeanSubtracted[Tensor]:
    ...

def pca(data: MeanSubtracted[Any]) -> Tensor:
    ...

container = diform.Container(subtract_mean, pca, dataset=np.array([[1, 2, 3], [4, 5, 6]])

data = container["pca"]()

Development

  • git clone https://github.com/flywhl/diform.git
  • cd diform
  • uv sync
  • just test

Flywheel

Science needs humble software tools. Flywheel is an open source collective building simple tools to preserve scientific momentum, inspired by devtools and devops culture. Join our Discord here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published