Skip to content

Adding BaseFetcher and StaticFetcher#1

Open
jauy123 wants to merge 74 commits into
fetcher_gsocfrom
Fetcher_Class
Open

Adding BaseFetcher and StaticFetcher#1
jauy123 wants to merge 74 commits into
fetcher_gsocfrom
Fetcher_Class

Conversation

@jauy123

@jauy123 jauy123 commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Fixes #

Changes made in this Pull Request:

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes / no

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in package/AUTHORS? (If it is not, add it!)
  • LLM/AI disclosure was updated.

Developers Certificate of Origin

I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.

Comment on lines -165 to -181
if not HAS_POOCH:
raise ModuleNotFoundError(
"pooch is needed as a dependency for from_PDB()"
)
elif file_format not in SUPPORTED_FILE_FORMATS_DOWNLOADER:
if file_format not in SUPPORTED_FILE_FORMATS_DOWNLOADER:
raise ValueError(
"Invalid file format. Supported file formats "
f"are {SUPPORTED_FILE_FORMATS_DOWNLOADER}"
)


if isinstance(pdb_ids, str):
_pdb_ids = (pdb_ids,)
else:
_pdb_ids = pdb_ids

if cache_path is None:
cache_path = pooch.os_cache(DEFAULT_CACHE_NAME_DOWNLOADER)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Handled by StaticFetcher

Comment thread package/MDAnalysis/fetch/fetchers.py Outdated
Comment on lines +149 to +161
match downloader:
case "HTTP":
fetch_downloader = pooch.HTTPDownloader(**download_kwargs)
case "FTP":
fetch_downloader = pooch.FTPDownloader(**download_kwargs)
case "SFTP":
fetch_downloader = pooch.SFTPDownloader(**download_kwargs)
case "DOI":
fetch_downloader = pooch.DOIDownloader(**download_kwargs)
case _:
raise ValueError(
f"Invalid downloader '{downloader}'. Valid options are 'HTTP', 'FTP', 'SFTP', 'DOI'."
)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

There should be a case where the user can pass their own custom downloader (like for authentication for a web server)

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.

5 participants