Skip to content

chore: prep for first PyPI release (v0.1.0)#1

Merged
rramboer merged 2 commits into
mainfrom
chore/pypi-prep
May 6, 2026
Merged

chore: prep for first PyPI release (v0.1.0)#1
rramboer merged 2 commits into
mainfrom
chore/pypi-prep

Conversation

@rramboer

@rramboer rramboer commented May 6, 2026

Copy link
Copy Markdown
Owner

Summary

Prepares the project for its first publication on PyPI. Includes packaging-metadata fixes, tooling consolidation, several public-API improvements, and a number of correctness and documentation fixes.

Changes

Packaging & metadata

  • Set version to 0.1.0; classifier Development Status :: 3 - Alpha
  • Replace placeholder yourusername URLs with the real repository owner
  • pyproject.toml is now the single source of truth for dependencies; remove requirements.txt and requirements-dev.txt

Tooling

  • Consolidate linting and formatting on Ruff; remove Black, isort, and Bandit
  • Add Python 3.13 to the CI test matrix (already declared in classifiers)
  • Add pip caching to CI jobs and install dev extras (pip install -e ".[dev]") instead of hard-coding tool versions
  • Pre-commit configuration updated to match new tooling

Public API

  • simulate_rocket() and simulate_multiple() now accept an optional body: CelestialBody | None parameter, enabling Moon, Mars, or custom-body simulations from the convenience API
  • Add a body field to Rocket; potential_energy, total_energy, and the gravity term in Rocket.update now use the correct body's surface gravity and radius instead of unconditionally using Earth
  • get_preset() returns a dataclasses.replace() copy instead of the shared global RocketConfig instance, preventing accidental mutation of PRESETS
  • Export CelestialBody and SimulationState in rocket_sim.__all__

Bug fixes

  • Remove logging.basicConfig(...) call from RocketSimulation.__init__. Library code must not reconfigure the host application's root logger
  • Remove unused Engine.specific_impulse field. It was stored but never read; the integrator uses a constant-mass approximation, which is now explicitly documented
  • Use <= instead of exact float equality in Rocket.is_on_ground
  • Correct erroneous example values in Physics.gravity_at_altitude and Physics.escape_velocity docstrings (verified against actual computed outputs)

Documentation

  • Add explicit modelling caveats to the README: motion is 1-D vertical, mass is constant, and atmospheric drag is not applied to trajectories
  • Document Physics.atmospheric_density and Physics.drag_force as standalone utilities, not part of the default trajectory loop
  • Footnote the New Shepard preset to explain its sub-1 thrust-to-weight ratio at the listed masses
  • Update CONTRIBUTING.md and CHANGELOG.md to match the new tooling and version

Removals

  • Delete unused PlotConfig dataclass; it duplicated PlotOptions and was never imported. Removing it before the first publish avoids a breaking change later
  • Remove dead IntegrationMethod enum and SimulationConfig.integration_method field, which were defined but never consulted by Rocket.update
  • Remove SimulationConfig.log_level (only used by the now-removed basicConfig call)

Test plan

  • pytest — 62 tests pass
  • ruff check src tests — clean
  • ruff format --check src tests — clean
  • mypy src — no issues
  • python -m build — builds rocket_sim-0.1.0.tar.gz and rocket_sim-0.1.0-py3-none-any.whl
  • twine check dist/* — both pass
  • Smoke test in a clean virtualenv: install the wheel, import the package, run a Falcon 9 simulation on Earth and on the Moon, invoke the rocket-sim CLI
  • Verify get_preset() does not leak mutation into the global PRESETS registry
  • CI green on this PR

rramboer added 2 commits May 6, 2026 12:41
- Set version to 0.1.0; classifier to Alpha (more honest first release)
- Replace yourusername placeholder URLs with rramboer
- Consolidate tooling on Ruff (drop black, isort, bandit redundancy)
- Drop duplicate requirements*.txt; pyproject.toml is sole source of truth
- Remove dead IntegrationMethod config option (was never wired into Rocket.update)
- Document that Rocket.update uses symplectic Euler / Euler-Cromer
- Update README/CONTRIBUTING/CHANGELOG to match new tooling + version
- Add Python 3.13 to CI matrix; drop reference to nonexistent develop branch
- Add pip caching to CI; install dev extras instead of hardcoded tool versions
Eight critical issues surfaced by the comprehensive review pass on PR #1:

- C1: Remove logging.basicConfig() from RocketSimulation.__init__ — library
  code must never reconfigure the host application's root logger. Drop the
  unused log_level field from SimulationConfig along with it.
- C2: Remove Engine.specific_impulse — it was stored but never read by the
  integrator. The simulation uses a constant-mass approximation, which is
  now explicitly documented on Rocket and in the README's modelling caveats.
- C3: Document Physics.atmospheric_density and Physics.drag_force as
  standalone utilities not wired into the trajectory loop. Update the
  README's "Atmospheric Density (optional)" claim, which was misleading.
- C4: Correct wrong example values in physics.py docstrings
  (gravity_at_altitude(400_000): 8.676 -> 8.694; escape_velocity(400_000):
  10926.5 -> 10850.5; verified against actual outputs).
- C5: Delete dead PlotConfig dataclass — duplicated PlotOptions and was
  never imported anywhere. Removing pre-publish avoids a breaking removal
  later.
- C6: get_preset() now returns a dataclasses.replace() copy instead of the
  shared global RocketConfig instance, preventing accidental mutation of
  PRESETS at runtime.
- C7: simulate_rocket() and simulate_multiple() accept an optional `body`
  parameter and forward it to RocketSimulation, so the convenience API can
  simulate launches from the Moon, Mars, or custom bodies.
- C8: Wire CelestialBody through Rocket itself (new `body` field on Rocket;
  Rocket.from_config and RocketSimulation pass it through). potential_energy
  and total_energy now use the correct body's surface gravity and radius
  instead of always assuming Earth.

Also addresses a few important footguns flagged in the same review:
- is_on_ground uses <= instead of exact float equality.
- README clarifies modelling caveats (1-D vertical, constant mass, no drag)
  and footnotes New Shepard's T/W < 1 to explain "immediate landing" output.
- Add CelestialBody and SimulationState to __init__.py.__all__ — both are
  part of the documented public API but were unexported.

All 62 tests pass; ruff + mypy clean; build + twine check pass.
@rramboer rramboer merged commit 4f58984 into main May 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant