Skip to content

Conversation

@nocollier
Copy link
Member

@nocollier nocollier commented Sep 25, 2025

This PR uses a facet search to build a sqlite3 database of CVs from projects we support. We then enable a free text search where the proper faceted search keywords are populated behind the scenes. This search:

cat.search("cesm2* gpp historical ssp585 mon r1i1p1f1 not_a_term")

will internally query the local CV database to generate these keywords:

{
    "experiment_id": ["historical", "ssp585"],
    "frequency": "mon",
    "member_id": "r1i1p1f1",
    "source_id": ["CESM2", "CESM2-WACCM", "CESM2-FV2", "CESM2-WACCM-FV2"],
    "variable_id": "gpp",
}

which are then passed into the search like normal. Terms are case insensitive and wildcards like * or % do work. Terms that are not found in the database are skipped.

  • basic functionality
  • documentation page
  • testing
  • messaging/logging for when the database is generated

@nocollier nocollier requested a review from mgrover1 as a code owner September 25, 2025 17:02
@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 23.25581% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.79%. Comparing base (8a706a4) to head (43f10f1).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
intake_esgf/cv.py 22.50% 31 Missing ⚠️
intake_esgf/catalog.py 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
- Coverage   79.83%   77.79%   -2.05%     
==========================================
  Files          12       13       +1     
  Lines        1488     1531      +43     
  Branches      226      230       +4     
==========================================
+ Hits         1188     1191       +3     
- Misses        232      270      +38     
- Partials       68       70       +2     
Flag Coverage Δ
unittests 77.72% <23.25%> (-2.05%) ⬇️

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.

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

-------

"""
cv_db = Path(intake_esgf.conf["cv_db"]).expanduser()
Copy link
Member Author

Choose a reason for hiding this comment

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

Make this a function argument so that this module does not depend on intake_esgf at all.

@nocollier
Copy link
Member Author

Closed in favor of #153

@nocollier nocollier closed this Nov 4, 2025
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