Skip to content

Conversation

@spyke7
Copy link
Contributor

@spyke7 spyke7 commented Nov 30, 2025

Fixes #5046

Changes made in this Pull Request:

  • Added a block for raising value error inside init in dssp.py
  • Checked the length of ag.residues, and just raised a simple value error message showing the minimum required residues

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!)

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.


📚 Documentation preview 📚: https://mdanalysis--5163.org.readthedocs.build/en/5163/

@spyke7
Copy link
Contributor Author

spyke7 commented Nov 30, 2025

@orbeckst @marinegor please check this, and do I need to add extra tests for this? and also codecov is failing, so I think it would be better if I add tests right?

and please tell me what to write in CHANGELOG, cause I'm confused about the format.... :-)

@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.72%. Comparing base (1e7644f) to head (d711d20).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5163      +/-   ##
===========================================
- Coverage    92.72%   92.72%   -0.01%     
===========================================
  Files          180      180              
  Lines        22472    22474       +2     
  Branches      3188     3189       +1     
===========================================
+ Hits         20838    20839       +1     
- Misses        1176     1177       +1     
  Partials       458      458              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Please add:

  1. Tests that trigger the error
  2. Tests that check that the system passes with 6 residues (and that it returns correct results)
  3. Update the docstring "Raises" section
  4. Update relevant docs to make it clear that at least 6 residues are necessary
  5. Update the changelog

@IAlibay
Copy link
Member

IAlibay commented Nov 30, 2025

and please tell me what to write in CHANGELOG, cause I'm confused about the format.... :-)

Please look at the instructions in the changelog (

The rules for this file:
* entries are sorted newest-first.
* summarize sets of changes - don't reproduce every git log comment here.
* don't ever delete anything.
* keep the format consistent (79 char width, M/D/Y date format) and do not
use tabs but use spaces for formatting
* accompany each entry with github issue/PR number (Issue #xyz)
* release numbers follow "Semantic Versioning" https://semver.org
), and try to add something. If something about the changelog is unclear, then ask us specifically about (edit: what is unclear).

@spyke7
Copy link
Contributor Author

spyke7 commented Nov 30, 2025

If something about the changelog is unclear, then ask us specifically about the.

ok

@spyke7 spyke7 requested a review from IAlibay November 30, 2025 20:23
@spyke7
Copy link
Contributor Author

spyke7 commented Dec 2, 2025

@IAlibay hi!
Please check it, and do I need to update any other things related to docs?

@spyke7
Copy link
Contributor Author

spyke7 commented Dec 4, 2025

Hi @marinegor @IAlibay if you are not busy, can you tell me any updates on this?

@IAlibay
Copy link
Member

IAlibay commented Dec 4, 2025

@spyke7 - I appreciate the ping. I won't get to this until the weekend at the very least. As per all core developers, we tend to not have time during the week days due to life priorities.

@spyke7
Copy link
Contributor Author

spyke7 commented Dec 4, 2025

@spyke7 - I appreciate the ping. I won't get to this until the weekend at the very least. As per all core developers, we tend to not have time during the week days due to life priorities.

Sure. No problem with that.

@orbeckst
Copy link
Member

@IAlibay I tentatively assigned you here, given that you've been reviewing already. If you don't have the bandwidth please unassign yourself.

@spyke7
Copy link
Contributor Author

spyke7 commented Dec 13, 2025

Hi @IAlibay
Any other changes or updates required?!

Copy link
Contributor Author

@spyke7 spyke7 left a comment

Choose a reason for hiding this comment

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

Yeah done

----------
atoms : Union[Universe, AtomGroup]
input Universe or AtomGroup. In both cases, only protein residues will
input at least 6 Universe or AtomGroup. In both cases, only protein residues will
Copy link
Member

Choose a reason for hiding this comment

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

This sentence is incorrect, please fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I need to remove at least 6 right?

Copy link
Member

Choose a reason for hiding this comment

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

You should mention "6 residues" somewhere, but this current sentence structure doesn't say that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

input Universe or AtomGroup with at least 6 protein residues. In both cases, only protein residues will
is this good?

Copy link
Member

Choose a reason for hiding this comment

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

I think so, I'll review when you push the commit.

resids = protein.residues.resids

with pytest.raises(ValueError, match="DSSP requires at least 6 residues"):
res2 = u.select_atoms(f"protein and resid {resids[0]}-{resids[1]}")
Copy link
Member

Choose a reason for hiding this comment

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

Please use atomgroup maniuplations here (and below) instead of calling "select_atoms".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please check it now.

@spyke7 spyke7 requested a review from IAlibay January 1, 2026 18:01
u = mda.Universe(TPR, XTC)

protein = u.select_atoms("protein")
resids = protein.residues.resids
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
resids = protein.residues.resids

No longer being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah removed now

@spyke7 spyke7 requested a review from IAlibay January 1, 2026 18:32
@IAlibay IAlibay merged commit 8ff4d09 into MDAnalysis:develop Jan 1, 2026
24 checks passed
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.

confusing error message from DSSP for too short peptide stretches

3 participants