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 numeric triples factory #862

Merged
merged 18 commits into from
Apr 7, 2022

Conversation

mberr
Copy link
Member

@mberr mberr commented Apr 5, 2022

This PR is a spin-off of #857 , which extracts the changes to numeric triples factory.

trigger ci
@mberr mberr changed the title Fix numeric triples factory πŸ§‘β€πŸ­πŸ”’ Fix numeric triples factory Apr 6, 2022
@mberr mberr requested a review from cthoyt April 6, 2022 08:47
@@ -932,13 +941,15 @@ def from_labeled_triples(
@classmethod
def from_path(
cls,
*,
Copy link
Member

Choose a reason for hiding this comment

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

this seems to conflict with the fact that you removed the path from the usages of TriplesFactory.from_path in the examples. Typically, I still leave the first required argument before the * since common usage might not have the keyword

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the path keyword parameter

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

On second thought, this looks a bit redundant since the function is already called from_path.

Copy link
Member

@cthoyt cthoyt left a comment

Choose a reason for hiding this comment

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

Other than wondering if the doctests on data.rst are broken and addressing my comment, this looks good to me

cls,
*,
triples: LabeledTriples,
numeric_triples: LabeledTriples = None,
Copy link
Member

@cthoyt cthoyt Apr 7, 2022

Choose a reason for hiding this comment

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

Is there a meaningful case in which numeric_triples could be none? I see it raises an error, but why even allow this? Is this so it can follow the parent's signature?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a meaningful case in which numeric_triples could be none?

no

Is this so it can follow the parent's signature?

yes

Copy link
Member

Choose a reason for hiding this comment

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

So if you want to leave it as is, then this is good to merge

@mberr mberr merged commit 8f3e74f into master Apr 7, 2022
@mberr mberr deleted the fix-numeric-triples-factory branch April 7, 2022 15:29
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