Skip to content

Refactor load_img#40

Closed
emirkmo wants to merge 7 commits intoSNflows:develfrom
emirkmo:edge-stuff
Closed

Refactor load_img#40
emirkmo wants to merge 7 commits intoSNflows:develfrom
emirkmo:edge-stuff

Conversation

@emirkmo
Copy link
Contributor

@emirkmo emirkmo commented Feb 14, 2022

This is a full refactor of load_img to a more object oriented approach. All instruments are now classes that inherit from a generic Instrument parent/base class.

This now makes it much easier for me to add a few more fixes for image issues associated with edges. But before I do that, I wanted to merge a full working copy that reproduces the previous load_img functionality and makes it arguably easier to add new instruments.

The plan is to move most of this to an instruments.py file, and keep load_img.py a much smaller file that actually loads images. But that can be left to the future after the edge checking has also been implemented.

I will open some issues to track the other upcoming refactors.

Passing tests locally on python 3.7+ and a manual test of the run_photometry file. (Which we should also add as a unit test?)

Two caveats: we use spaces instead of tabs. This just made it much easier to read these multiline conditionals. I suggest we move to default 4 spaces following most major libraries and python black, as I would like to eventually enable it for automatic code formatting (to reduce code formatting maintenance overhead).

(I did a rebase onto devel before the merge to run the tests and run_photometry as flows table format had changed)

@emirkmo
Copy link
Contributor Author

emirkmo commented Feb 14, 2022

Fixes #29

@emirkmo emirkmo linked an issue Feb 14, 2022 that may be closed by this pull request
@emirkmo
Copy link
Contributor Author

emirkmo commented Feb 15, 2022

Waiting on #48 and #42. CI will need to be re-triggered after.

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #40 (a4b9bd4) into devel (563f809) will decrease coverage by 28.22%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #40       +/-   ##
==========================================
- Coverage   29.14%   0.92%   -28.23%     
==========================================
  Files          36      26       -10     
  Lines        2628    2281      -347     
==========================================
- Hits          766      21      -745     
- Misses       1862    2260      +398     
Impacted Files Coverage Δ
flows/__init__.py 20.00% <ø> (-80.00%) ⬇️
flows/aadc_db.py 0.00% <ø> (-100.00%) ⬇️
flows/catalogs.py 0.00% <0.00%> (-33.70%) ⬇️
flows/coordinatematch/coordinatematch.py 0.00% <0.00%> (-11.98%) ⬇️
flows/coordinatematch/wcs.py 0.00% <0.00%> (-24.76%) ⬇️
flows/epsfbuilder/epsfbuilder.py 0.00% <0.00%> (-39.14%) ⬇️
flows/load_image.py 0.00% <0.00%> (-35.39%) ⬇️
flows/photometry.py 5.52% <0.00%> (-4.42%) ⬇️
flows/plots.py 0.00% <0.00%> (-12.60%) ⬇️
flows/reference_cleaning.py 0.00% <0.00%> (-12.36%) ⬇️
... and 49 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 563f809...a4b9bd4. Read the comment docs.

@emirkmo emirkmo closed this Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it easier to add sites

1 participant