Skip to content

Conversation

@hyanwong
Copy link
Member

@hyanwong hyanwong commented Jul 1, 2022

@codecov
Copy link

codecov bot commented Jul 1, 2022

Codecov Report

Merging #2377 (22fb937) into main (7d1d28e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2377   +/-   ##
=======================================
  Coverage   93.25%   93.25%           
=======================================
  Files          28       28           
  Lines       26864    26868    +4     
  Branches     1229     1230    +1     
=======================================
+ Hits        25053    25057    +4     
  Misses       1778     1778           
  Partials       33       33           
Flag Coverage Δ
c-tests 92.25% <ø> (ø)
lwt-tests 89.05% <ø> (ø)
python-c-tests 71.25% <42.85%> (+<0.01%) ⬆️
python-tests 98.72% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
python/tskit/__init__.py 100.00% <100.00%> (ø)
python/tskit/drawing.py 99.17% <100.00%> (+<0.01%) ⬆️
python/tskit/trees.py 97.84% <100.00%> (ø)

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 7d1d28e...22fb937. Read the comment docs.

@hyanwong hyanwong force-pushed the svg-class branch 2 times, most recently from 59ddc22 to 0c2b72a Compare July 1, 2022 16:00
@hyanwong hyanwong requested a review from benjeffery July 1, 2022 16:01
@hyanwong hyanwong marked this pull request as ready for review July 1, 2022 16:01
@hyanwong
Copy link
Member Author

hyanwong commented Jul 1, 2022

The functionality is not actually documented in the ts.draw_svg() and tree.draw_svg() methods. Suggestions for how to document this would be good.

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.

LGTM, one PEP8 nit.

return self.plot_min - (y - self.min_time) * y_scale


class _svg_string(str):
Copy link
Member

Choose a reason for hiding this comment

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

Can we use SVGString? As a class name it has to be capitalised.

Copy link
Member Author

@hyanwong hyanwong Jul 1, 2022

Choose a reason for hiding this comment

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

Oh yes, very good point. If we think of it a an "internal use" class do we want a prefix underscore, _SVGString or are we happy that it's sort of public?

Copy link
Member

Choose a reason for hiding this comment

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

Without the underscore as it is returned by the API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, and a bit of documentation added.

@hyanwong
Copy link
Member Author

hyanwong commented Jul 1, 2022

Docs failing because SVGString isn't a documented class (nothing in drawing.py is in the docs), but draw_svg() returns :rtype: SVGString. I can lie and set this back to :rtype: str or I can try to make the SVGString class documented somewhere, or I can somehow exclude SVGString from being checked by the docs generator. Which would you prefer @benjeffery ?

@benjeffery
Copy link
Member

As this is being returned by the public API it should probably be doc'd under https://tskit.dev/tskit/docs/stable/python-api.html#miscellaneous-classes

@hyanwong
Copy link
Member Author

hyanwong commented Jul 2, 2022

As this is being returned by the public API it should probably be doc'd under https://tskit.dev/tskit/docs/stable/python-api.html#miscellaneous-classes

Oh, very good call. Done.

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.

LGTM!

@mergify mergify bot merged commit e99c448 into tskit-dev:main Jul 4, 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.

2 participants