Metadata-Version: 2.5
Name: spaceodyssey
Version: 0.2.0
Summary: Astronomical analysis and observing campaigns: multi-visit observing programs with inference in the loop
Project-URL: Repository, https://github.com/CoreySpohn/spaceodyssey
Project-URL: Documentation, https://spaceodyssey.readthedocs.io
Author-email: Corey Spohn <corey.a.spohn@nasa.gov>
License: MIT License
        
        Copyright (c) 2026 Corey Spohn
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.12
Requires-Dist: equinox>=0.13.2
Requires-Dist: hwoutils>=1.10.0
Requires-Dist: jax>=0.9.0
Requires-Dist: jaxlib>=0.9.0
Requires-Dist: jaxtyping>=0.3.11
Requires-Dist: numpy>=2.1.2
Requires-Dist: photomancy>=0.6.0
Requires-Dist: planit-py>=0.2.0
Requires-Dist: zodi>=1.1.0
Provides-Extra: dev
Requires-Dist: pre-commit>=3.6; extra == 'dev'
Provides-Extra: docs
Requires-Dist: ipython>=8.18; extra == 'docs'
Requires-Dist: myst-nb>=1.1; extra == 'docs'
Requires-Dist: sphinx-autoapi>=3.0; extra == 'docs'
Requires-Dist: sphinx-book-theme>=1.1.3; extra == 'docs'
Requires-Dist: sphinx>=7.3.7; extra == 'docs'
Provides-Extra: optics
Requires-Dist: physicaloptix>=2.3; extra == 'optics'
Provides-Extra: physical
Requires-Dist: astropy>=6.1; extra == 'physical'
Requires-Dist: interpax>=0.3; extra == 'physical'
Requires-Dist: jaxedith>=2.1.1; extra == 'physical'
Requires-Dist: numpyro>=0.21.0; extra == 'physical'
Requires-Dist: optixstuff>=4.1.0; extra == 'physical'
Requires-Dist: orbix>=4.0.0; extra == 'physical'
Requires-Dist: skyscapes>=3.0.0; extra == 'physical'
Requires-Dist: yippy>=2.12.0; extra == 'physical'
Provides-Extra: retrieval
Requires-Dist: exojax>=2.5; extra == 'retrieval'
Provides-Extra: test
Requires-Dist: astropy>=6.0; extra == 'test'
Requires-Dist: astropy>=6.1; extra == 'test'
Requires-Dist: coronalyze>=1.2; extra == 'test'
Requires-Dist: hwoutils>=1.14.0; extra == 'test'
Requires-Dist: hypothesis>=6.79.1; extra == 'test'
Requires-Dist: ineedvalidation>=1.1; extra == 'test'
Requires-Dist: interpax>=0.3; extra == 'test'
Requires-Dist: jaxedith>=2.1.1; extra == 'test'
Requires-Dist: mpmath>=1.3; extra == 'test'
Requires-Dist: numpyro>=0.21.0; extra == 'test'
Requires-Dist: optixstuff>=4.1.0; extra == 'test'
Requires-Dist: orbix>=4.0.0; extra == 'test'
Requires-Dist: pytest-fail-slow>=0.1.0; extra == 'test'
Requires-Dist: pytest-markdown-docs>=0.5.0; extra == 'test'
Requires-Dist: pytest-testmon>=2.1.1; extra == 'test'
Requires-Dist: pytest-timeout>=1.3.1; extra == 'test'
Requires-Dist: pytest-xdist>=2.5; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Requires-Dist: scipy>=1.13; extra == 'test'
Requires-Dist: skyscapes>=3.0.0; extra == 'test'
Requires-Dist: yippy>=2.12.0; extra == 'test'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://pypi.org/project/spaceodyssey/"><img src="https://img.shields.io/pypi/v/spaceodyssey.svg?style=flat-square&logo=pypi" alt="PyPI"/></a>
  <a href="https://spaceodyssey.readthedocs.io"><img src="https://readthedocs.org/projects/spaceodyssey/badge/?version=latest&style=flat-square" alt="Documentation Status"/></a>
  <a href="https://github.com/CoreySpohn/spaceodyssey/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/CoreySpohn/spaceodyssey/ci.yml?branch=main&style=flat-square&logo=github&label=tests" alt="Tests"/></a>
  <a href="https://github.com/CoreySpohn/spaceodyssey/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="License"/></a>
  <a href="https://github.com/CoreySpohn/spaceodyssey/blob/main/pyproject.toml"><img src="https://img.shields.io/badge/python-3.12%2B-blue.svg?style=flat-square&logo=python" alt="Python 3.12+"/></a>
</p>

---

# spaceodyssey

A campaign run in **spaceodyssey** leaves a log of records, a ledger of spent budget and a belief about the simulated world; [Getting started](https://spaceodyssey.readthedocs.io/en/latest/getting-started.html) runs one in a few lines.

**spaceodyssey** supports astronomical analysis and observing campaigns: multi-visit observing programs with inference in the loop. Its JAX-based transaction core simulates a campaign as discrete events against a private simulated world, and a document codec writes and reads studies as JSON. Physical adapters connect it to the HWO direct imaging simulation tools:

- **[yippy](https://github.com/CoreySpohn/yippy)**: coronagraph performance data
- **[orbix](https://github.com/CoreySpohn/orbix)**: orbits and keepout geometry
- **[skyscapes](https://github.com/CoreySpohn/skyscapes)**: astrophysical scenes
- **[jaxedith](https://github.com/CoreySpohn/jaxedith)**: count rates and summary radiometry
- **[photomancy](https://github.com/CoreySpohn/photomancy)**: priors and posteriors
- **planit-py**: action and observing-context vocabulary

The physical adapters need the `physical` extra.

## Key Features

*   **Transaction core**: `spaceodyssey.core` orders events, admits effects, accounts for resources and keeps simulated truth apart from what a policy can see
*   **Two executors**: a host executor and a compiled executor that scans over steps and batches worlds with `vmap`, on the same transaction rules
*   **Study documents**: `spaceodyssey.codec` dumps and loads studies through registered, versioned kinds, with checkpoint and resume for long runs
*   **JAX-native**: array-based scientific state and composable simulation components

## Installation

With [uv](https://docs.astral.sh/uv/) (recommended):

```bash
uv pip install spaceodyssey
```

Or with pip:

```bash
pip install spaceodyssey
```

*(Note: You may need to install JAX separately to match your specific hardware acceleration requirements.)*

## Quick Start

```python
import jax

jax.config.update("jax_enable_x64", True)

import jax.numpy as jnp
import jax.random as jr

from spaceodyssey.core import Capacities, HostExecutor, RunStatus
from spaceodyssey.studies import builder, toy

caps = Capacities(n_subjects=2, n_an=2, n_assets=1, n_lanes=1, n_channels=1)
study = builder.survey_1(caps=caps)
truth = toy.ToyTruth(signal=jnp.array([1.0, 1.2]))
result = HostExecutor().run(study, truth, jr.PRNGKey(0), 40)
print(RunStatus(result.status).name, int(result.carry.log.valid.sum()), "records")
```

A run of this five-observation toy campaign ends `COMPLETE` and leaves five records in
its log, a ledger of the budget it spent and a belief about each star.

## Documentation

Full documentation is available at [spaceodyssey.readthedocs.io](https://spaceodyssey.readthedocs.io).
