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

Bypass punning in ontodoc. #532

Merged
merged 16 commits into from
Feb 4, 2023
Merged

Conversation

francescalb
Copy link
Collaborator

Description:

Closes #506.
Ontodoc fails when punned individuals are included in the ontology.
After discussions with various people (see #507) we have agreed to not support punning for now.
This might be changed in the future if we see the need.

Tests have been added to see that ontodoc runs for ontologies with an individual, and that it runs with a warning
when the individual is a punned individual. Pytest is set to ignore that particualr warning so that this test
will continue to pass if pytest is set to fail on warnings as well in the future.

Type of change:

  • Bug fix.
  • New feature.
  • Documentation update.

Checklist:

This checklist can be used as a help for the reviewer.

  • Is the code easy to read and understand?
  • Are comments for humans to read, not computers to disregard?
  • Does a new feature has an accompanying new test (in the CI or unit testing schemes)?
  • Has the documentation been updated as necessary?
  • Does this close the issue?
  • Is the change limited to the issue?
  • Are errors handled for all outcomes?
  • Does the new feature provide new restrictions on dependencies, and if so is this documented?

Comments:

Also added a test to check that ontodoc actually runs with non-punned individuals and punned individuals
Comment on lines 413 to 414
except TypeError:
warnings.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very good warning message. Are we sure that there are not other TypeErrors what will be catched by this except statement?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I am not sure that there are not others. But I think it is only punning that will be caught by this because we ask for an indivudal, and then we iterate of the concepts that the individual is an instance of. But I think this is a good point. If there is punning I know that is_instance_of returns 'property' and not a list of concepts, so I changed it to be a positive test for that. Better?

Copy link
Collaborator

@jesper-friis jesper-friis left a comment

Choose a reason for hiding this comment

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

Looks good. Added a question

Copy link
Collaborator

@jesper-friis jesper-friis left a comment

Choose a reason for hiding this comment

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

Yes, this looks very good.

I have not tested it locally which I normally would do if I had my linux machine at hand, but I see you have a good test.

As far as I can see, PR #535 fixes the issue with failing tests. Please merge that into this branch before merging to master.

Copy link
Collaborator

@jesper-friis jesper-friis left a comment

Choose a reason for hiding this comment

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

Accepted given that the test passes

CasperWA and others added 4 commits February 3, 2023 10:37
Note, only the ontodoc tests have been updated, so all other tool tests
will fail.
@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2023

Codecov Report

Merging #532 (cd5c813) into master (f88f721) will increase coverage by 0.24%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #532      +/-   ##
==========================================
+ Coverage   65.59%   65.84%   +0.24%     
==========================================
  Files          16       16              
  Lines        3090     3095       +5     
==========================================
+ Hits         2027     2038      +11     
+ Misses       1063     1057       -6     
Impacted Files Coverage Δ
ontopy/ontodoc.py 67.39% <100.00%> (+1.05%) ⬆️
ontopy/utils.py 62.33% <100.00%> (+0.79%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@francescalb francescalb merged commit 272ee48 into master Feb 4, 2023
@francescalb francescalb deleted the flb/bypass_punning_in_ontodoc branch February 4, 2023 20:59
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.

ontodoc: Expect is_instance_of property to be iterable
4 participants