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

feat: prototype to support multiple prefixes #225

Merged
merged 10 commits into from
Oct 21, 2024

Conversation

Bento007
Copy link
Collaborator

@Bento007 Bento007 commented Oct 8, 2024

Reason for Change

Changes

  • add additional_term_prefix to ontology_info schema
  • check for additional_term_prefix in _extract_ontology_term_metadata

Testing steps

  • run unit tests
  • run schema upgrade

Notes for Reviewer

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 89.79592% with 5 lines in your changes missing coverage. Please review.

Project coverage is 88.47%. Comparing base (b56bb90) to head (3949116).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ology-builder/tests/test_all_ontology_generator.py 90.47% 4 Missing ⚠️
...ols/ontology-builder/src/all_ontology_generator.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
+ Coverage   85.54%   88.47%   +2.92%     
==========================================
  Files          18       18              
  Lines        1128     1171      +43     
  Branches      220      102     -118     
==========================================
+ Hits          965     1036      +71     
+ Misses        153      119      -34     
- Partials       10       16       +6     
Flag Coverage Δ
unittests 88.47% <89.79%> (+2.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@nayib-jose-gloria nayib-jose-gloria changed the title feat: prototype to support multiple suffixes feat: prototype to support multiple prefixes Oct 21, 2024
@@ -2,6 +2,10 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Ontology Version and Source Schema",
"definitions": {
"AfPO_term_id": {
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 would be nice to not have to update this every time we add a new prefix. Ideas welcome

Copy link
Collaborator

Choose a reason for hiding this comment

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

It doesn't hurt to have an index of all the terms we parse for + explicitly enforce we're not including anything we don't want to. I'm fine to keep it as it is

Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not entirely sure what the alternative would be, but i think i would slightly prefer having an explicit allowlist of prefixes we parse for

@@ -266,8 +267,8 @@ def _parse_ontologies(
version = ontology_info[onto.name]["version"]
output_file = os.path.join(output_path, get_ontology_file_name(onto.name, version))
logging.info(f"Processing {output_file}")

onto_dict = _extract_ontology_term_metadata(onto)
allowed_ontologies = [onto.name] + ontology_info[onto.name].get("additional_ontologies", [])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should allowed_ontologies agree with additional_ontologies in the schema?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think allowed_ontologies == main ontology + additional ontologies makes intuitive sense as-is



@pytest.fixture
def sample_ontology(tmp_path):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nayib-jose-gloria thank you for fixing.

@nayib-jose-gloria nayib-jose-gloria merged commit dbcdd29 into main Oct 21, 2024
9 checks passed
@nayib-jose-gloria nayib-jose-gloria deleted the tsmith/multi-prefix--support branch October 21, 2024 18:28
This was referenced Oct 21, 2024
@github-actions github-actions bot mentioned this pull request Nov 14, 2024
joyceyan pushed a commit that referenced this pull request Nov 18, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>python-api: 1.3.0</summary>

##
[1.3.0](python-api-v1.2.0...python-api-v1.3.0)
(2024-11-14)


### Features

* query cross-ontology terms imported into a supported ontology
([#232](#232))
([2e1a834](2e1a834))
* update EFO to 3.71.0
([#242](#242))
([7a92c0f](7a92c0f))


### Misc

* add test to ensure all supported ontologies are supported by COG API
([#236](#236))
([56051f9](56051f9))
</details>

<details><summary>ontology-assets: 1.2.0</summary>

##
[1.2.0](ontology-assets-v1.1.0...ontology-assets-v1.2.0)
(2024-11-14)


### Features

* prototype to support multiple prefixes
([#225](#225))
([dbcdd29](dbcdd29))
* update EFO to 3.71.0
([#242](#242))
([7a92c0f](7a92c0f))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants