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

Regenerate name to avoid starting with underscore #4761

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

QRemy
Copy link
Contributor

@QRemy QRemy commented Sep 25, 2023

Prevent a random fail in the CI when auto-generated name start with underscore :
FAILED .....tox\py310-test-alldeps_noray\lib\site-packages\gammapy\visualization\tests\test_datasets.py::test_plot_spectrum_datasets_off_regions - matplotlib._api.deprecation.MatplotlibDeprecationWarning: An artist whose label starts with an underscore was passed to legend(); such artists will no longer be ignored in the future. To suppress this warning, explicitly filter out such artists, e.g. with [art for art in artists if not art.get_label().startswith('_')].

This should fix the break seen in #4759.

Signed-off-by:  <quentin.remy@live.fr>
@QRemy QRemy added backport-v1.0.x on-merge: backport to v1.0.x backport-v1.1.x on-merge: backport to v1.1.x bug labels Sep 25, 2023
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #4761 (662bd1c) into main (e53e1ea) will increase coverage by 0.02%.
Report is 11 commits behind head on main.
The diff coverage is 97.67%.

@@            Coverage Diff             @@
##             main    #4761      +/-   ##
==========================================
+ Coverage   76.02%   76.04%   +0.02%     
==========================================
  Files         223      223              
  Lines       32053    32085      +32     
==========================================
+ Hits        24367    24398      +31     
- Misses       7686     7687       +1     
Files Changed Coverage Δ
gammapy/modeling/models/spectral.py 89.21% <96.87%> (+0.27%) ⬆️
gammapy/data/event_list.py 36.28% <100.00%> (-0.18%) ⬇️
gammapy/datasets/evaluator.py 89.72% <100.00%> (ø)
gammapy/modeling/models/spatial.py 85.02% <100.00%> (-0.03%) ⬇️
gammapy/modeling/models/tests/test_cube.py 91.52% <100.00%> (-0.02%) ⬇️
gammapy/modeling/models/tests/test_io.py 52.52% <100.00%> (+0.48%) ⬆️
gammapy/utils/scripts.py 89.13% <100.00%> (+0.49%) ⬆️

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

@bkhelifi
Copy link
Member

The CI fails because of ModuleNotFoundError: No module named 'astropy.coordinates.angle_utilities. But this is unrelated to this PR.

bkhelifi
bkhelifi previously approved these changes Sep 25, 2023
Copy link
Member

@bkhelifi bkhelifi left a comment

Choose a reason for hiding this comment

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

Thanks @QRemy

@QRemy
Copy link
Contributor Author

QRemy commented Sep 25, 2023

The CI fails because of ModuleNotFoundError: No module named 'astropy.coordinates.angle_utilities. But this is unrelated to this PR.

I tried to fix that direclty in this PR but I could open an other one instead.

Copy link
Contributor

@registerrier registerrier left a comment

Choose a reason for hiding this comment

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

Thanks @QRemy. This looks good.

I think having the angular_utilities change in another PR would be better. But this can go as is.
This part of the PR can be backported too to ensure CI runs on bugfix branches with future versions.

@registerrier registerrier added this to the 1.2 milestone Sep 25, 2023
@registerrier registerrier merged commit 47e4066 into gammapy:main Sep 25, 2023
15 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/gammapy that referenced this pull request Sep 25, 2023
meeseeksmachine pushed a commit to meeseeksmachine/gammapy that referenced this pull request Sep 25, 2023
registerrier added a commit that referenced this pull request Sep 25, 2023
…1-on-v1.0.x

Backport PR #4761 on branch v1.0.x (Regenerate name to avoid starting with underscore)
registerrier added a commit that referenced this pull request Sep 25, 2023
…1-on-v1.1.x

Backport PR #4761 on branch v1.1.x (Regenerate name to avoid starting with underscore)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v1.0.x on-merge: backport to v1.0.x backport-v1.1.x on-merge: backport to v1.1.x bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants