sed-model 0.3.1__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. {sed_model-0.3.1 → sed_model-0.3.2}/CHANGELOG.md +10 -0
  2. {sed_model-0.3.1 → sed_model-0.3.2}/CITATION.cff +1 -1
  3. {sed_model-0.3.1 → sed_model-0.3.2}/PKG-INFO +2 -2
  4. {sed_model-0.3.1 → sed_model-0.3.2}/README.md +1 -1
  5. {sed_model-0.3.1 → sed_model-0.3.2}/docs/index.md +1 -1
  6. {sed_model-0.3.1 → sed_model-0.3.2}/docs/testing.md +5 -5
  7. {sed_model-0.3.1 → sed_model-0.3.2}/meson.build +1 -1
  8. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/filters.py +4 -1
  9. sed_model-0.3.2/tests/_data_paths.py +29 -0
  10. {sed_model-0.3.1 → sed_model-0.3.2}/tests/test_forward.py +1 -12
  11. {sed_model-0.3.1 → sed_model-0.3.2}/tests/test_inverse.py +1 -12
  12. {sed_model-0.3.1 → sed_model-0.3.2}/tests/test_kernels.py +23 -0
  13. {sed_model-0.3.1 → sed_model-0.3.2}/.f2py_f2cmap +0 -0
  14. {sed_model-0.3.1 → sed_model-0.3.2}/.gitattributes +0 -0
  15. {sed_model-0.3.1 → sed_model-0.3.2}/.github/workflows/build.yml +0 -0
  16. {sed_model-0.3.1 → sed_model-0.3.2}/.github/workflows/docs.yml +0 -0
  17. {sed_model-0.3.1 → sed_model-0.3.2}/.gitignore +0 -0
  18. {sed_model-0.3.1 → sed_model-0.3.2}/CODE_OF_CONDUCT.md +0 -0
  19. {sed_model-0.3.1 → sed_model-0.3.2}/CONTRIBUTING.md +0 -0
  20. {sed_model-0.3.1 → sed_model-0.3.2}/LICENSE +0 -0
  21. {sed_model-0.3.1 → sed_model-0.3.2}/MIGRATION.md +0 -0
  22. {sed_model-0.3.1 → sed_model-0.3.2}/Makefile +0 -0
  23. {sed_model-0.3.1 → sed_model-0.3.2}/SECURITY.md +0 -0
  24. {sed_model-0.3.1 → sed_model-0.3.2}/demos/api_usage.py +0 -0
  25. {sed_model-0.3.1 → sed_model-0.3.2}/demos/demo_forward.py +0 -0
  26. {sed_model-0.3.1 → sed_model-0.3.2}/demos/demo_inverse.py +0 -0
  27. {sed_model-0.3.1 → sed_model-0.3.2}/demos/demo_param_modes.py +0 -0
  28. {sed_model-0.3.1 → sed_model-0.3.2}/demos/extinction_prescription_comparison.py +0 -0
  29. {sed_model-0.3.1 → sed_model-0.3.2}/demos/plot_utils.py +0 -0
  30. {sed_model-0.3.1 → sed_model-0.3.2}/demos/sed_playground_demo.py +0 -0
  31. {sed_model-0.3.1 → sed_model-0.3.2}/demos/simbad_query_inverse.py +0 -0
  32. {sed_model-0.3.1 → sed_model-0.3.2}/demos/single_test.py +0 -0
  33. {sed_model-0.3.1 → sed_model-0.3.2}/docs/SED_Model_logo.jpeg +0 -0
  34. {sed_model-0.3.1 → sed_model-0.3.2}/docs/api.md +0 -0
  35. {sed_model-0.3.1 → sed_model-0.3.2}/docs/demos/api-usage.md +0 -0
  36. {sed_model-0.3.1 → sed_model-0.3.2}/docs/demos/extinction-comparison.md +0 -0
  37. {sed_model-0.3.1 → sed_model-0.3.2}/docs/demos/forward.md +0 -0
  38. {sed_model-0.3.1 → sed_model-0.3.2}/docs/demos/index.md +0 -0
  39. {sed_model-0.3.1 → sed_model-0.3.2}/docs/demos/inverse.md +0 -0
  40. {sed_model-0.3.1 → sed_model-0.3.2}/docs/demos/param-modes.md +0 -0
  41. {sed_model-0.3.1 → sed_model-0.3.2}/docs/demos/playground.md +0 -0
  42. {sed_model-0.3.1 → sed_model-0.3.2}/docs/favicon.png +0 -0
  43. {sed_model-0.3.1 → sed_model-0.3.2}/docs/guide/extinction.md +0 -0
  44. {sed_model-0.3.1 → sed_model-0.3.2}/docs/guide/forward.md +0 -0
  45. {sed_model-0.3.1 → sed_model-0.3.2}/docs/guide/grids-and-filters.md +0 -0
  46. {sed_model-0.3.1 → sed_model-0.3.2}/docs/guide/inverse.md +0 -0
  47. {sed_model-0.3.1 → sed_model-0.3.2}/docs/guide/parameters.md +0 -0
  48. {sed_model-0.3.1 → sed_model-0.3.2}/docs/guide/results-io.md +0 -0
  49. {sed_model-0.3.1 → sed_model-0.3.2}/docs/installation.md +0 -0
  50. {sed_model-0.3.1 → sed_model-0.3.2}/docs/quickstart.md +0 -0
  51. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/cc_api.f90 +0 -0
  52. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/private/bolometric.f90 +0 -0
  53. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/private/colors_utils.f90 +0 -0
  54. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/private/hermite_interp.f90 +0 -0
  55. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/private/hermite_interp_bounded.f90 +0 -0
  56. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/private/linear_interp.f90 +0 -0
  57. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/private/synthetic.f90 +0 -0
  58. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/public/colors_def.f90 +0 -0
  59. {sed_model-0.3.1 → sed_model-0.3.2}/fortran/public/colors_lib.f90 +0 -0
  60. {sed_model-0.3.1 → sed_model-0.3.2}/meson_options.txt +0 -0
  61. {sed_model-0.3.1 → sed_model-0.3.2}/mkdocs.yml +0 -0
  62. {sed_model-0.3.1 → sed_model-0.3.2}/pyproject.toml +0 -0
  63. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/__init__.py +0 -0
  64. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/_cc_ext.py +0 -0
  65. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/forward.py +0 -0
  66. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/grid.py +0 -0
  67. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/inverse.py +0 -0
  68. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/io.py +0 -0
  69. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/params.py +0 -0
  70. {sed_model-0.3.1 → sed_model-0.3.2}/sed_model/sed_extinction.py +0 -0
  71. {sed_model-0.3.1 → sed_model-0.3.2}/tests/fortran/smoke.f90 +0 -0
  72. {sed_model-0.3.1 → sed_model-0.3.2}/tools/ci/build_fortran_lib.sh +0 -0
  73. {sed_model-0.3.1 → sed_model-0.3.2}/tools/post_install_fortran.py +0 -0
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.2] — 2026-10-25
4
+
5
+ - **Filter files from SED_Tools 0.4.0 load again.** SED_Tools 0.4.0 puts its
6
+ metadata on the column row (`Wavelength,Transmission,FilterID=...;DetectorType=...`);
7
+ the loader now reads only the first two columns instead of failing with
8
+ `expected two-column file`. Required for SED_Tools >= 0.4.0 filter files.
9
+ The metadata itself is not read yet.
10
+ - Tests find their data in `~/.sed_tools/data` as well as the older locations
11
+ and `$MESA_DIR/data/colors_data`.
12
+
3
13
  ## [0.3.1] — 2026-10-23
4
14
 
5
15
  Packaging and CI only; no numerical changes.
@@ -7,7 +7,7 @@ authors:
7
7
  - family-names: "Miller"
8
8
  given-names: "Niall"
9
9
  email: "niall.j.miller@gmail.com"
10
- version: "0.3.1"
10
+ version: "0.3.2"
11
11
  repository-code: "https://github.com/nialljmiller/SED_Model"
12
12
  url: "https://nialljmiller.github.io/SED_Model/"
13
13
  license: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sed-model
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Forward and inverse stellar photometry from SED grids.
5
5
  Keywords: astronomy,astrophysics,stellar astronomy,synthetic photometry,spectral energy distributions,sed,stellar parameters,bayesian inference,mcmc
6
6
  Author-Email: Niall Miller <niall.j.miller@gmail.com>
@@ -36,7 +36,7 @@ Description-Content-Type: text/markdown
36
36
 
37
37
  SED_Model is a Python package for computing observer-ready synthetic spectral energy distributions (SEDs) and broadband magnitudes from stellar atmosphere grids, and for recovering stellar parameters from observed photometry via Bayesian MCMC inference. It is designed to work directly downstream of `SED_Tools` and as a standalone drop-in for workflows that use MESA-style atmosphere grids and filter transmission curves.
38
38
 
39
- Version: `0.3.1`
39
+ Version: `0.3.2`
40
40
 
41
41
  **Documentation:** https://nialljmiller.github.io/SED_Model/
42
42
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  SED_Model is a Python package for computing observer-ready synthetic spectral energy distributions (SEDs) and broadband magnitudes from stellar atmosphere grids, and for recovering stellar parameters from observed photometry via Bayesian MCMC inference. It is designed to work directly downstream of `SED_Tools` and as a standalone drop-in for workflows that use MESA-style atmosphere grids and filter transmission curves.
10
10
 
11
- Version: `0.3.1`
11
+ Version: `0.3.2`
12
12
 
13
13
  **Documentation:** https://nialljmiller.github.io/SED_Model/
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  SED_Model is a Python package for computing observer-ready synthetic spectral energy distributions (SEDs) and broadband magnitudes from stellar atmosphere grids, and for recovering stellar parameters from observed photometry via Bayesian MCMC inference. It works directly downstream of [SED_Tools](https://github.com/nialljmiller/SED_Tools) and as a standalone drop-in for workflows that use MESA-style atmosphere grids and filter transmission curves.
10
10
 
11
- Current version: **0.3.1** ([PyPI](https://pypi.org/project/sed-model/))
11
+ Current version: **0.3.2** ([PyPI](https://pypi.org/project/sed-model/))
12
12
 
13
13
  ## Two paired models, one parameter language
14
14
 
@@ -9,13 +9,13 @@ Both suites skip gracefully — with an explanatory reason — when the Fortran
9
9
 
10
10
  ## Data locations
11
11
 
12
- The tests look for SED_Tools data products at `~/SED_Tools/data/...` by default, overridable via environment variables:
12
+ The tests look for SED_Tools data products in `~/.sed_tools/data`, then `~/SED_Tools/data`, then `$MESA_DIR/data/colors_data`, using the first location that exists. Each path can be overridden with an environment variable:
13
13
 
14
- | Variable | Default |
14
+ | Variable | Path under the data root |
15
15
  |---|---|
16
- | `CC_KURUCZ_DIR` | `~/SED_Tools/data/stellar_models/Kurucz2003all` |
17
- | `CC_JOHNSON_DIR` | `~/SED_Tools/data/filters/Generic/Johnson` |
18
- | `CC_VEGA_SED` | `~/SED_Tools/data/stellar_models/vega_flam.csv` |
16
+ | `CC_KURUCZ_DIR` | `stellar_models/Kurucz2003all` |
17
+ | `CC_JOHNSON_DIR` | `filters/Generic/Johnson` |
18
+ | `CC_VEGA_SED` | `stellar_models/vega_flam.csv` |
19
19
 
20
20
  ## Forward model: validated against MESA
21
21
 
@@ -2,7 +2,7 @@
2
2
  # and for the others the checks below give a readable error if one is missing.
3
3
  project(
4
4
  'sed_model',
5
- version: '0.3.1',
5
+ version: '0.3.2',
6
6
  meson_version: '>=1.1.0',
7
7
  )
8
8
 
@@ -227,8 +227,11 @@ def _load_filter_dat(path: Path) -> tuple[np.ndarray, np.ndarray]:
227
227
  raise FileNotFoundError(f"Filter file not found: {path}")
228
228
 
229
229
  delimiter = _sniff_delimiter(path)
230
+ # usecols: SED_Tools >= 0.4.0 appends a metadata field to the column row
231
+ # (``Wavelength,Transmission,FilterID=...;DetectorType=...``), which would
232
+ # otherwise make genfromtxt expect three columns.
230
233
  data = np.genfromtxt(path, comments="#", delimiter=delimiter,
231
- invalid_raise=False)
234
+ usecols=(0, 1), invalid_raise=False)
232
235
 
233
236
  if data.ndim == 2:
234
237
  mask = np.isfinite(data[:, 0]) & np.isfinite(data[:, 1])
@@ -0,0 +1,29 @@
1
+ """Locations of the SED_Tools data products the tests use.
2
+
3
+ Each path can be set with an environment variable; otherwise the first
4
+ existing candidate is used (SED_Tools' own cache, the older ``~/SED_Tools``
5
+ layout, then the data shipped with a MESA checkout).
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import os
11
+
12
+ _ROOTS = [
13
+ os.path.expanduser("~/.sed_tools/data"),
14
+ os.path.expanduser("~/SED_Tools/data"),
15
+ ]
16
+ if os.environ.get("MESA_DIR"):
17
+ _ROOTS.append(os.path.join(os.environ["MESA_DIR"], "data", "colors_data"))
18
+
19
+
20
+ def _find(env: str, *parts: str) -> str:
21
+ if os.environ.get(env):
22
+ return os.environ[env]
23
+ candidates = [os.path.join(root, *parts) for root in _ROOTS]
24
+ return next((c for c in candidates if os.path.exists(c)), candidates[0])
25
+
26
+
27
+ KURUCZ_DIR = _find("CC_KURUCZ_DIR", "stellar_models", "Kurucz2003all")
28
+ JOHNSON_DIR = _find("CC_JOHNSON_DIR", "filters", "Generic", "Johnson")
29
+ VEGA_SED = _find("CC_VEGA_SED", "stellar_models", "vega_flam.csv")
@@ -33,18 +33,7 @@ import numpy as np
33
33
  # ---------------------------------------------------------------------------
34
34
  # Path configuration
35
35
  # ---------------------------------------------------------------------------
36
- KURUCZ_DIR = os.environ.get(
37
- "CC_KURUCZ_DIR",
38
- os.path.expanduser("~/SED_Tools/data/stellar_models/Kurucz2003all"),
39
- )
40
- JOHNSON_DIR = os.environ.get(
41
- "CC_JOHNSON_DIR",
42
- os.path.expanduser("~/SED_Tools/data/filters/Generic/Johnson"),
43
- )
44
- VEGA_SED = os.environ.get(
45
- "CC_VEGA_SED",
46
- os.path.expanduser("~/SED_Tools/data/stellar_models/vega_flam.csv"),
47
- )
36
+ from _data_paths import KURUCZ_DIR, JOHNSON_DIR, VEGA_SED
48
37
 
49
38
  R_SUN = 6.957e10
50
39
  D_10PC = 3.0857e19
@@ -34,18 +34,7 @@ import pytest
34
34
  # ---------------------------------------------------------------------------
35
35
  # Paths
36
36
  # ---------------------------------------------------------------------------
37
- KURUCZ_DIR = os.environ.get(
38
- "CC_KURUCZ_DIR",
39
- os.path.expanduser("~/SED_Tools/data/stellar_models/Kurucz2003all"),
40
- )
41
- JOHNSON_DIR = os.environ.get(
42
- "CC_JOHNSON_DIR",
43
- os.path.expanduser("~/SED_Tools/data/filters/Generic/Johnson"),
44
- )
45
- VEGA_SED = os.environ.get(
46
- "CC_VEGA_SED",
47
- os.path.expanduser("~/SED_Tools/data/stellar_models/vega_flam.csv"),
48
- )
37
+ from _data_paths import KURUCZ_DIR, JOHNSON_DIR, VEGA_SED
49
38
 
50
39
  R_SUN = 6.957e10
51
40
  D_10PC = 3.0857e19
@@ -142,3 +142,26 @@ def test_linear_interp_handles_nan_cube_node():
142
142
  flux, ierr = cc.interp_sed_linear(0.4, 0.0, 0.0, x, one, one, cube)
143
143
  assert np.all(np.isfinite(flux))
144
144
  assert ierr >= 1
145
+
146
+
147
+ def test_filter_header_row_with_metadata_field(tmp_path):
148
+ """SED_Tools >= 0.4.0 appends ``;``-separated metadata as a third comma
149
+ field of the column row. The loader reads only the two data columns, for
150
+ that layout, the bare row, and the older leading ``# Key: value`` lines."""
151
+ from sed_model.filters import load_filters
152
+
153
+ rows = "3200.0,2.4e-08\n3300.0,0.5\n3400.0,0.9\n3500.0,0.0\n"
154
+ layouts = {
155
+ "bare": "Wavelength,Transmission\n" + rows,
156
+ "meta": ("Wavelength,Transmission,FilterID=GAIA/GAIA3.G;DetectorType=photon;"
157
+ "DetectorTypeSource=svo-curve-match;WavelengthUnit=Angstrom;"
158
+ "Components=filter+qe+instrument\n" + rows),
159
+ "comments": "# FilterID: GAIA/GAIA3.G\n# DetectorType: photon\nWavelength,Transmission\n" + rows,
160
+ }
161
+ waves = {}
162
+ for name, text in layouts.items():
163
+ (tmp_path / f"{name}.dat").write_text(text)
164
+ (f,) = load_filters([tmp_path / f"{name}.dat"])
165
+ waves[name] = (f.wavelengths.tolist(), f.transmission.tolist())
166
+ assert waves["meta"] == waves["bare"] == waves["comments"]
167
+ assert waves["meta"][0] == [3200.0, 3300.0, 3400.0, 3500.0]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes