Feature/operational logging - #125
Merged
andytorrestb merged 11 commits intoJul 25, 2026
Merged
Conversation
ensure_dir/ensure_parent_dir now log created directories at INFO and existing ones at DEBUG, so directory activity is traceable without scattering os.path.isdir/os.mkdir blocks. A logging failure never blocks creating a required directory. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace get_logger() with an opt-in, application-boundary logging system built on the standard library. configure_logging(case_dir) resolves settings (explicit args > env vars > case logging.ini > defaults), installs PyRPOD-owned console/file handlers on the 'pyrpod' package logger (never root), opens a timestamped runtime log under results/logs/, writes startup metadata, and snapshots the case config with SHA-256 sums. Re-configuring replaces only PyRPOD-owned handlers, so nothing is duplicated and embedding-app handlers are untouched. Also adds helpers: LoggingSession (finalize/close), get_active_session, get_settings, performance_logging_enabled, log_asset (provenance + streaming checksum, run-scoped cache), summarize_array/log_array_summary, sha256_file, git_dirty_status. Importing PyRPOD has no logging side effects. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the removed get_logger() import in favor of the standard module-logger idiom, so importing these modules configures no handlers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Log target/visiting-vehicle STL, TCF, TDF, and CCF loads at INFO with category, absolute path, case-local vs shared-data provenance, size, and SHA-256; report compact counts (mesh faces, thrusters, thruster types, clusters) and DEBUG geometric summaries. Missing optional [tcd] sections now warn instead of returning silently. Also migrate VisitingVehicle/LogisticsModule off get_logger(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
read_jfh() logs the resolved source with provenance + SHA-256 and an INFO summary (firings, time range, total thruster activations, unique thruster IDs, parse time). An empty required JFH is now logged at ERROR; parsing internals are DEBUG. Migrates off get_logger(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jfh_plume_strikes() now validates all required inputs up front (config keys, readable non-empty target mesh/JFH/thruster config, valid thruster references, and kinetics-conditional TDF/surface_temp/sigma/metrics), logging an ERROR and raising instead of returning silently. It logs run start, per-firing progress (respecting progress_every_n_firings; struck faces, kinetics maxima, worker PID, wall time, tracked memory), and a completion summary with overall maxima, wall/CPU time, tracemalloc peak, artifact count, execution mode, and final status. tqdm is removed; optional JFH-visualization write failures warn and continue. PlumeStrikeCalculator.run_parallel_plume_strikes gains an opt-in return_meta channel so workers return non-numerical observability data (PID, wall/CPU time) for the parent to log. Default return shape is unchanged; numerical results and accumulation order are untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add module logger; log trade-study init (case dir, sweep type, config count), per-configuration start/complete with case key, swept values, and runtime, plus a completion summary. Replace print() debugging with a DEBUG DataFrame summary (shape/columns) and use the logging ensure_dir helper for results directories. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reserve .log for runtime logs: rename the four rpod expected-strike fixtures from .log to .txt (contents identical) and update the readers. Remove logging.basicConfig(...) and dev logging.info() calls from rpod_integration_test_01-04; assertions and expected values are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add tests/logging/ with caplog/tmp_path/monkeypatch tests covering import side effects, handler ownership and no-duplication, console/file toggles, timestamped log naming under results/logs/, env>ini>defaults precedence, asset provenance+checksum logging, config-snapshot preservation, array-summary variants, fail-fast validation, progress cadence, serial/parallel event equivalence, DEBUG-vs-INFO artifact levels, parallel->serial fallback status, and the renamed .txt fixture. Register 'logging' as a test subsystem in conftest.py and pyproject.toml markers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add docs/logging.md (architecture, no-import-side-effects, logging.ini schema and precedence, console/file toggles, runtime-log naming, env-var and log-level guidance, input checksums, config snapshots, performance/memory caveats, serial-fallback behavior, minimal usage) and docs/logging.ini.example. Link the docs from README.md and refresh the stale get_logger example in pyrpod/README_new.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each runnable case/rpod case ships a run.py driver (mirroring its tests/rpod case minus assertions, wrapped in configure_logging/finalize/close) and a logging.ini that highlights a capability: base_case (defaults), 1d_approach (progress_every_n_firings=2), koz (level=DEBUG), hollow_cube (console=false, file only), multi_thrusters_square (kinetics maxima), stl_to_vtk (asset/dir logging around STL->VTK). Runtime logs land under each case's gitignored results/logs/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
No description provided.