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 directory_layout() function #696

Merged
merged 19 commits into from
Jan 8, 2024
Merged

Added directory_layout() function #696

merged 19 commits into from
Jan 8, 2024

Conversation

jesper-friis
Copy link
Collaborator

@jesper-friis jesper-friis commented Dec 15, 2023

Description

It can suggest a directory layout from the IRIs of all the imported ontologies.

The generation of catalog files has been updated and some bugs in write_catalog() has been fixed. Including:

  • irimap dict is now not modified as a side-effect when relative_paths is true
  • relative paths in irimap are not modified
  • absolute paths written to the catalog file are now relative to the directory or the catalog file when relative_path=True

The read_catalog() has gotten a new argument relative_to which is needed when asking for relative paths. Using this argument ensures that the catalog test is now not dependent on the current working directory when invoking the test.

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

It can suggest a directory layout from the IRIs of all the imported
ontologies.
@jesper-friis jesper-friis marked this pull request as draft December 15, 2023 11:00
@jesper-friis jesper-friis marked this pull request as ready for review December 19, 2023 19:48
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (b6594d1) 71.02% compared to head (5b10822) 71.49%.
Report is 1 commits behind head on master.

Files Patch % Lines
ontopy/utils.py 92.30% 2 Missing ⚠️
ontopy/ontology.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #696      +/-   ##
==========================================
+ Coverage   71.02%   71.49%   +0.46%     
==========================================
  Files          16       16              
  Lines        3369     3385      +16     
==========================================
+ Hits         2393     2420      +27     
+ Misses        976      965      -11     

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

Copy link
Collaborator

@francescalb francescalb left a comment

Choose a reason for hiding this comment

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

This looks good, but please describe system for how the layout is generated.

ontopy/utils.py Outdated
Comment on lines 770 to 772
Returns:
layout: A dict mapping ontology objects to relative path names with
with the file extension stripped off.
Copy link
Collaborator

Choose a reason for hiding this comment

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

PLease explain the heurestics more in detail. This is documentation so that people understand what to expect.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Har lagt til et eksempel i docstring.

@jesper-friis jesper-friis merged commit 77c3bdc into master Jan 8, 2024
12 checks passed
@jesper-friis jesper-friis deleted the directory_layout branch January 8, 2024 20:04
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