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

Set keep_unary on simplify, and document (including path compression docs) #176

Merged

Conversation

hyanwong
Copy link
Member

We should also switch simplify in these cases to set keep_unary=True, and document accordingly.

@codecov
Copy link

codecov bot commented Aug 12, 2019

Codecov Report

Merging #176 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
+ Coverage   93.93%   93.93%   +<.01%     
==========================================
  Files          11       11              
  Lines        2885     2886       +1     
  Branches      507      507              
==========================================
+ Hits         2710     2711       +1     
  Misses        145      145              
  Partials       30       30
Impacted Files Coverage Δ
tsinfer/inference.py 99.02% <100%> (ø) ⬆️
tsinfer/eval_util.py 88.77% <100%> (+0.02%) ⬆️

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 4d13b81...899ebf5. Read the comment docs.

@hyanwong hyanwong changed the title Document some extra params for .infer() and friends Set keep_unary on simplify, and document (including path compression docs) Aug 14, 2019
@hyanwong
Copy link
Member Author

@jeromekelleher - do we want to document the progress_monitor parameter too? E.g. at the moment the documentation uses something like:

def match_ancestors(
        sample_data, ancestor_data, progress_monitor=None, num_threads=0,
        path_compression=True, extended_checks=False, engine=constants.C_ENGINE):
    """
    match_ancestors(sample_data, ancestor_data, num_threads=0, path_compression=True)
    ...
    """

And (weirdly to me), the progress_monitor param, which is 3rd, is omitted from the docstring. Presumably this means that people using this function without named parameters will be misled into thinking that they can specify num_threads by setting it as a 3rd (unnamed) parameter.

@jeromekelleher
Copy link
Member

do we want to document the progress_monitor parameter too?

No, this is too complicated, will probably change over time and is really for internal use. We don't want people using this.

And (weirdly to me), the progress_monitor param, which is 3rd, is omitted from the docstring. Presumably this means that people using this function without named parameters will be misled into thinking that they can specify num_threads by setting it as a 3rd (unnamed) parameter.

That is weird --- we should change the signature of the function to match the docs.

@hyanwong
Copy link
Member Author

we should change the signature of the function to match the docs.

Fine. I'll do this in the same PR shall I? We don't mind changing the order in this case? I guess we put it either before or after the (similarly an correctly undocumented) engine param?

@jeromekelleher
Copy link
Member

Fine. I'll do this in the same PR shall I? We don't mind changing the order in this case? I guess we put it either before or after the (similarly an correctly undocumented) engine param?

That would be good, thanks.

@hyanwong hyanwong force-pushed the document-path-compression-mc branch from 1fea866 to 2dbac3a Compare August 14, 2019 14:07
@hyanwong
Copy link
Member Author

hyanwong commented Aug 14, 2019

This now works and passes unit tests on my machine, but since keep_unary is only in tskit 0.2.0, it will probably fail CI. There's also a small change to get the tests to pass under 0.2.0, now that tskit.MISSING_DATA is output for isolated nodes, which what 2dbac3a is all about. I guess we will wait for the 0.2.0 release until merging this PR. Is that likely to be soon, @jeromekelleher ?

@hyanwong hyanwong force-pushed the document-path-compression-mc branch 2 times, most recently from 7c99bdc to a62c6d4 Compare August 14, 2019 14:48
@jeromekelleher
Copy link
Member

tskit 0.2.0 should be shipped in a week or so --- best to wait for it to avoid complications.

@hyanwong
Copy link
Member Author

Right - perfect. Thanks.

@jeromekelleher jeromekelleher force-pushed the document-path-compression-mc branch 2 times, most recently from 1499e4d to badd08c Compare September 2, 2019 11:39
@jeromekelleher
Copy link
Member

Closes #146

@jeromekelleher jeromekelleher merged commit 2008cb3 into tskit-dev:master Sep 2, 2019
@hyanwong hyanwong deleted the document-path-compression-mc branch September 2, 2019 20:50
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.

None yet

2 participants