Repository navigation
Conversation
Query the paginated v2 API and load each spectrum from its HSPY file, so all spectra load, including gas-phase ones (new `phase` argument). - Deprecate the `*_compare` arguments and string `resolution` values. - Ignore unsupported `order` keys with a warning. - Raise ValueError with the server's message for invalid arguments. - Allow overriding the API URL with EELSDB_API_URL. - Reuse one HTTP session and request only `max_n` records when small. - Update the gallery example, which sorted by spectrum type. Fixes hyperspy#189 Assisted-by: Claude Code:claude-opus-5-5
Author
|
pre-commit.ci run |
Author
|
CI for the docs build is failing because the v2 API isn't live yet. It should hopefully pass when the new API is up. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
Hi folks! PR to accompany #189
Also fixes / impacts hyperspy/hyperspy#994 and hyperspy/hyperspy#993
Warning
This is for v2 of the eelsdb.eu API, which is not yet live. I'm opening it as a draft to get feedback before we go live. You can test it locally by setting the environment var
EELSDB_API_URL:export EELSDB_API_URL=https://api.dev.eelsdb.eu/v2/spectraThis PR updates
exspy.data.eelsdbto work with the new v2 API. Each spectrum is now loaded from its HSPY file, so all spectra load, including gas-phase ones (newphaseargument).Specifically:
*_comparearguments and stringresolutionvalues.orderkeys with a warning.max_nrecords when small.Behaviour changes for existing scripts:
phase=["solid", "liquid"]would keep results as before.monochromated=Falsenow means "recorded as not monochromated".original_metadata.jsonholds the API v2 record, so scripts reading v1 fields from it will need updating.titlematches the whole phrase in titles and descriptions; v1 matched word by word.AI-assisted contribution?
- [ ] N/A (human-only contribution or trivial change)
- [ ] Proposal accepted: <link to PR in hyperspy/hyperspy-proposals>
AI-assisted (Claude Code). No proposal yet: it ports an existing function to the new API, but it does deprecate arguments, so happy to write one if you consider it non-trivial.
Progress of the PR
Assisted-by: <tool>:<model>in every commit and no AICo-authored-by:trailer,upcoming_changesfolder (seeupcoming_changes/README.rst),docs/readthedocs.org:exspybuild of this PR (link in github checks)Minimal example of the bug fix or the new feature
Until API v2 is live in production, point at the dev server by setting this before Python starts:
export EELSDB_API_URL=https://api.dev.eelsdb.eu/v2/spectra