MDAnalysis / mdacli

Command line interface for MDAnalysis
https://mdacli.readthedocs.io/
GNU General Public License v3.0
19 stars 7 forks source link

Fix lowercase names #117

Closed hejamu closed 7 months ago

hejamu commented 7 months ago

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 commented 7 months ago

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.
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

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

PicoCentauri commented 7 months ago

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?

pep8speaks commented 7 months ago

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! :beers:

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