Fix numpy>2.0 dependency and update fetchers
#98
Merged
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.
This pull request refactors the ChEBI fetcher module to use the ChEBI search API for all chemical entity queries, streamlines data models, and simplifies result processing throughout the codebase. It also updates dependencies and improves error handling in both ChEBI and PubChem fetchers. The most important changes are grouped below:
ChEBI API Refactor & Data Model Updates:
ChEBIStructure,ChEBIEntryData,ChEBIEntryResult,ChEBIApiResponse) with new models (ChebiSearchSource,ChebiSearchResult,ChebiSearchResponse) that directly match the ChEBI search API response format. All fetch and search methods now use these new models.get_entry_by_id,get_entries_batch,search_entries) to use the ChEBI search API endpoint and returnChebiSearchSourceobjects instead of the previous entry result models. Batch fetching now iterates over IDs and calls the search API for each. [1] [2] [3]process_search_result, mapping ChEBI search results directly toSmallMoleculeobjects, and updated all usages in fetch, batch, and search functions. [1] [2] [3] [4]Error Handling Improvements:
httpxexceptions for HTTP errors, aligning error handling with the ChEBI fetcher.httpx.HTTPStatusErrorfor invalid IDs instead of a genericValueError.Dependency Updates:
mdmodelsdependency version inpyproject.tomlfrom0.2.1to0.2.4.This change is