Metadata-Version: 2.4
Name: landscapy-ml
Version: 1.0.0
Summary: PyTorch adapters and example training pipelines for Landscapy fitness landscapes
Author-email: "Matthew A. Spence" <matthew.spence@anu.edu.au>
License-Expression: MIT
Project-URL: Homepage, https://github.com/MA-Spence/landscapy-ml
Project-URL: Issues, https://github.com/MA-Spence/landscapy-ml/issues
Project-URL: Repository, https://github.com/MA-Spence/landscapy-ml
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1
Requires-Dist: gpytorch>=1.13
Requires-Dist: landscapy<2,>=1
Requires-Dist: networkx>=3.2
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: pytorch-lightning>=2.3
Requires-Dist: scipy>=1.10
Requires-Dist: tensorboard>=2.20
Requires-Dist: torch>=2.2
Requires-Dist: torch-geometric>=2.6
Requires-Dist: wandb>=0.16
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: numpydoc>=1.7; extra == "dev"
Requires-Dist: pre-commit==4.3.0; extra == "dev"
Requires-Dist: pydocstyle==6.3.0; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=6.0; extra == "dev"
Requires-Dist: pytest-mock>=3.14; extra == "dev"
Requires-Dist: ruff==0.12.11; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Provides-Extra: graph
Requires-Dist: torch-geometric>=2.6; extra == "graph"
Provides-Extra: gp
Requires-Dist: gpytorch>=1.13; extra == "gp"
Provides-Extra: examples
Requires-Dist: gpytorch>=1.13; extra == "examples"
Requires-Dist: torch-geometric>=2.6; extra == "examples"
Provides-Extra: tracking
Requires-Dist: wandb>=0.16; extra == "tracking"
Provides-Extra: all
Requires-Dist: gpytorch>=1.13; extra == "all"
Requires-Dist: torch-geometric>=2.6; extra == "all"
Requires-Dist: wandb>=0.16; extra == "all"
Dynamic: license-file

# landscapy-ml

[![CI](https://github.com/MA-Spence/landscapy-ml/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/MA-Spence/landscapy-ml/actions/workflows/ci.yml)

`landscapy-ml` is the small bridge between
[`landscapy`](https://github.com/MA-Spence/landscapy) `FitnessLandscape`
objects and PyTorch models.

More information, documentation and usage instructions can be found on
[`landscapy`](https://github.com/MA-Spence/landscapy).

## Installation

`landscapy-ml` is installed by default with `pip install landscapy` or
`pip install landscapy-ml`. This remains the recommended installation path.

To install directly from a checkout:

```bash
python -m pip install .
```

## Python

Use the Python interface to convert a `FitnessLandscape` into PyTorch-ready
records and datasets, then adapt model outputs back into landscape layers as
described in the [Python usage guide](docs/python_usage.md).

```python
from importlib.resources import files

from fitness_landscape.core.landscape import read_csv_landscape

from landscapyml import (
    LandscapeDataset,
    export_landscape_records,
    make_fitness_target_getter,
)

data_path = files("landscapyml").joinpath("data/minimal_landscape.csv")
landscape = read_csv_landscape(
    data_path,
    sequence_col="sequence",
    alphabet=list("AC"),
    graph="hamming",
    numeric_layers=["target"],
    attach_embeddings=False,
)
exported = export_landscape_records(
    landscape,
    fitness_layers=["target"],
    include_embeddings=False,
)
dataset = LandscapeDataset(
    exported.records,
    target_getter=make_fitness_target_getter("target"),
)

features, target = dataset[0]
print(len(dataset), features.shape, target.shape)
```

## CLI

Use the command-line interface to inspect registered models and data builders
and run the maintained CSV workflows described in the [CLI guide](docs/cli.md).
