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

Fixing backward propagation for vector vortex #193

Merged
merged 8 commits into from May 30, 2023

Conversation

GillesOrban
Copy link
Contributor

@GillesOrban GillesOrban commented May 23, 2023

Fixes #186.

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #193 (8ba5f4d) into master (2b707bc) will increase coverage by 0.33%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master     #193      +/-   ##
==========================================
+ Coverage   81.47%   81.81%   +0.33%     
==========================================
  Files          97       97              
  Lines        7300     7304       +4     
==========================================
+ Hits         5948     5976      +28     
+ Misses       1352     1328      -24     
Impacted Files Coverage Δ
hcipy/coronagraphy/vortex.py 94.55% <80.00%> (+12.23%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Owner

@ehpor ehpor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this; much appreciated. The code is working as far as I can see. Thanks for adding the tests too. So only style changes remaining. A few general comments:

  • Never directly compare floating point values. Due to numerical noise, the exact value of a float can vary. You should always use np.allclose(img.intensity, img.V). That compares the two values to within an absolute and relative tolerance. Also, I feel it's better to compare each value in the Field, rather than the sum of the values. I've marked these lines with "Never directly compare floating point values.". These are the direct cause for your failed tests.
  • HCIPy uses tabs for indentation, sadly. That was an early choice that I should have made differently, but now we have to live with it until we can find a way to fix it without losing all git history. You're using spaces for indentation in the test files. These are the direct cause for most of the flake8 linting errors.
  • There are a few more flake8 errors, all whitespace related. You can see them by going towards "Files changed" in this PR. The first 20 errors/warnings should be annotated inside the code, but there are more, most of which are similar to the ones that are annotated.
  • I prefer a "rebase" instead of a "merge" when making this branch up-to-date with master. See https://github.blog/changelog/2022-02-03-more-ways-to-keep-your-pull-request-branch-up-to-date/#:~:text=Rebasing%20applies%20the%20changes%20from,and%20then%20click%20Rebase%20branch. It's a little cleaner than a merge.

tests/test_coronagraphy.py Outdated Show resolved Hide resolved
tests/test_coronagraphy.py Outdated Show resolved Hide resolved
tests/test_coronagraphy.py Outdated Show resolved Hide resolved
tests/test_coronagraphy.py Outdated Show resolved Hide resolved
tests/test_coronagraphy.py Outdated Show resolved Hide resolved
hcipy/coronagraphy/vortex.py Outdated Show resolved Hide resolved
hcipy/coronagraphy/vortex.py Outdated Show resolved Hide resolved
@GillesOrban
Copy link
Contributor Author

Thanks for the review, comments and guidelines. I was indeed a big confused by the tabs vs whitespace usage.
For the 'rebase' instead of 'merge', I am actually not sure how I can undo my merge in the pull request to instead do a rebase. I can revert my merge locally, do a rebase and push it, but not 100% sure this is equivalent and what you prefer (and the cleaner).

@ehpor
Copy link
Owner

ehpor commented May 23, 2023

@GillesOrban

Thanks for the review, comments and guidelines. I was indeed a big confused by the tabs vs whitespace usage. For the 'rebase' instead of 'merge', I am actually not sure how I can undo my merge in the pull request to instead do a rebase. I can revert my merge locally, do a rebase and push it, but not 100% sure this is equivalent and what you prefer (and the cleaner).

No need to try to undo. It's mostly for future PRs / future rebases.

@ehpor
Copy link
Owner

ehpor commented May 23, 2023

@GillesOrban Thanks for the latest flake8 fixes. I'll re-review this later today. FYI: you should also add your ulg.ac.be email to Github so that your commits are linked to it.

Copy link
Owner

@ehpor ehpor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last comment; something that I missed during my first review.

I fully checked all the tests this time as well, and all seems good with those.

hcipy/coronagraphy/vortex.py Outdated Show resolved Hide resolved
@ehpor ehpor self-requested a review May 30, 2023 17:37
Copy link
Owner

@ehpor ehpor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes were addressed. LGTM.

@ehpor ehpor merged commit d97fe50 into ehpor:master May 30, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VectorVortexCoronagraph.backward() is broken
2 participants