Skip to content

Commit

Permalink
Merge branch 'main' into issue/13/create-cosmos-example
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelshirley authored May 17, 2024
2 parents b3a5757 + 5137235 commit 72be269
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/testing-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ jobs:
run: |
python -m pytest tests -m "not slow" --cov=lephare --cov-report=xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pz-rail-lephare

[![Template](https://img.shields.io/badge/Template-LINCC%20Frameworks%20Python%20Project%20Template-brightgreen)](https://lincc-ppt.readthedocs.io/en/latest/)
[![codecov](https://codecov.io/gh/LSSTDESC/pz-rail-lephare/branch/main/graph/badge.svg)](https://codecov.io/gh/LSSTDESC/pz-rail-lephare)
[![codecov](https://codecov.io/gh/LSSTDESC/rail_lephare/graph/badge.svg?token=I597zffkaM)](https://codecov.io/gh/LSSTDESC/rail_lephare)
[![PyPI](https://img.shields.io/pypi/v/pz-rail-lephare?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/pz-rail-lephare/)

## RAIL LePHARE
Expand Down
9 changes: 6 additions & 3 deletions src/rail/estimation/algos/lephare.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def _rail_to_lephare_input(data, mag_cols, mag_err_cols):
"""
ng = data["redshift"].shape[0]
ng = data[mag_cols[0]].shape[0]
# Make input catalogue in standard lephare format
input = Table()
try:
Expand All @@ -280,12 +280,15 @@ def _rail_to_lephare_input(data, mag_cols, mag_err_cols):
mask &= input[mag_err_cols[n]] > 0
mask &= ~np.isnan(input[mag_err_cols[n]])
context += mask * 2**n

Check warning on line 282 in src/rail/estimation/algos/lephare.py

View check run for this annotation

Codecov / codecov/patch

src/rail/estimation/algos/lephare.py#L278-L282

Added lines #L278 - L282 were not covered by tests
# Set context to data value or excluding all negative and nan values
# Set context to data value if set or else exclude all negative and nan values
try:
input["context"] = data["context"]
except KeyError:
input["context"] = context

Check warning on line 287 in src/rail/estimation/algos/lephare.py

View check run for this annotation

Codecov / codecov/patch

src/rail/estimation/algos/lephare.py#L284-L287

Added lines #L284 - L287 were not covered by tests
input["zspec"] = data["redshift"]
try:
input["zspec"] = data["redshift"]
except KeyError:
input["zspec"] = np.full(ng,-99.)
input["string_data"] = " "
return input

Expand Down

0 comments on commit 72be269

Please sign in to comment.