Skip to content

Release: 0.5.0 - #9

Merged
lucifer1004 merged 2 commits into
mainfrom
release/0.5.0
Jun 5, 2026
Merged

Release: 0.5.0#9
lucifer1004 merged 2 commits into
mainfrom
release/0.5.0

Conversation

@lucifer1004

@lucifer1004 lucifer1004 commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added a new rain-radar notebook and an optional radiative‑transfer example including CLI tools for generating test inputs and computing dual‑polarimetric radar outputs, plus shared helpers for those examples.
  • Documentation

    • Expanded example docs and READMEs, updated docs build/index behavior, and updated the CHANGELOG and README compatibility note.
  • Chores

    • Bumped package version to v0.5.0 and updated compatibility constraints.
  • Style

    • Added .gitignore entries to exclude generated example artifacts.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4fa7d452-6404-4ecf-b742-c9b2ff73b271

📥 Commits

Reviewing files that changed from the base of the PR and between 39c2139 and 95d408e.

📒 Files selected for processing (14)
  • .gitignore
  • CHANGELOG.md
  • Project.toml
  • README.md
  • docs/src/examples/rain_radar.md
  • docs/src/index.md
  • examples/README.md
  • examples/radiative_transfer/Project.toml
  • examples/radiative_transfer/README.md
  • examples/radiative_transfer/generate_fake_wrf.jl
  • examples/radiative_transfer/shared.jl
  • examples/radiative_transfer/wrf_dualpol_radar.jl
  • examples/rain_radar.jl
  • packages/EBCMPrecisionLossEstimators/Project.toml
✅ Files skipped from review due to trivial changes (7)
  • README.md
  • docs/src/index.md
  • examples/radiative_transfer/README.md
  • examples/radiative_transfer/Project.toml
  • examples/README.md
  • packages/EBCMPrecisionLossEstimators/Project.toml
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • .gitignore
  • Project.toml
  • examples/radiative_transfer/generate_fake_wrf.jl
  • examples/radiative_transfer/shared.jl
  • examples/rain_radar.jl
  • examples/radiative_transfer/wrf_dualpol_radar.jl

📝 Walkthrough

Walkthrough

Releases v0.5.0: version/compatibility bumps and changelog updates; docs build now extracts Pluto notebook titles; adds a rain-radar Pluto notebook with observables/LUTs and plots; and adds an optional radiative-transfer example (manifest, README, shared helpers, fake-WRF generator, and a WRF→dual-pol radar CLI).

Changes

TransitionMatrices v0.5.0 Release with Examples

Layer / File(s) Summary
Version bump and release notes
Project.toml, CHANGELOG.md, README.md, docs/src/index.md, .gitignore, packages/EBCMPrecisionLossEstimators/Project.toml
Package version advanced to 0.5.0 across manifests; changelog updated with 0.5.0 entry and compare links; README/docs compatibility lines updated to 0.5; .gitignore excludes radiative-transfer generated .nc, .mat, and .jls.
Documentation build system for dynamic notebook titles
docs/make.jl
Docs build now extracts each Pluto notebook's display title from embedded markdown via notebook_title(nb), constructs NB_PAGE_PATHS/NB_PAGES, and updates makedocs size_threshold_ignore.
Rain radar observables Pluto notebook
examples/rain_radar.jl, examples/README.md
Adds examples/rain_radar.jl implementing water/ice dielectric models, per-diameter scattering-table generation, bulk dual-pol moment integration, brightness-temperature LUT generation, and plotting; updates examples README ordering and descriptions.
Radiative transfer WRF-to-radar pipeline
examples/radiative_transfer/Project.toml, examples/radiative_transfer/README.md, examples/radiative_transfer/shared.jl, examples/radiative_transfer/generate_fake_wrf.jl, examples/radiative_transfer/wrf_dualpol_radar.jl
Adds an optional radiative-transfer example: manifest and README, shared constants/helpers (RadiativeTransferShared), a deterministic fake WRF NetCDF generator, and wrf_dualpol_radar.jl which reads WRF-like NetCDF, builds/loads scattering-table caches, computes threaded per-cell radar moments (single/double-DSD modes), and writes annotated NetCDF outputs.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Notebook as rain_radar.jl
  participant Scattering as Scattering Table
  participant DSD as Drop Size Distribution
  participant Moments as Dual-Pol Moments
  User->>Notebook: Define water/ice dielectrics
  Notebook->>Scattering: Compute per-diameter spheroid table
  User->>Notebook: Request radar observables at rain rate
  Notebook->>DSD: Marshall-Palmer drop distribution
  DSD->>Moments: Weight amplitudes by DSD
  Moments->>Notebook: Return ZH, ZDR, ρhv, KDP
  User->>Notebook: Build multi-frequency TB LUT
  Notebook->>Scattering: Generate table per frequency
  Scattering->>Moments: Integrate TB per rain rate
  Moments->>Notebook: Return LUT rows
  Notebook->>User: Render observable plots
Loading
sequenceDiagram
  participant CLI
  participant Generator as generate_fake_wrf.jl
  participant Processor as wrf_dualpol_radar.jl
  participant WRFFile as WRF NetCDF
  participant ScatterCache as Scattering Cache
  participant GridLoop as Threaded Grid
  participant Output as Output NetCDF
  CLI->>Generator: --nx --ny --nz --nt
  Generator->>Generator: Synthetic fields (lat, lon, time, rain, vapor)
  Generator->>WRFFile: Write NetCDF variables
  CLI->>Processor: --input --dsd --freq --cache
  Processor->>ScatterCache: Load or compute scattering table
  Processor->>WRFFile: Read WRF fields
  Processor->>GridLoop: Iterate cells in parallel
  GridLoop->>GridLoop: Compute density, DSD, radar moments
  GridLoop->>Output: Write ZH, ZV, ZDR, RHOHV, KDP
  Processor->>CLI: Print summary (valid cells, output path)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A new release hops into view,
With rain-radar workflows fresh and true,
Fake WRF fields and scattering tables made,
Docs learn titles and examples parade.
Version 0.5.0 — notebooks on queue!

🚥 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 'Release: 0.5.0' is concise and clearly summarizes the main objective of the PR, which is to release version 0.5.0, supported by version bumps and changelog updates throughout the changeset.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/0.5.0

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

@codecov-commenter

codecov-commenter commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.63%. Comparing base (1eed885) to head (95d408e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #9   +/-   ##
=======================================
  Coverage   95.63%   95.63%           
=======================================
  Files          32       32           
  Lines        4403     4403           
=======================================
  Hits         4211     4211           
  Misses        192      192           
Flag Coverage Δ
julia-1-macos-latest 96.92% <ø> (ø)
julia-1-ubuntu-latest 96.92% <ø> (ø)
julia-1-windows-latest 96.92% <ø> (ø)
julia-1.10-ubuntu-latest 95.56% <ø> (ø)
julia-nightly-ubuntu-latest 96.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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: 2

🧹 Nitpick comments (2)
examples/rain_radar.jl (1)

42-65: ⚡ Quick win

Prefer the c0_m_per_s() helper for consistency.

Line 62 hardcodes 2.99792458e8 while line 80 (in ice_refractive_index) correctly calls c0_m_per_s(). Using the helper improves maintainability.

♻️ Proposed fix
         εimag = (εs - ε∞) * x * cospi(α / 2) / denominator +
-                σ * λ_m / (2π * 2.99792458e8 * ε0)
+                σ * λ_m / (2π * c0_m_per_s() * ε0)
🤖 Prompt for 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.

In `@examples/rain_radar.jl` around lines 42 - 65, In water_refractive_index
replace the hardcoded speed-of-light literal (2.99792458e8) used in the εimag
term with the existing c0_m_per_s() helper for consistency with
ice_refractive_index; specifically update the σ * λ_m / (2π * 2.99792458e8 * ε0)
expression inside water_refractive_index to use c0_m_per_s() so the computation
reads σ * λ_m / (2π * c0_m_per_s() * ε0), keeping all other math unchanged.
examples/radiative_transfer/generate_fake_wrf.jl (1)

5-8: ⚖️ Poor tradeoff

Consider extracting shared constants and functions.

The constants R_DRY_AIR, WATER_DENSITY, MASS_COEFF, and RAIN_N0 (lines 5-8), the air_density function (lines 56-60), and the write_var helper (lines 116-121) are duplicated in wrf_dualpol_radar.jl. If these values or implementations diverge, the generator and radar pipeline could become inconsistent.

Consider extracting shared constants and utilities into a common physics.jl or shared.jl file that both scripts can include.

Also applies to: 56-60, 116-121

🤖 Prompt for 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.

In `@examples/radiative_transfer/generate_fake_wrf.jl` around lines 5 - 8, The
constants R_DRY_AIR, RAIN_N0, WATER_DENSITY, MASS_COEFF and the helper functions
air_density and write_var are duplicated between generate_fake_wrf.jl and
wrf_dualpol_radar.jl; extract them into a new shared module (e.g., physics or
shared) to avoid drift, move the constant definitions and the implementations of
air_density and write_var into that module, export those symbols, and update
both scripts to import the module and reference R_DRY_AIR, RAIN_N0,
WATER_DENSITY, MASS_COEFF, air_density, and write_var instead of redefining
them.
🤖 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 `@examples/radiative_transfer/wrf_dualpol_radar.jl`:
- Around line 134-150: The cache validation in load_or_compute_scattering_table
only compares Ds and freq_hz; include the IITM solver parameters (e.g., nmax,
nr, ntheta supplied via the solver argument) in both the payload and the
equality check so cached tables are invalidated when solver options change: when
loading, compare payload.Ds, payload.freq_hz and payload.solver_params (or
explicit payload.nmax/payload.nr/payload.ntheta) against the current Ds, freq_hz
and solver settings; when writing, serialize the table together with those
solver parameter values so future loads can detect mismatches; update references
to scattering_table and serialize/deserialize payload shape accordingly.

In `@examples/rain_radar.jl`:
- Line 137: The line assigning Cext_mm2 contains a stray closing parenthesis;
update the call to calc_Cext so it uses the correct syntax and parameters
(calc_Cext(T, λ)) by removing the extra ')' — ensure you call the exported
function calc_Cext (alias of extinction_cross_section in TransitionMatrices)
with the variables T and λ and assign the result to Cext_mm2.

---

Nitpick comments:
In `@examples/radiative_transfer/generate_fake_wrf.jl`:
- Around line 5-8: The constants R_DRY_AIR, RAIN_N0, WATER_DENSITY, MASS_COEFF
and the helper functions air_density and write_var are duplicated between
generate_fake_wrf.jl and wrf_dualpol_radar.jl; extract them into a new shared
module (e.g., physics or shared) to avoid drift, move the constant definitions
and the implementations of air_density and write_var into that module, export
those symbols, and update both scripts to import the module and reference
R_DRY_AIR, RAIN_N0, WATER_DENSITY, MASS_COEFF, air_density, and write_var
instead of redefining them.

In `@examples/rain_radar.jl`:
- Around line 42-65: In water_refractive_index replace the hardcoded
speed-of-light literal (2.99792458e8) used in the εimag term with the existing
c0_m_per_s() helper for consistency with ice_refractive_index; specifically
update the σ * λ_m / (2π * 2.99792458e8 * ε0) expression inside
water_refractive_index to use c0_m_per_s() so the computation reads σ * λ_m /
(2π * c0_m_per_s() * ε0), keeping all other math unchanged.
🪄 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: 4d98a2ec-d784-43de-988b-6e4a991137c2

📥 Commits

Reviewing files that changed from the base of the PR and between 1eed885 and be0241f.

📒 Files selected for processing (14)
  • .gitignore
  • CHANGELOG.md
  • Project.toml
  • README.md
  • docs/make.jl
  • docs/src/examples/rain_radar.md
  • docs/src/index.md
  • examples/README.md
  • examples/radiative_transfer/Project.toml
  • examples/radiative_transfer/README.md
  • examples/radiative_transfer/generate_fake_wrf.jl
  • examples/radiative_transfer/wrf_dualpol_radar.jl
  • examples/rain_radar.jl
  • packages/EBCMPrecisionLossEstimators/Project.toml

Comment thread examples/radiative_transfer/wrf_dualpol_radar.jl
Comment thread examples/rain_radar.jl

@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: 4

🤖 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 `@examples/radiative_transfer/generate_fake_wrf.jl`:
- Around line 48-53: In parse_args, after parsing nx, ny, nz, and nt (the
variables in the tuple returned by parse_args), add validation to ensure each is
> 0 and if any value is <= 0 raise a clear CLI error (e.g., throw or call
error/exit with a descriptive message mentioning which dimension is invalid and
its value); update parse_args to perform this check before returning so invalid
grid sizes are rejected early (reference the parse_args function and the
nx/ny/nz/nt variables).

In `@examples/radiative_transfer/wrf_dualpol_radar.jl`:
- Around line 63-68: The CLI currently allows --output to equal --input which
leads to destructive deletion of the source when the code later removes the
output path; update the argument handling around opts["input"]/opts["output"]
(variables input and output in the shown block) to detect input == output and
either error out with a clear message or handle safely by writing to a temporary
file/path and atomically replacing the input after successful write; ensure any
deletion logic that currently unconditionally removes output (the code around
the remove/delete call) is only executed after confirming output != input or
after a successful temp-to-target rename.
- Around line 267-272: The code currently writes Float32(NaN) when
radar_moments(...) returns invalid values; instead detect invalid moments (e.g.,
use isnan or !isfinite on moments.ZH / moments.ZV / moments.ZDR / moments.RHOHV
/ moments.KDP or a single validity check after calling radar_moments) and assign
the FILL sentinel (e.g., FILL) to ZH[idx], ZV[idx], ZDR[idx], RHOHV[idx],
KDP[idx] when invalid; otherwise continue converting valid values with
Float32(moments.<field>); update the block that calls radar_moments and sets
ZH/ZV/ZDR/RHOHV/KDP accordingly to implement this conditional assignment.
- Around line 256-257: The loop is materializing all CartesianIndex objects by
using collect(CartesianIndices(fields.qrain)), causing a large allocation;
change the loop to iterate directly over CartesianIndices(fields.qrain) (i.e.
Threads.@threads for idx in CartesianIndices(fields.qrain)) so idx remains a
CartesianIndex and you avoid allocating an intermediate array when indexing
fields.qrain.
🪄 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: e320d4dc-97c8-40b1-a461-dc22938621d4

📥 Commits

Reviewing files that changed from the base of the PR and between be0241f and 0ac611e.

📒 Files selected for processing (14)
  • .gitignore
  • CHANGELOG.md
  • Project.toml
  • README.md
  • docs/src/examples/rain_radar.md
  • docs/src/index.md
  • examples/README.md
  • examples/radiative_transfer/Project.toml
  • examples/radiative_transfer/README.md
  • examples/radiative_transfer/generate_fake_wrf.jl
  • examples/radiative_transfer/shared.jl
  • examples/radiative_transfer/wrf_dualpol_radar.jl
  • examples/rain_radar.jl
  • packages/EBCMPrecisionLossEstimators/Project.toml
✅ Files skipped from review due to trivial changes (7)
  • docs/src/index.md
  • examples/radiative_transfer/README.md
  • examples/radiative_transfer/Project.toml
  • README.md
  • .gitignore
  • examples/README.md
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/EBCMPrecisionLossEstimators/Project.toml
  • Project.toml
  • examples/rain_radar.jl

Comment thread examples/radiative_transfer/generate_fake_wrf.jl Outdated
Comment thread examples/radiative_transfer/wrf_dualpol_radar.jl Outdated
Comment thread examples/radiative_transfer/wrf_dualpol_radar.jl Outdated
Comment thread examples/radiative_transfer/wrf_dualpol_radar.jl Outdated

@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: 2

🤖 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 `@examples/radiative_transfer/wrf_dualpol_radar.jl`:
- Around line 80-88: parse_range currently returns an empty Float64 vector for
descending or degenerate specs which lets invalid CLI input silently pass;
update parse_range to validate the produced bins and fail fast: after building
the candidate range in parse_range (both the two-part and three-part branches)
check for invalid step (e.g., zero) and then collect the range into a vector and
if isempty(vector) raise an error like "range must produce at least one bin";
ensure you reference the parse_range function and its two branches
(length(parts)==2 and length(parts)==3) so the fix covers both forms.
- Around line 155-168: The cache logic in load_or_compute_scattering_table
should handle corrupt/unreadable files and missing table entries: wrap
deserialize(cache) in a try/catch and on any error or if
scattering_cache_matches(payload, Ds, freq_hz, solver_params) returns true but
payload does not contain a valid :table, log a warning and continue to compute
table = scattering_table(Ds, freq_hz; solver) (and still call serialize when
cache is provided). Also add validation in parse_range to ensure Ds is non-empty
(and that descending/degenerate inputs produce an explicit error or early exit
with a clear message) so the CLI does not proceed writing sentinel-only outputs;
surface that error to the caller so higher-level code aborts instead of
producing FILL-only results.
🪄 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: 543db409-2148-477d-b895-79b60992f65e

📥 Commits

Reviewing files that changed from the base of the PR and between 0ac611e and 39c2139.

📒 Files selected for processing (14)
  • .gitignore
  • CHANGELOG.md
  • Project.toml
  • README.md
  • docs/src/examples/rain_radar.md
  • docs/src/index.md
  • examples/README.md
  • examples/radiative_transfer/Project.toml
  • examples/radiative_transfer/README.md
  • examples/radiative_transfer/generate_fake_wrf.jl
  • examples/radiative_transfer/shared.jl
  • examples/radiative_transfer/wrf_dualpol_radar.jl
  • examples/rain_radar.jl
  • packages/EBCMPrecisionLossEstimators/Project.toml
✅ Files skipped from review due to trivial changes (8)
  • README.md
  • docs/src/index.md
  • packages/EBCMPrecisionLossEstimators/Project.toml
  • Project.toml
  • .gitignore
  • examples/radiative_transfer/README.md
  • CHANGELOG.md
  • examples/README.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • examples/radiative_transfer/Project.toml
  • examples/radiative_transfer/shared.jl
  • examples/radiative_transfer/generate_fake_wrf.jl
  • examples/rain_radar.jl

Comment thread examples/radiative_transfer/wrf_dualpol_radar.jl
Comment thread examples/radiative_transfer/wrf_dualpol_radar.jl
Add an optional WRF-like dual-pol radar workflow with synthetic NetCDF data generation, and bump the package plus dependent compat bounds to 0.5.
@lucifer1004
lucifer1004 merged commit ce84242 into main Jun 5, 2026
12 checks passed
@lucifer1004
lucifer1004 deleted the release/0.5.0 branch June 5, 2026 13:21
@coderabbitai coderabbitai Bot mentioned this pull request Jun 6, 2026
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.

2 participants