Skip to content

Fixes MDAnalysis.analysis.density.convert_density() method has an invalid default unit value#4833

Merged
RMeli merged 5 commits intoMDAnalysis:developfrom
tanishy7777:issue_4829
Dec 14, 2024
Merged

Fixes MDAnalysis.analysis.density.convert_density() method has an invalid default unit value#4833
RMeli merged 5 commits intoMDAnalysis:developfrom
tanishy7777:issue_4829

Conversation

@tanishy7777
Copy link
Contributor

@tanishy7777 tanishy7777 commented Dec 13, 2024

Fixes #4829

Changes made in this Pull Request:

  • Changed the default unit in the convert_density() function to Angstrom^{-3} from Angstrom
  • Added new tests to check if the changes to the code(default unit) solve the issue in the testsuite/MDAnalysisTests/analysis/test_density.py

Before

def convert_density(self, unit='Angstrom'):

After

def convert_density(self, unit='Angstrom^{-3}'):

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Developers certificate of origin


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

@tanishy7777
Copy link
Contributor Author

Before the changes the test was failing as shown below

image
image
image

After making the changes

image

@codecov
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.63%. Comparing base (fa73478) to head (69a6d83).
Report is 46 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4833      +/-   ##
===========================================
- Coverage    93.65%   93.63%   -0.03%     
===========================================
  Files          177      189      +12     
  Lines        21763    22829    +1066     
  Branches      3065     3065              
===========================================
+ Hits         20382    21375     +993     
- Misses         929     1002      +73     
  Partials       452      452              

☔ 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

@RMeli RMeli left a comment

Choose a reason for hiding this comment

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

Thanks @tanishy7777, LGTM!

@RMeli
Copy link
Member

RMeli commented Dec 13, 2024

Conflicts needs to be resolved here too, otherwise it's good to go.

Co-authored-by: Rocco Meli <r.meli@bluemail.ch>
@RMeli RMeli merged commit c6bfa09 into MDAnalysis:develop Dec 14, 2024
amruthesht pushed a commit to amruthesht/mdanalysis that referenced this pull request Feb 19, 2025
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.

MDAnalysis.analysis.density.convert_density() method has an invalid default unit value

2 participants