Skip to content

Implement is_empty method #2668

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

Closed
wants to merge 1 commit into from
Closed

Conversation

hyanwong
Copy link
Member

@hyanwong hyanwong commented Dec 23, 2022

Description

Fixes #2640

PR Checklist:

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

@codecov
Copy link

codecov bot commented Dec 23, 2022

Codecov Report

Merging #2668 (ece21ff) into main (ec992da) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2668   +/-   ##
=======================================
  Coverage   93.91%   93.91%           
=======================================
  Files          27       28    +1     
  Lines       27657    27692   +35     
  Branches     1270     1274    +4     
=======================================
+ Hits        25973    26008   +35     
  Misses       1647     1647           
  Partials       37       37           
Flag Coverage Δ
c-tests 92.25% <ø> (ø)
lwt-tests 89.05% <ø> (ø)
python-c-tests 72.23% <11.11%> (+0.01%) ⬆️
python-tests 98.97% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
python/tskit/trees.py 98.75% <100.00%> (+<0.01%) ⬆️
python/tskit/__init__.py 100.00% <0.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 ec992da...ece21ff. Read the comment docs.

@hyanwong hyanwong mentioned this pull request Dec 24, 2022
3 tasks
@benjeffery benjeffery added this to the Python 0.5.4 milestone Jan 4, 2023
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 @hyanwong! LGTM!

@jeromekelleher
Copy link
Member

Looks good, but I don't really see the value in the more complicated definition. This should have another name (if we need it at all).

@hyanwong
Copy link
Member Author

We couldn't decide on a sensible name ("branchless" was best), but came to the conclusion that tree.num_edges == 0 is pretty clear, so killing this idea unless there's greater demand. Best would be to document this somewhere though

@hyanwong hyanwong closed this Jan 10, 2023
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.

Tree.is_empty method
3 participants