Skip to content

Fix draw_svg warning for mutations above unplotted nodes#2871

Merged
mergify[bot] merged 1 commit intotskit-dev:mainfrom
Duncan-JR:fix_plot_warning
Nov 15, 2023
Merged

Fix draw_svg warning for mutations above unplotted nodes#2871
mergify[bot] merged 1 commit intotskit-dev:mainfrom
Duncan-JR:fix_plot_warning

Conversation

@Duncan-JR
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.

@Duncan-JR Duncan-JR marked this pull request as ready for review November 14, 2023 16:31
@codecov
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

@Duncan-JR
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!

@mergify mergify bot merged commit 813f4ed into tskit-dev:main Nov 15, 2023
@Duncan-JR Duncan-JR 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