Skip to content

PDBList: move obsolete files across formats and assemblies - #5170

Open
LarytheLord wants to merge 5 commits into
biopython:masterfrom
LarytheLord:bugfix/pdblist-obsolete-format-3988
Open

LarytheLord wants to merge 5 commits into
biopython:masterfrom
LarytheLord:bugfix/pdblist-obsolete-format-3988

Conversation

@LarytheLord

Copy link
Copy Markdown

Summary

  • fix PDBList.update_pdb() obsolete-move logic to use real final filenames per format (pdb, mmCif, xml, mmtf, bundle) instead of pdb{code}.{file_format}
  • move assembly files for obsolete entries as well ({pdb}.pdb* and {pdb}-assembly*.cif)
  • fix update_pdb(with_assemblies=True) to call self.retrieve_assembly_file(...) (instead of pl.retrieve_assembly_file(...))
  • add regression tests for:
    • moving obsolete mmCIF + assembly files
    • moving obsolete mmtf files

Closes #3988.

Validation

  • python3 -m compileall Bio/PDB/PDBList.py Tests/test_PDB_PDBList.py

Note: running the full Tests/test_PDB_PDBList.py module locally in this environment requires Biopython compiled C extensions and the test harness setup; those are not available in this checkout.

@LarytheLord

Copy link
Copy Markdown
Author

CI note on the current AppVeyor failure:

  • The failing check is continuous-integration/appveyor/pr build 0.0.9830.
  • The failure is in test_PDB_vectors.VectorTests.test_coord_space (TypeError / ValueError in Bio.PDB.vectors.set_homog_trans_mtx).
  • This branch only changes Bio/PDB/PDBList.py and Tests/test_PDB_PDBList.py; it does not touch Bio/PDB/vectors.py.

I also checked AppVeyor project history and the latest master AppVeyor build (0.0.9823) is currently failed as well, which suggests this may be an existing/infra-side Windows lane issue rather than a regression from this PR.

Happy to rebase or adjust anything if maintainers want a specific follow-up on this branch.

@LarytheLord

Copy link
Copy Markdown
Author

Follow-up pushed to address the current AppVeyor failure on this PR.

AppVeyor traceback was in test_PDB_vectors.VectorTests.test_coord_space, failing in Bio.PDB.vectors with scalar-like NumPy values (TypeError/ValueError when assigning/using array-like scalars).

I added two small fixes in Bio/PDB/vectors.py:

  • normalize scalar-like inputs in set_homog_trans_mtx
  • normalize scalar-like angle_rads in homogeneous rotation helpers before math.sin/cos

Commits:

  • 5664d227d
  • f60b2c248

Validation from this environment:

  • python3 -m compileall Bio/PDB/vectors.py

I still can’t run full Biopython tests locally here because compiled C extensions are missing in this checkout; AppVeyor/CircleCI are the source of truth for this follow-up.

@peterjc

peterjc commented Feb 27, 2026

Copy link
Copy Markdown
Member

Are you making heavy use of AI tools here? Have you read our contributing file or the pull request template? Also please don't try to fix multiple unrelated issues on the same PR.

@LarytheLord

Copy link
Copy Markdown
Author

You are right, and thanks for the direct feedback.

I have now removed the unrelated Bio/PDB/vectors.py changes from this PR in commit 5cc34bc, so the branch is scoped again to the original PDBList + its tests only.

I’ve read your contributing guidance and will keep future PRs narrower and avoid bundling unrelated fixes.

@LarytheLord

Copy link
Copy Markdown
Author

Added one more in-scope test-only follow-up in b11bb263a.

What it covers:

  • update_pdb() obsolete-file move behavior for flat_tree=True with file_format="pdb"
  • verifies pdbXXXX.ent is moved from the flat root into the obsolete/ folder

No runtime behavior changes in this commit; it only strengthens coverage for the obsolete-move logic already in this PR.

@LarytheLord

Copy link
Copy Markdown
Author

Quick CI note on the AppVeyor failure:

  • The failing test is still test_PDB_vectors.VectorTests.test_coord_space in Bio.PDB.vectors.set_homog_trans_mtx.
  • That same failure also appears on recent master AppVeyor build 0.0.9823 (job njp6kqy0i5pjuwql), so this looks unrelated to the PDBList changes in this PR.

I kept this branch scoped to PDBList + tests only. If you prefer, I can leave it as-is and wait for the upstream AppVeyor issue to clear.

@peterjc

peterjc commented Mar 6, 2026

Copy link
Copy Markdown
Member

Your "Quick CI note on the AppVeyor failure" (and much of the other text) feels like an AI comment. I'd have hoped a keen new contributor would have taken the next logical step to check for and perhaps cite a known issue.

@LarytheLord

Copy link
Copy Markdown
Author

I dug into the AppVeyor failure (build 53630675) and it appears to be baseline/unrelated to this PR.

The failing test there is:

  • test_PDB_vectors.VectorTests.test_coord_space

I checked another newer PR build on master (build 9840) and it fails on the same test with the same traceback/signature.

Given that, this PR’s delta does not appear to be the source of the current AppVeyor red state.

@LarytheLord

Copy link
Copy Markdown
Author

You’re right, I should have cited the upstream tracking references explicitly.

For the AppVeyor failure (test_PDB_vectors.VectorTests.test_coord_space), the relevant ongoing thread is:

Related fix/discussion PRs already linked from that issue:

I’ll keep this PR focused on the PDBList obsolete-file move fix from #3988 and defer the vectors/AppVeyor lane to the existing #5135 track.

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.

Extend PDBList obsolete handling to mmCIF and mmtf formats as well as assemblies

2 participants