From cf71a79de9f9a9fe14932e2b8b0a58d7a679e774 Mon Sep 17 00:00:00 2001 From: Tomas Stolker Date: Sun, 6 Oct 2024 13:32:46 +0200 Subject: [PATCH] Fixed issue with finding missing spectra in model grid --- README.rst | 2 -- pyproject.toml | 6 +++--- species/util/data_util.py | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 53b5621..db99a07 100644 --- a/README.rst +++ b/README.rst @@ -11,8 +11,6 @@ There are tools available for grid and free retrievals using Bayesian inference, synthetic photometry, interpolating a variety atmospheric and evolutionary model grids (including the possibility to add a custom grid), color-magnitude and color-color diagrams, empirical spectral analysis, spectral and photometric calibration, and analysis of emission lines. The package has been released on `PyPI `_ and is actively developed and maintained on `Github `_. -**Important:** Importing the *species* package had become slow because of the many classes and functions that were implicitly imported. The initialization of the package has therefore been adjusted. Any functionalities should now be explicitly imported from the modules that they are part of. - Documentation ------------- diff --git a/pyproject.toml b/pyproject.toml index ba09932..495869b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,8 @@ Documentation = "https://species.readthedocs.io" Repository = "https://github.com/tomasstolker/species" Issues = "https://github.com/tomasstolker/species/issues" -[tool.setuptools] -packages = [] - [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} + +[tool.setuptools.package-data] +mypkg = ["*.json"] diff --git a/species/util/data_util.py b/species/util/data_util.py index 84f013d..6ec617c 100644 --- a/species/util/data_util.py +++ b/species/util/data_util.py @@ -390,7 +390,8 @@ def add_missing( print(f" - {item}: {grid_shape[i]}") flux = np.asarray(database[f"models/{model}/flux"]) # (W m-1 um-1) - flux[flux <= 0.0] = 1e-50 + # Should be < and not <= since missing spectra have zero fluxes + flux[flux < 0.0] = 1e-50 flux = np.log10(flux) count_total = 0