Skip to content

added --header and --labels flags to print headers and labels from datafiles - #131

Merged
danieljprice merged 4 commits into
mainfrom
trajectory-files
Jul 26, 2026
Merged

added --header and --labels flags to print headers and labels from datafiles#131
danieljprice merged 4 commits into
mainfrom
trajectory-files

Conversation

@danieljprice

@danieljprice danieljprice commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Header flag gives:

% splash --header dump_00500    
 gamma =    1.66667    
 RK2 =    1.50000    
 polyk2 =    0.00000    
 qfacdisc =   0.750000    
 qfacdisc2 =   0.750000    
 time =   1.600500E+06
 dtmax =    3201.00    
...

Labels flag gives:

% splash --labels dump_00500    
x [cm]
y [cm]
z [cm]
particle mass [g]
h [cm]
density [g/cm^3]
...

Labelsorig flag gives:

% splash --labelsorig dump_00500
x
y
z
particle mass
h
density
...

pull request also fixes warnings with gfortran v116

Summary by CodeRabbit

  • New Features

    • Added command-line options to print dump headers, column labels, or original labels, then exit.
    • Added clearer output for header tags and column metadata.
    • Kernel selection can now be run quietly when requested.
  • Bug Fixes

    • Improved temperature and opacity calculations when required density data is available.
    • Prevented invalid array access during data reallocation.
    • Smoothing lengths can now be recomputed using command-line flags.
  • Improvements

    • Added consistent verbosity controls across data loading, limits, defaults, and status messages.
    • Improved parallel processing compatibility for interpolation operations.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@danieljprice, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cd96acaa-af3c-4e08-bbe1-2157a2a4b4d8

📥 Commits

Reviewing files that changed from the base of the PR and between c04296a and 72d5321.

📒 Files selected for processing (3)
  • src/allocate.f90
  • src/asciiutils.f90
  • src/splash.f90
📝 Walkthrough

Walkthrough

The change adds --header, --labels, and --labelsorig output modes, propagates quiet-mode verbosity through runtime reporting, corrects sphNG derived-column preparation, guards optional reallocations, switches smoothing-length flags to command flags, and updates OpenMP thread-count regions.

Changes

CLI and runtime updates

Layer / File(s) Summary
Metadata-only CLI output
src/splash.f90, src/labels.f90
Adds header and label printing helpers, command-line options, quiet initialization, metadata output, and early termination.
Verbosity-controlled runtime reporting
src/defaults.f90, src/get_data.f90, src/kernels.f90, src/limits.f90, src/menu.f90, src/set_options_from_dataread.f90, src/splash.f90, src/units.f90
Gates status and diagnostic output with verbosity and passes verbosity into kernel and limits selection routines.
Data prerequisites and derived quantities
src/read_data_sphNG.f90, src/get_data.f90, src/adjust_data.f90, src/allocate.f90
Ensures required sphNG columns exist before derived calculations, preserves original labels, uses command flags for smoothing lengths, and conditionally copies allocated temporary arrays.
OpenMP thread-count guards
src/interpolate3D*.f90
Replaces master regions with masked regions around thread-count output and assignment.
Estimated code review effort: 4 (Complex) ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant splash
  participant defaults_set
  participant get_data
  participant labels
  splash->>defaults_set: initialize defaults with suppressed verbosity
  splash->>get_data: read dump data and labels
  get_data->>labels: establish column metadata
  splash->>labels: print requested headers or labels
  labels-->>splash: emit metadata
  splash->>splash: exit
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding header and label-printing flags for datafiles.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch trajectory-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/read_data_sphNG.f90`:
- Around line 1519-1525: Move the density/thermal-energy dependency handling out
of the pre-schema block and resolve it only after `irho`, `iutherm`, and
`irhorestframe` are finalized by the schema and label discovery flow, before
records are selectively skipped. When allocating `itempcol`, `ikappa`, and
ionisation output columns, mark each generated column as required so
partial-read processing computes requested derived outputs.

In `@src/splash.f90`:
- Around line 914-929: Update the quiet-setting logic around defaults loading
and the corresponding block near the later metadata-mode handling so `iverbose`
remains `-1` for `do_print_header`, `do_print_labels`, or `do_print_labelsorig`
even when `debugmode` is enabled. Ensure the re-applied quiet value takes
precedence over `get_data`’s debug verbosity while preserving normal debug
verbosity outside these metadata modes.
- Around line 1101-1110: Update the metadata-only handling around the header and
label checks in the main read/option flow so it exits before post-read option
processing such as set_options_dataread, print_example_quantities, or
calc_quantities. Preserve the existing print_headers, print_column_labels, and
print_column_labels_orig behavior, while ensuring --header and related metadata
modes produce no other output or calculation work.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c7d1715-2046-4a50-a40b-682a6f646c23

📥 Commits

Reviewing files that changed from the base of the PR and between 4efd030 and c04296a.

📒 Files selected for processing (16)
  • src/adjust_data.f90
  • src/allocate.f90
  • src/defaults.f90
  • src/get_data.f90
  • src/interpolate3D.f90
  • src/interpolate3D_geom.f90
  • src/interpolate3D_proj_geom.f90
  • src/interpolate3D_projection.f90
  • src/kernels.f90
  • src/labels.f90
  • src/limits.f90
  • src/menu.f90
  • src/read_data_sphNG.f90
  • src/set_options_from_dataread.f90
  • src/splash.f90
  • src/units.f90

Comment thread src/read_data_sphNG.f90
Comment thread src/splash.f90
Comment thread src/splash.f90
@danieljprice
danieljprice merged commit 4687f3c into main Jul 26, 2026
6 checks passed
@danieljprice
danieljprice deleted the trajectory-files branch July 26, 2026 15:33
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