Metadata-Version: 2.4
Name: pykep-rust
Version: 0.1.5
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Dist: numpy>=1.26
Requires-Dist: mypy>=1.15,<2 ; extra == 'test'
Requires-Dist: pytest>=8,<10 ; extra == 'test'
Provides-Extra: test
License-File: LICENSE
License-File: UPSTREAM_NOTICE.md
License-File: crates/pykep-trajopt/data/NOTICE.md
Summary: Native Rust astrodynamics algorithms with a Python API.
Home-Page: https://dietmarwo.github.io/pykep-core-rust/
Author: Dietmar Wolz
License-Expression: MPL-2.0
Requires-Python: >=3.11, <3.14
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/dietmarwo/pykep-core-rust/blob/main/CHANGELOG.md
Project-URL: Documentation, https://dietmarwo.github.io/pykep-core-rust/
Project-URL: Issues, https://github.com/dietmarwo/pykep-core-rust/issues
Project-URL: Performance, https://github.com/dietmarwo/pykep-core-rust/blob/main/PERFORMANCE_GUIDE.md
Project-URL: Repository, https://github.com/dietmarwo/pykep-core-rust
Project-URL: Security, https://github.com/dietmarwo/pykep-core-rust/security/policy

# Python API

`pykep_rust` is the typed, collision-safe Python interface to the native
`pykep-core` implementation. It covers foundations, epochs and anomalies,
element conversion, two-body propagation and STMs, mission-design utilities,
Lambert problems, ephemerides, evaluated dynamics, and low-thrust legs.

Since 0.1.5 the wheels include the native `pykep_rust.trajopt.gym` catalog:
14 classical mission problems, 34 fixed and 34 moving TOPS low-thrust
problems with analytic gradients, and six launcher tables. See the
[gym guide](https://dietmarwo.github.io/pykep-core-rust/trajectory-gym.html)
for examples and the
[matched report](https://dietmarwo.github.io/pykep-core-rust/matched-benchmarks.html)
for Python and native timings.

```python
import pykep_rust as pk

assert pk.jd_to_mjd2000(2_451_544.5) == 0.0
assert pk.cross([1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) == [0.0, 0.0, 1.0]
epoch = pk.Epoch.from_iso("2030-01")
assert epoch.to_iso() == "2030-01-01T00:00:00.000000"
eccentric = pk.mean_to_eccentric_anomaly(0.1, 0.5)
assert abs(pk.eccentric_to_mean_anomaly(eccentric, 0.5) - 0.1) < 1e-15
state = pk.classical_to_cartesian([7e6, 0.01, 0.4, 1.0, 0.5, 0.2], 3.986004418e14)
earth = pk.Planet.jpl_low_precision("earth")
earth_state = earth.state(0.0)
```

Key conventions:

- Angles are radians.
- Julian conversions are arithmetic day counts without an implied UTC, TT, or
  TDB time scale.
- Numeric `Epoch` arithmetic uses days; `add_seconds()` and `seconds_since()`
  make second-based arithmetic explicit.
- Public numerical functions reject NaN and infinity.
- Ordered batches preserve scalar semantics and release the GIL around native
  work.
- `workers=0` uses Rayon's shared pool, `workers=1` runs serially, and
  `workers=N` uses a cached pool of exactly `N` threads. Avoid nested full-size
  pools.
- Constructors copy their data into immutable native objects.

The wheel ships a `py.typed` marker and complete extension stub. The full
units, shape, default, ownership, and error contract is in
[`docs/python-api.md`](../docs/python-api.md). Users moving from `kep3` should
read [`docs/python-migration.md`](../docs/python-migration.md); no partial
legacy-name facade is installed.

