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

Fix draw_svg warning for mutations above unplotted nodes #2871

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

duncanMR
Copy link
Contributor

Description

Fixes #2870.
I changed the warning module and modified all the tests that raised that warning to catch it correctly. I made the stack level 2 simply because that seemed to be common with UserWarning instances elsewhere in the package; I'm not sure how one determines that here.

PR Checklist:

  • Tests that fully cover new/changed functionality.
  • Documentation including tutorial content if appropriate.
  • Changelogs, if there are API changes.

@duncanMR duncanMR marked this pull request as ready for review November 14, 2023 16:31
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #2871 (90c4207) into main (b06a718) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2871      +/-   ##
==========================================
- Coverage   89.69%   89.69%   -0.01%     
==========================================
  Files          30       30              
  Lines       30160    30159       -1     
  Branches     5860     5860              
==========================================
- Hits        27053    27052       -1     
  Misses       1778     1778              
  Partials     1329     1329              
Flag Coverage Δ
c-tests 86.09% <ø> (ø)
lwt-tests 80.78% <ø> (ø)
python-c-tests 67.89% <0.00%> (-0.01%) ⬇️
python-tests 98.92% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
python/tskit/drawing.py 99.23% <100.00%> (-0.01%) ⬇️

Continue to review full report in Codecov by Sentry.

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

Copy link
Member

@benjeffery benjeffery left a comment

Choose a reason for hiding this comment

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

Generally in the test we're using pytest.warns as it's a bit cleaner and lets you check the message: https://happytest.readthedocs.io/en/latest/warnings/#warns

@jeromekelleher
Copy link
Member

Yep lgtm

@duncanMR
Copy link
Contributor Author

I've switched the tests to use pytest.warns: it should be ready to merge now

Copy link
Member

@benjeffery benjeffery left a comment

Choose a reason for hiding this comment

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

Thanks @duncanMR!

@benjeffery benjeffery added the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Nov 15, 2023
@mergify mergify bot merged commit 813f4ed into tskit-dev:main Nov 15, 2023
23 checks passed
@mergify mergify bot removed the AUTOMERGE-REQUESTED Ask Mergify to merge this PR label Nov 15, 2023
@duncanMR duncanMR deleted the fix_plot_warning branch February 22, 2024 14:12
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.

Warning for draw_svg plot uses logging module instead of warnings
3 participants