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

Allow provider specific examples #1429

Merged
merged 17 commits into from
Mar 7, 2025
Merged

Conversation

nagutm
Copy link
Collaborator

@nagutm nagutm commented Feb 21, 2025

Closes #1417

It updates the web front-end to check if a provider-specific example is available and, if so, modifies the provider link in the Extra Providers sections to use the custom example ID instead of the default one.

As a test I added a custom example for bfvd which is a provider for uniprot and it correctly displays the link with the custom example and is able to resolve the ID appropriately.

image

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 46.86%. Comparing base (8950e70) to head (3274af6).
Report is 361 commits behind head on main.

Files with missing lines Patch % Lines
src/bioregistry/benchmarks/uri_parsing.py 0.00% 1 Missing ⚠️
src/bioregistry/curation/add_ontology_regexes.py 0.00% 1 Missing ⚠️
src/bioregistry/schema/struct.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1429      +/-   ##
==========================================
+ Coverage   42.51%   46.86%   +4.35%     
==========================================
  Files         117      120       +3     
  Lines        8327     8529     +202     
  Branches     1963     1415     -548     
==========================================
+ Hits         3540     3997     +457     
+ Misses       4582     4316     -266     
- Partials      205      216      +11     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@cthoyt cthoyt left a comment

Choose a reason for hiding this comment

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

@nagutm thanks for looking into this! One thing that's important for any new schema change proposals is to add a real curation to bioregistry.json that reflects usage of the new schema element.

Specifically for this one, we want to make sure we apply the regular expression pattern to validate the ID is valid. You can use the code that checks the primary example / example extras as reference

Speaking of example extras, there should be a nice way of aggregating any possible specific examples put in the providers into the example_extras field. The question is: should we require double curation there, or should we have the function that wraps it automatically grab and aggregate them? Check usages of .example_extras to see what might be more comfy

@nagutm
Copy link
Collaborator Author

nagutm commented Feb 28, 2025

Specifically for this one, we want to make sure we apply the regular expression pattern to validate the ID is valid. You can use the code that checks the primary example / example extras as reference

@cthoyt Could you clarify exactly what piece of code you are referring to here that checks the primary example/example extras?

@nagutm
Copy link
Collaborator Author

nagutm commented Feb 28, 2025

Speaking of example extras, there should be a nice way of aggregating any possible specific examples put in the providers into the example_extras field. The question is: should we require double curation there, or should we have the function that wraps it automatically grab and aggregate them? Check usages of .example_extras to see what might be more comfy

I added a method to the Resource class called get_aggregated_example_extras() which concatenates the manually curated example_extras along with any provider specific examples. I also updated any references to .example_extras with this method to ensure that provider-specific examples are included in any list of example_extras in the future.

@bgyori
Copy link
Contributor

bgyori commented Mar 2, 2025

Specifically for this one, we want to make sure we apply the regular expression pattern to validate the ID is valid. You can use the code that checks the primary example / example extras as reference

@cthoyt Could you clarify exactly what piece of code you are referring to here that checks the primary example/example extras?

There are tests that check whether example identifiers for a given entry conform to the identifier regular expression pattern definition. These tests should cover not only the default and extra examples but also the examples specific to providers so if an invalid example identifier is added, the test fails.

@nagutm
Copy link
Collaborator Author

nagutm commented Mar 3, 2025

I added a provider example for furna to run some of the tests implemented in this PR. The previous link: https://seq2fun.dcmb.med.umich.edu/furna/pdb.cgi?pdbid=2gc4 was not resolving the default pdb ID as expected.

Copy link
Member

@cthoyt cthoyt left a comment

Choose a reason for hiding this comment

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

besides the comments I left, this is ready to go. Thanks @nagutm

@cthoyt cthoyt merged commit 295c076 into biopragmatics:main Mar 7, 2025
14 checks passed
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.

Allow provider-specific example ID
3 participants