Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix linting in bpz_lite, try bumping codecov workflow version #48

Merged
merged 9 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ jobs:
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

10 changes: 4 additions & 6 deletions src/rail/estimation/algos/bpz_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from rail.core.common_params import SHARED_PARAMS



def nzfunc(z, z0, alpha, km, m, m0): # pragma: no cover
zm = z0 + (km * (m - m0))
return np.power(z, alpha) * np.exp(-1. * np.power((z / zm), alpha))
Expand Down Expand Up @@ -71,7 +70,7 @@ class BPZliteInformer(CatInformer):
bands=SHARED_PARAMS,
err_bands=SHARED_PARAMS,
ref_band=SHARED_PARAMS,
redshift_col=SHARED_PARAMS,
redshift_col=SHARED_PARAMS,
data_path=Param(str, "None",
msg="data_path (str): file path to the "
"SED, FILTER, and AB directories. If left to "
Expand Down Expand Up @@ -259,7 +258,7 @@ class BPZliteEstimator(CatEstimator):
bands=SHARED_PARAMS,
ref_band=SHARED_PARAMS,
err_bands=SHARED_PARAMS,
redshift_col=SHARED_PARAMS,
redshift_col=SHARED_PARAMS,
dz=Param(float, 0.01, msg="delta z in grid"),
unobserved_val=Param(float, -99.0, msg="value to be replaced with zero flux and given large errors for non-observed filters"),
data_path=Param(str, "None",
Expand Down Expand Up @@ -391,7 +390,7 @@ def _preprocess_magnitudes(self, data):
errs = self.config.err_bands

fluxdict = {}

# Load the magnitudes
zp_frac = e_mag2frac(np.array(self.config.zp_errors))

Expand Down Expand Up @@ -424,7 +423,6 @@ def _preprocess_magnitudes(self, data):
data[bandname][obsmask] = -99.0
data[errname][obsmask] = 20.0


# Only one set of mag errors
mag_errs = np.array([data[er] for er in errs]).T

Expand Down Expand Up @@ -482,7 +480,7 @@ def _preprocess_magnitudes(self, data):
fluxdict['flux_err'] = flux_err
m_0_col = self.config.bands.index(self.config.ref_band)
fluxdict['mag0'] = mags[:, m_0_col]

return fluxdict

def _estimate_pdf(self, flux_templates, kernel, flux, flux_err, mag_0, z):
Expand Down
Loading