Skip to content

Pass configured CAMS credentials through provider assembly; separate missing optional packages from broken imports - #42

Open
SpectraWorksVision wants to merge 2 commits into
MarcYin:feat/refactorfrom
SpectraWorksOSS:feature/v2-provider-wiring
Open

SpectraWorksVision wants to merge 2 commits into
MarcYin:feat/refactorfrom
SpectraWorksOSS:feature/v2-provider-wiring

Conversation

@SpectraWorksVision

Copy link
Copy Markdown
Contributor

Fixes we needed to run v2 on our data. Includes unit tests

  1. CAMS credentials during provider assembly

When no auth object is passed in, _build_cams_provider and _resolve_bestpixel_anchor_atmo_source built the CAMSProvider with auth=None. A configured ADS key therefore never reached cdsapi, and CAMS downloads failed even though the key was set. Both now fall back to CredentialManager.from_config(config).

app/_assembly_providers.py, app/_assembly_surface.py
Test: tests/unit/test_cams_credentials.py

  1. Missing optional package vs. broken import

Several optional imports caught every ImportError and reported it as “package not installed”. When the package was installed but failed to import, for example a broken dependency inside earthaccess, the error said “install earthaccess”, which hides the real cause. Each site now only reports “not installed” when the ModuleNotFoundError is for that package itself. Any other import failure is raised as “installed but failed to import”, with the original error chained.

cdsapi (adapters/atmo/cams.py), earthaccess (adapters/data/earthaccess_source.py), pyhdf (adapters/earthdata_common.py), omnicloudmask (algorithms/cloud/providers/omnicloudmask.py), s3fs (algorithms/rt/lut/http_zip_store.py), and the shared optional-dependency loader in adapters/auth.py
Test: tests/unit/test_optional_import_errors.py

10 files, +202 / -12, most of it tests.

@MarcYin

MarcYin commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Thanks for this PR! A heads-up: I've moved further experimental code out of the v2 development branch, which meant rewriting the history of feat/refactor: commits from 2026-09-01 onward now have new IDs. The package code this change builds on is unchanged, but this branch still sits on the old history (ad2cdf2), so the PR now lists unrelated commits, and merging it as it is would bring the removed experimental code back.

Could you rebase it onto the current feat/refactor? Only your two commits need to move, and I've checked that it applies cleanly:

git remote add upstream https://github.com/MarcYin/SIAC.git   # if not already set
git fetch upstream feat/refactor
git rebase --onto upstream/feat/refactor ad2cdf2 feature/v2-provider-wiring
git push --force-with-lease origin feature/v2-provider-wiring

Sorry for the extra step, and thanks again!


Generated by Claude Code

@SpectraWorksVision
SpectraWorksVision force-pushed the feature/v2-provider-wiring branch from 89dc6fd to 457238d Compare October 14, 2026 21:37

This branch has not been deployed

No deployments
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