Skip to content

Accept explicit distance grids in make_spectral_grid - #869

Open
christinawlindberg wants to merge 2 commits into
BEAST-Fitting:masterfrom
christinawlindberg:explicit-distance-grid
Open

Accept explicit distance grids in make_spectral_grid#869
christinawlindberg wants to merge 2 commits into
BEAST-Fitting:masterfrom
christinawlindberg:explicit-distance-grid

Conversation

@christinawlindberg

Copy link
Copy Markdown
Contributor

Closes #868

What this does

Allows distance to be given as an explicit list of more than three values,
which is then used directly (sorted) as the distance grid. This enables
non-uniform, variable-resolution distance sampling — for example a grid whose
density follows the expected line-of-sight distribution of a galaxy.

Backward compatibility

Unchanged for every currently valid input:

input behaviour
60000 (scalar) single distance, as before
[min, max, step] (3 values) uniform np.arange grid, as before
>3 values new — used as the explicit grid, sorted
2 values ValueError, as before (message expanded)

A three-element list is still always read as [min, max, step], so an explicit
grid of exactly three distances cannot be expressed. That ambiguity is inherent
in the existing API; it is called out in the docstring and the docs rather than
resolved, to avoid changing what existing settings files mean.

Also included

  • make_spectral_grid docstring updated for the new form
  • docs/beast_setup.rst entry for distances updated to match

Context

Came out of building a shared physics-model grid for two SMC fields, where a
Gaussian-density distance grid gave the same effective resolution in 47 planes
instead of 66.

christinawlindberg and others added 2 commits August 27, 2026 13:19
Enables variable-resolution distance sampling (e.g. Gaussian-density
grids concentrated at the target distance). 3-element lists remain
min/max/step for backward compatibility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Update the make_spectral_grid docstring and the beast_setup docs to
describe the explicit >3-value distance list, and note that a
three-element list is always read as [min, max, step].
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.59%. Comparing base (b847aae) to head (26d179c).

Files with missing lines Patch % Lines
beast/physicsmodel/model_grid.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #869      +/-   ##
==========================================
- Coverage   38.60%   38.59%   -0.01%     
==========================================
  Files         110      110              
  Lines       10615    10617       +2     
==========================================
  Hits         4098     4098              
- Misses       6517     6519       +2     

☔ 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.

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.

make_spectral_grid cannot take an explicit (non-uniform) distance grid

1 participant