mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

Fixes #5170: Improve msd_type parsing

Open tanii1125 opened this issue 2 weeks ago • 1 comments

This PR implements enhancement proposed in issue #5170

Summary

EinsteinMSD currently lowercases the msd_type string but does not:

  • strip whitespace
  • validate the type
  • handle mixed-case safely

What This PR Does?

  1. Add .strip() before .lower() to handle inputs like " xy ".
  2. Add type validation (raise TypeError when msd_type is not a string).
  3. Add new tests to cover:
    • whitespace (" xy ")
    • uppercase/mixed case (" Xz ")
    • non-string inputs

All tests pass locally


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

tanii1125 avatar Dec 09 '25 15:12 tanii1125

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 92.72%. Comparing base (bbcef1b) to head (21bfdf8).

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Dec 09 '25 15:12 codecov[bot]