Metadata-Version: 2.4
Name: dpct-run
Version: 0.1.0
Summary: Runtime-only package for running saved DPCT individuals without the evolution/optimizer stack
Author-email: perceptualrobots <rupert@perceptualrobots.com>
License-Expression: Apache-2.0
Project-URL: Repository, https://github.com/perceptualrobots/dpct-run
Project-URL: Issues, https://github.com/perceptualrobots/dpct-run/issues
Keywords: perceptual-control-theory,gymnasium,tensorflow,runtime
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tensorflow<2.17.0,>=2.16.0
Requires-Dist: ml-dtypes~=0.3.1
Requires-Dist: gymnasium>=0.29.0
Requires-Dist: pygame>=2.0.0
Requires-Dist: numpy<2.0.0,>=1.26.0
Provides-Extra: plots
Requires-Dist: matplotlib>=3.9.0; extra == "plots"
Requires-Dist: networkx>=3.0.0; extra == "plots"
Provides-Extra: video
Requires-Dist: imageio>=2.34.0; extra == "video"
Requires-Dist: imageio-ffmpeg>=0.5.1; extra == "video"
Provides-Extra: comet
Requires-Dist: comet_ml; extra == "comet"
Provides-Extra: legacy
Requires-Dist: pct>=0.1.1; extra == "legacy"
Provides-Extra: box2d
Requires-Dist: gymnasium[box2d]; extra == "box2d"
Requires-Dist: swig; extra == "box2d"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: matplotlib>=3.9.0; extra == "dev"
Requires-Dist: networkx>=3.0.0; extra == "dev"
Requires-Dist: imageio>=2.34.0; extra == "dev"
Requires-Dist: imageio-ffmpeg>=0.5.1; extra == "dev"
Requires-Dist: pct>=0.1.1; extra == "dev"
Provides-Extra: all
Requires-Dist: matplotlib>=3.9.0; extra == "all"
Requires-Dist: networkx>=3.0.0; extra == "all"
Requires-Dist: imageio>=2.34.0; extra == "all"
Requires-Dist: imageio-ffmpeg>=0.5.1; extra == "all"
Requires-Dist: comet_ml; extra == "all"
Requires-Dist: pct>=0.1.1; extra == "all"
Requires-Dist: gymnasium[box2d]; extra == "all"
Requires-Dist: swig; extra == "all"
Dynamic: license-file

# dpct-run

Runtime-only package for running saved Deep Perceptual Control Theory (DPCT) individuals.

`dpct-run` is intended for external users who need to replay/evaluate trained DPCT individuals in Gymnasium environments without access to the full private DPCT evolution and optimization stack.

## What is included

- Load saved `DHPCTIndividual.config()` / `best_individual.json` files
- Reconstruct the Keras runtime controller
- Run/evaluate individuals in Gymnasium environments
- Optional model summaries, network images, rollout history graphs, and videos
- Optional Comet `best_individual.json` download helper
- Optional legacy `pct` config loading/conversion support

## What is deliberately not included

- Evolution (`DHPCTEvolver`)
- Optuna optimization (`DHPCTOptimizer`)
- Genetic mutation/mating APIs
- DEAP/Optuna dependencies
- Comet experiment logging for evolutionary runs

## Install

From PyPI:

```bash
pip install dpct-run
```

Optional extras:

```bash
pip install "dpct-run[plots,video,comet,legacy]"
```

From GitHub:

```bash
pip install git+https://github.com/perceptualrobots/dpct-run.git
```

## CLI examples

Show a saved config summary:

```bash
dpct-run-individual best_individual.json --show-config
```

Run a saved individual:

```bash
dpct-run-individual best_individual.json --run --steps 500 --seed 42
```

Save rollout history graphs:

```bash
dpct-run-individual best_individual.json --run --history-dir ./history --history-graphs all
```

Use the short alias:

```bash
dpct-run best_individual.json --run --steps 500
```

## Python example

```python
from dpct_run import DHPCTIndividual

config = DHPCTIndividual.load_config("best_individual.json")
individual = DHPCTIndividual.from_config(config)
fitness = individual.evaluate(steps=500, early_termination=True)
print(fitness, individual.success, individual.total_reward)
```

## Compatibility notes

`dpct-run` follows the saved DPCT config schema produced by the full DPCT package. Treat `best_individual.json` as the primary interchange artifact.

This initial extraction targets classic Gymnasium-style environments and generic built-in fitness methods (`cumulative_reward`, `evaluation_steps`, `rms`, `mae`, adjusted RMS/MAE). Environment-specific scoring from `dpct-env` is optional and only used if that package is separately installed.
