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

Added test for descriptions #766

Merged
merged 6 commits into from
Jun 21, 2024
Merged

Added test for descriptions #766

merged 6 commits into from
Jun 21, 2024

Conversation

jesper-friis
Copy link
Collaborator

@jesper-friis jesper-friis commented Jun 2, 2024

Description

Added test for that entities should be described. We require that a entities should have at least a elucidation, definition or conceptualisation. In addition we require that each of them can max be provided once.

Also update ontoconvert to include conceptualisations the --copy-emmo-annotations option.

Tested against EMMO during development, but no additional EMMO-dependent test has been added to the EMMOntoPy repo.

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

Copy link

codecov bot commented Jun 2, 2024

Codecov Report

Attention: Patch coverage is 39.13043% with 14 lines in your changes missing coverage. Please review.

Project coverage is 72.54%. Comparing base (1524490) to head (06642d6).

Files Patch % Lines
emmopy/emmocheck.py 30.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
- Coverage   73.16%   72.54%   -0.62%     
==========================================
  Files          18       18              
  Lines        3678     3701      +23     
==========================================
- Hits         2691     2685       -6     
- Misses        987     1016      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 191 to 192
A description is either an elucidation, a definition or a
conceptualisation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
A description is either an elucidation, a definition or a
conceptualisation.
A description is either an EMMO.elucidation, an EMMO.definition or an
EMMO.conceptualisation.

Comment on lines 205 to 206
"ontology has no description (elucidation, definition or "
"conceptualisation)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"ontology has no description (elucidation, definition or "
"conceptualisation)"
"ontology has no description (EMMO.elucidation, EMMO.definition or "
"EMMO.conceptualisation)"

with self.subTest(entity=entity, label=label):
self.assertTrue(
hasattr(entity, "elucidation"),
msg="no 'elucidation' in ontology",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
msg="no 'elucidation' in ontology",
msg="no 'elucidation' in ontology",
Suggested change
msg="no 'elucidation' in ontology",
msg=f"{entity} has no 'EMMO.elucidation' ",

)
self.assertTrue(
hasattr(entity, "definition"),
msg="no 'definition' in ontology",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
msg="no 'definition' in ontology",
msg=f"{entity} has no 'EMMO.definition'",

)
self.assertTrue(
hasattr(entity, "conceptualisation"),
msg="no 'conceptualisation' in ontology",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
msg="no 'conceptualisation' in ontology",
msg=f"{entity} has no 'conceptualisation'",

Comment on lines 235 to 236
msg="missing description (elucidation, deinition and/or "
f"conceptualidation): {label}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
msg="missing description (elucidation, deinition and/or "
f"conceptualidation): {label}",
msg="missing description (EMMO.elucidation, EMMO.definition and/or "
f"EMMO.conceptualidation): {label}",

)
self.assertTrue(
len(entity.elucidation) < 2,
msg=f"more than one elucidation for {label}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
msg=f"more than one elucidation for {label}",
msg=f"more than one EMMO.elucidation for {label}",

)
self.assertTrue(
len(entity.definition) < 2,
msg=f"more than one definition for {label}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
msg=f"more than one definition for {label}",
msg=f"more than one EMMO.definition for {label}",

)
self.assertTrue(
len(entity.conceptualisation) < 2,
msg=f"more than one conceptualisation for {label}",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
msg=f"more than one conceptualisation for {label}",
msg=f"more than one EMMO.conceptualisation for {label}",

@jesper-friis jesper-friis linked an issue Jun 3, 2024 that may be closed by this pull request
@francescalb francescalb merged commit 9b32587 into master Jun 21, 2024
10 of 12 checks passed
@francescalb francescalb deleted the test-description branch June 21, 2024 22:02
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.

Add options to ontoconvert for adding annotations expected by FOOPS
2 participants