Skip to content

Commit

Permalink
Merge branch 'lenstronomy:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sibirrer authored Nov 30, 2023
2 parents 279514d + 5c83edc commit 6e0842e
Show file tree
Hide file tree
Showing 43 changed files with 2,176 additions and 566 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pytest
python -m pip install flake8 pytest pytest-cov coveralls
python -m pip install flake8 pytest pytest-cov
python -m pip install codecov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test_requirements.txt ]; then pip install -r test_requirements.txt; fi
python -m pip install .
Expand All @@ -38,13 +39,21 @@ jobs:
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --cov=lenstronomy
pytest --cov=./ --cov-report=xml
codecov
- name: Coveralls
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml

# - name: Coveralls
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# coveralls --service=github

# from this source for coveralls: https://github.com/marketplace/actions/coveralls-github-action
#- uses: actions/checkout@v1
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
:target: http://lenstronomy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://coveralls.io/repos/github/lenstronomy/lenstronomy/badge.svg?branch=main
:target: https://coveralls.io/github/lenstronomy/lenstronomy?branch=main
.. image:: https://codecov.io/gh/lenstronomy/lenstronomy/graph/badge.svg?token=Pk1FmwQ4Ek
:target: https://codecov.io/gh/lenstronomy/lenstronomy

.. image:: https://img.shields.io/badge/License-BSD_3--Clause-blue.svg
:target: https://github.com/lenstronomy/lenstronomy/blob/main/LICENSE
Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
comment: # this is a top-level key
layout: " diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: false # [true :: must have a base report to post]
require_head: true # [true :: must have a head report to post]
242 changes: 170 additions & 72 deletions lenstronomy/ImSim/image2source_mapping.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lenstronomy/ImSim/image_linear_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,9 @@ def _linear_response_matrix(
:return: response matrix (m x n)
"""
x_grid, y_grid = self.ImageNumerics.coordinates_evaluate

source_light_response, n_source = self.source_mapping.image_flux_split(
x_grid, y_grid, kwargs_lens, kwargs_source
x_grid, y_grid, kwargs_lens, kwargs_source, kwargs_special
)
extinction = self._extinction.extinction(
x_grid,
Expand Down
11 changes: 8 additions & 3 deletions lenstronomy/ImSim/image_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
if point_source_class is None:
point_source_class = PointSource(point_source_type_list=[])
self.PointSource = point_source_class
if self.PointSource._lensModel is None:
if self.PointSource._lens_model is None:
self.PointSource.update_lens_model(lens_model_class=lens_model_class)
x_center, y_center = self.Data.center
self.PointSource.update_search_window(
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(
self.source_mapping = None # handled with pixelated operator
else:
self.source_mapping = Image2SourceMapping(
lensModel=lens_model_class, sourceModel=source_model_class
lens_model=lens_model_class, source_model=source_model_class
)

self._pb = data_class.primary_beam
Expand Down Expand Up @@ -294,7 +294,12 @@ def _source_surface_brightness_analytical_numerics(
)
else:
source_light = self.source_mapping.image_flux_joint(
ra_grid, dec_grid, kwargs_lens, kwargs_source, k=k
ra_grid,
dec_grid,
kwargs_lens,
kwargs_source,
kwargs_special=kwargs_special,
k=k,
)
source_light *= self._extinction.extinction(
ra_grid,
Expand Down
Loading

0 comments on commit 6e0842e

Please sign in to comment.