Skip to content

StaticFetcher() Implementation + from_pdb() refactor#5436

Open
jauy123 wants to merge 70 commits into
MDAnalysis:developfrom
jauy123:Fetcher_Class
Open

StaticFetcher() Implementation + from_pdb() refactor#5436
jauy123 wants to merge 70 commits into
MDAnalysis:developfrom
jauy123:Fetcher_Class

Conversation

@jauy123

@jauy123 jauy123 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #5429 and #5431

Changes made in this Pull Request:

  • Implements fetch.fetchers.StaticFetcher()
  • Refactors fetch.pdb.from_pdb() to use StaticFetchers()

LLM / AI generated code disclosure

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

Per AI policy, I'm declaring that I used in AI in primary two ways: IDE autocomplete and help with reviewing the docstring used for the documentation to make it look more professional.

The one notable exception is that I used AI to help me draft test_multiple_downloads_existing_database and test_existing_database in testsuite/MDAnalysisTests/fetch/test_static_fetcher.py

I prompt is "Is there a unique way to determine the hash in order if two files are exactly the same including modification time in python using the standard library"

It gave code that used os.stat(), so I googled it and found pathlib.Path.stat().st_mtime in the official [docs](https://docs.python.org/3/library/pathlib.html#pathlib.Path.stat) which I then used manually for test_existing_database and test_multiple_downloads_existing_database with no AI.

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.

@jauy123 jauy123 changed the title StaticFetcher() with from_pdb() refactor StaticFetcher() Implementation + from_pdb() refactor Jul 14, 2026
@orbeckst orbeckst added GSoC GSoC project fetcher labels Jul 15, 2026
@jauy123

jauy123 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Per AI policy, I'm declaring that I used in AI in primary two ways: IDE autocomplete and help with reviewing the docstring used for the documentation to make it look more professional.

The one notable exception is that I used AI to help me draft test_multiple_downloads_existing_database and test_existing_database in testsuite/MDAnalysisTests/fetch/test_static_fetcher.py

I prompt is "Is there a unique way to determine the hash in order if two files are exactly the same including modification time in python using the standard library"

It gave code that used os.stat(), so I googled it and found pathlib.Path.stat().st_mtime in the official docs which I then used manually for test_existing_database and test_multiple_downloads_existing_database with no AI.

@jauy123

jauy123 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

By the way, I don't know why tests are failing for this? The tests that are failing aren't from my code. It is stuff like MDAnalysisTests/coordinates/test_lammps.py::TestLAMMPSDATAWriter_molecule_tag which are failing which I didn't touch at all from my end.

I been running my tests (not the whole test suite) locally with pytest-cov on my end, and they aren't failing there.

@orbeckst

Copy link
Copy Markdown
Member

The failing tests are, as far as I can tell, #5382

@yuxuanzhuang

Copy link
Copy Markdown
Contributor

Looks like there's test failures related to the fetcher FAILED testsuite/MDAnalysisTests/fetch/test_static_fetcher.py::test_write_registry - ModuleNotFoundError: pooch is needed as a dependency for Fetchers. Could you try to fix it?

I will take a look at the other parts of the code today.

@jauy123

jauy123 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Looks like there's test failures related to the fetcher FAILED testsuite/MDAnalysisTests/fetch/test_static_fetcher.py::test_write_registry - ModuleNotFoundError: pooch is needed as a dependency for Fetchers. Could you try to fix it?

I will take a look at the other parts of the code today.

There shouldn't be. I added pooch as a proper dependency in #4943 in .github/actions/setup-deps/action.yaml, package/requirements.txt, and package/pyproject.toml. I can't even see that error on the github actions because of the preexisting error that @orbeckst mentioned

@jauy123

jauy123 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Otherwise, I feel like my code here is ready for review. One of the linters is angry about a superficial pass, but that is intentional in the design. At the current moment, StaticFetcher() is in its most completed state with all the features that seem to be needed, and from_pdb() is going to be the archetypical for the other from_ convenience functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fetcher GSoC GSoC project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GSoC 2026] Implementation of Static Fetcher

3 participants