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

Update to comply with owlready2>0.41 #639

Merged
merged 17 commits into from
Oct 9, 2023

Conversation

francescalb
Copy link
Collaborator

Description

Olwready2 has changed so that when asking for an attribute it returns its name as a locstr (e.g. locstr('Atom', 'en')) instead of jsut the string (e.g. 'Atom'). This enables differentiating between languages.
locstr inherits from str so mostly it does not change much, except that the output looks different.

A setassert function was made to help testing.

Type of change

  • Bug fix.
  • New feature.
  • Documentation update.
  • Test 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

@francescalb francescalb self-assigned this Sep 22, 2023
francescalb and others added 3 commits September 29, 2023 07:24
It was needed to udate the search for annotation property seach with
getattr for ThingClass
We should be in ontopy.Ontology if we want to use get_by_label and not
owlready2 Ontology
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #639 (a2865f2) into master (a60fc28) will increase coverage by 0.30%.
Report is 1 commits behind head on master.
The diff coverage is 93.75%.

@@            Coverage Diff             @@
##           master     #639      +/-   ##
==========================================
+ Coverage   69.49%   69.80%   +0.30%     
==========================================
  Files          16       16              
  Lines        3350     3361      +11     
==========================================
+ Hits         2328     2346      +18     
+ Misses       1022     1015       -7     
Files Coverage Δ
ontopy/excelparser.py 83.23% <ø> (+1.44%) ⬆️
ontopy/graph.py 66.25% <100.00%> (+0.17%) ⬆️
ontopy/ontology.py 77.86% <ø> (ø)
ontopy/patch.py 63.52% <92.30%> (+3.65%) ⬆️

ontopy/excelparser.py Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
from utilities import setassert


def test_get_by_label_onto(emmo: "Ontology") -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

What version of EMMO does the emmo argument correspond to? Does it correspond to a stable tag or will it change with time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It imporst 1.0.0-beta4 (this is currently the default in get_ontology)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok. Since the pytest fixtures are so opaque, it might be good to add a comment saying this (since we might have to update the tests when get_ontology() is updated to return a newer version of EMMO).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not agree that they are opaque, but to make it more readily clear I added a comment in the emmo fixture on conftest.

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.

Nice. Added some comments

ontopy/ontology.py Outdated Show resolved Hide resolved
@francescalb francescalb merged commit 24b86ad into master Oct 9, 2023
12 checks passed
@francescalb francescalb deleted the upgrade_to_owlready0.4x_with_breaking_change branch October 9, 2023 19:44
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