Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lowercase names #117

Merged
merged 6 commits into from
Mar 21, 2024
Merged

Conversation

hejamu
Copy link
Collaborator

@hejamu hejamu commented Mar 21, 2024

The currently hardcoded lowercasing of the subparser name breaks very fast and workaround are ugly. One way around that would be adding aliases to the subparsers.

@hejamu
Copy link
Collaborator Author

hejamu commented Mar 21, 2024

This also looks good on the help screen:

hjaeger@eduroam-141-23-193-249 spce % mda -h     
This module was moved to MDAnalysis.analysis.hydrogenbonds.hbond_autocorrel; hbonds.hbond_autocorrel will be removed in 3.0.0.
usage: mda [-h] [--version] [--debug] [-nt NUM_THREADS] [--logfile LOGFILE]
           {AlignTraj,aligntraj,AverageStructure,averagestructure,DensityAnalysis,densityanalysis,DistanceMatrix,distancematrix,Dihedral,dihedral,Janin,janin,Ramachandran,ramachandran,DielectricConstant,dielectricconstant,GNMAnalysis,gnmanalysis,closeContactGNMAnalysis,closecontactgnmanalysis,HELANAL,helanal,HoleAnalysis,holeanalysis,LinearDensity,lineardensity,EinsteinMSD,einsteinmsd,MajorPairDist,majorpairdist,MinorPairDist,minorpairdist,NucPairDist,nucpairdist,WatsonCrickDist,watsoncrickdist,PCA,pca,InterRDF,interrdf,RMSD,rmsd,RMSF,rmsf}
           ...

A command line interface (CLI) to the analysis modules of MDAnalysis.

The modules are all structured as part of a single mdacli wrapper, and invoked
with commands like `mda RMSD`. This command uses the class
:class:`MDAnalysis.analysis.rms.RMSD` for calculating the RMSD.
Documentation for each module can be found at the respective sections on the
`MDAnalysis Documentation`_, as well as
`mda command -h`.

.. _`MDAnalysis Documentation`:
   https://docs.mdanalysis.org/stable/documentation_pages/analysis_modules.html

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --debug               Run with debug options.
  -nt NUM_THREADS       Total number of threads to start (0 is guess)
  --logfile LOGFILE     Logfile (optional)

MDAnalysis Analysis Modules:
  {AlignTraj,aligntraj,AverageStructure,averagestructure,DensityAnalysis,densityanalysis,DistanceMatrix,distancematrix,Dihedral,dihedral,Janin,janin,Ramachandran,ramachandran,DielectricConstant,dielectricconstant,GNMAnalysis,gnmanalysis,closeContactGNMAnalysis,closecontactgnmanalysis,HELANAL,helanal,HoleAnalysis,holeanalysis,LinearDensity,lineardensity,EinsteinMSD,einsteinmsd,MajorPairDist,majorpairdist,MinorPairDist,minorpairdist,NucPairDist,nucpairdist,WatsonCrickDist,watsoncrickdist,PCA,pca,InterRDF,interrdf,RMSD,rmsd,RMSF,rmsf}
    AlignTraj (aligntraj)
                        RMS-align trajectory to a reference structure using a selection.
    AverageStructure (averagestructure)
                        RMS-align trajectory to a reference structure using a selection,
    DensityAnalysis (densityanalysis)
                        Volumetric density analysis.
    DistanceMatrix (distancematrix)
                        Calculate the pairwise distance between each frame in a trajectory
    Dihedral (dihedral)
                        Calculate dihedral angles for specified atomgroups.
    Janin (janin)       Calculate :math:`\chi_1` and :math:`\chi_2` dihedral angles of selected
    Ramachandran (ramachandran)
                        Calculate :math:`\phi` and :math:`\psi` dihedral angles of selected
    DielectricConstant (dielectricconstant)
                        Computes the average dipole moment
    GNMAnalysis (gnmanalysis)
                        Basic tool for GNM analysis.
    closeContactGNMAnalysis (closecontactgnmanalysis)
                        GNMAnalysis only using close contacts.
    HELANAL (helanal)   Perform HELANAL helix analysis on your trajectory.
    HoleAnalysis (holeanalysis)
                        Run :program:`hole` on a trajectory.
    LinearDensity (lineardensity)
                        Linear density profile
    EinsteinMSD (einsteinmsd)
                        Class to calculate Mean Squared Displacement by the Einstein relation.
    MajorPairDist (majorpairdist)
                        Minor-Pair base pair distance for
    MinorPairDist (minorpairdist)
                        Minor-Pair basepair distance for selected residues over a trajectory.
    NucPairDist (nucpairdist)
                        Atom pair distance calculation base class.
    WatsonCrickDist (watsoncrickdist)
                        Watson-Crick base pair distance for selected
    PCA (pca)           Principal component analysis on an MD trajectory.
    InterRDF (interrdf)
                        Radial distribution function
    RMSD (rmsd)         Class to perform RMSD analysis on a trajectory.
    RMSF (rmsf)         Calculate RMSF of given atoms across a trajectory.

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.56%. Comparing base (6cf2772) to head (682c07c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
- Coverage   85.58%   85.56%   -0.03%     
==========================================
  Files           8        8              
  Lines         569      568       -1     
  Branches      119      119              
==========================================
- Hits          487      486       -1     
  Misses         67       67              
  Partials       15       15              

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

@PicoCentauri
Copy link
Collaborator

Cool, should we add in the help page that lowercase module names are also allowed? Basically adding something to the file docstring in src/mdacli/__main__.py?

@hejamu hejamu changed the title RFC: Fix lowercase names Fix lowercase names Mar 21, 2024
Copy link
Collaborator

@PicoCentauri PicoCentauri left a comment

Choose a reason for hiding this comment

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

Wonderful!

@pep8speaks
Copy link

pep8speaks commented Mar 21, 2024

Hello @hejamu! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-03-21 14:57:35 UTC

@PicoCentauri PicoCentauri merged commit bad8581 into MDAnalysis:main Mar 21, 2024
40 checks passed
PicoCentauri pushed a commit that referenced this pull request Mar 21, 2024
hejamu added a commit to hejamu/mdacli that referenced this pull request Mar 28, 2024
hejamu pushed a commit to hejamu/mdacli that referenced this pull request Mar 28, 2024
hejamu added a commit that referenced this pull request Mar 28, 2024
hejamu pushed a commit that referenced this pull request Mar 28, 2024
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.

3 participants