Add python -m RMS launcher and a headless station status command#925
Open
dvida wants to merge 3 commits into
Open
Add python -m RMS launcher and a headless station status command#925dvida wants to merge 3 commits into
dvida wants to merge 3 commits into
Conversation
Add RMS/CLITools.py with addConfigArgument() and loadConfig() helpers that standardize the -c/--config argument without the legacy nargs=1 pattern, and normalize str/list inputs before calling loadConfigFromDirectory. Convert the five scripts that still parsed sys.argv by hand to argparse so they all support -h/--help: PointsViewer, Grouping3DRunner, setAllCameraParams, SetCameraAddress, and SaturationSimulation (which previously had no CLI at all - its hardcoded demo parameters are now arguments with the old values as defaults). Also fixes a NameError crash in PointsViewer (plt.title referenced an undefined variable) and removes its hardcoded .config path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New RMS/__main__.py: running "python -m RMS" lists the most commonly
used tools grouped by topic, and "python -m RMS <command> [args...]"
dispatches to the corresponding module via runpy. Every command remains
runnable directly as a module, so existing invocations are unaffected.
New Utils/StationStatus.py ("python -m RMS status"): a station health
report that works over SSH with no display. Shows how the last night
went (FF files captured vs expected, lost capture time, first/last
detection, days since last detection, tracebacks in the log, time sync,
repository lag, camera pointing) from the observation summary database,
plus the current state (disk space, camera reachability, next capture
start). A --json flag outputs the report for use in scripts, and the
command degrades gracefully on fresh installs with no data yet.
Adds a getLatestObservationRecord() read helper to ObservationSummary
and documents the launcher in the README.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bc6e0d60e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Route the config-loading banner prints to stderr when --json is used, so stdout contains only the JSON document. Pass a naive UTC time (RmsDateTime.utcnow) to getObservationDuration - the capture duration code subtracts ephem's naive datetimes, so a timezone-aware value raised TypeError during an active night and the report showed "Next capture: n/a". Co-Authored-By: Claude Fable 5 <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.
Summary
Stacked on #922 (includes its commit; this PR's own diff is the second commit). Merge #922 first and this diff will shrink to just the launcher/status changes.
RMS/__main__.py: runningpython -m RMSlists ~27 of the most commonly used tools grouped by topic (station operation, calibration, camera setup, viewing & media, configuration, analysis), andpython -m RMS <command> [args...]dispatches to the corresponding module viarunpy. Purely additive — every tool remains runnable directly as a module, and existingpython -m Utils.X/python -m RMS.Xinvocations are unaffected.Utils/StationStatus.py(python -m RMS status): headless station health report that works over SSH with no display:--jsonfor scripting; degrades gracefully to "No observation data yet" on fresh installs without creating the database as a side effectgetLatestObservationRecord()read helper toRMS/Formats/ObservationSummary.pypython -m RMSTesting
python -m RMSprints the grouped tool list;python -m RMS <cmd> -hdispatches correctly (verified withcapture-duration,skyfit); unknown commands exit with a hintpython -m RMS statusand--jsonverified against a synthetic 2-night observation database (picks the latest night, formats all fields) and against an empty data directorypython -m RMS.StartCapture --helpand other direct module invocations unchanged🤖 Generated with Claude Code