chore: prep for first PyPI release (v0.1.0)#1
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
0.1.0; classifierDevelopment Status :: 3 - AlphayourusernameURLs with the real repository ownerpyproject.tomlis now the single source of truth for dependencies; removerequirements.txtandrequirements-dev.txtTooling
pip install -e ".[dev]") instead of hard-coding tool versionsPublic API
simulate_rocket()andsimulate_multiple()now accept an optionalbody: CelestialBody | Noneparameter, enabling Moon, Mars, or custom-body simulations from the convenience APIbodyfield toRocket;potential_energy,total_energy, and the gravity term inRocket.updatenow use the correct body's surface gravity and radius instead of unconditionally using Earthget_preset()returns adataclasses.replace()copy instead of the shared globalRocketConfiginstance, preventing accidental mutation ofPRESETSCelestialBodyandSimulationStateinrocket_sim.__all__Bug fixes
logging.basicConfig(...)call fromRocketSimulation.__init__. Library code must not reconfigure the host application's root loggerEngine.specific_impulsefield. It was stored but never read; the integrator uses a constant-mass approximation, which is now explicitly documented<=instead of exact float equality inRocket.is_on_groundPhysics.gravity_at_altitudeandPhysics.escape_velocitydocstrings (verified against actual computed outputs)Documentation
Physics.atmospheric_densityandPhysics.drag_forceas standalone utilities, not part of the default trajectory loopNew Shepardpreset to explain its sub-1 thrust-to-weight ratio at the listed massesCONTRIBUTING.mdandCHANGELOG.mdto match the new tooling and versionRemovals
PlotConfigdataclass; it duplicatedPlotOptionsand was never imported. Removing it before the first publish avoids a breaking change laterIntegrationMethodenum andSimulationConfig.integration_methodfield, which were defined but never consulted byRocket.updateSimulationConfig.log_level(only used by the now-removedbasicConfigcall)Test plan
pytest— 62 tests passruff check src tests— cleanruff format --check src tests— cleanmypy src— no issuespython -m build— buildsrocket_sim-0.1.0.tar.gzandrocket_sim-0.1.0-py3-none-any.whltwine check dist/*— both passFalcon 9simulation on Earth and on the Moon, invoke therocket-simCLIget_preset()does not leak mutation into the globalPRESETSregistry