ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
396 stars 228 forks source link

Question: Inconsistencies between docs string and the documentations. #2405

Closed kfir4444 closed 1 year ago

kfir4444 commented 1 year ago

Topic

General area which your question is related to.

Context

I am trying to create the HinderedRotor object.

Question

Hey, In the documentations, towards the end of the paragraph, there is a bit of code the related to creating the HinderedRotor object:

rotors = [
    HinderedRotor(scanLog=Log('ethane_scan_1.log'), pivots=[1,5], top=[1,2,3,4], symmetry=3, fit='best'),
    #HinderedRotor(scanLog=ScanLog('C2H6_rotor_1.txt'), pivots=[1,5], top=[1,2,3,4], symmetry=3, fit='best'),
    #FreeRotor(pivots=[1,5], top=[1,2,3,4], symmetry=3),
]

However, in the documentations for the HinderedRotor class, it seems like the input should be different:

help(HinderedRotor)
>>> Help on class HinderedRotor in module rmgpy.statmech.torsion:

> class HinderedRotor(Torsion)
>  |  HinderedRotor(inertia=None, symmetry=1, barrier=None, fourier=None, rotationalConstant=None, quantum=True, semiclassical=True, frequency=None, energies=None)
>  |  
>  |  A statistical mechanical model of a one-dimensional hindered rotor.
>  |  The attributes are:
>  |  
>  |  ======================== ===================================================
>  |  Attribute                Description
>  |  ======================== ===================================================
>  |  `inertia`                The moment of inertia of the rotor
>  |  `rotationalConstant`     The rotational constant of the rotor
>  |  `symmetry`               The symmetry number of the rotor
>  |  `fourier`                The :math:`2 x N` array of Fourier series coefficients
>  |  `barrier`                The barrier height of the cosine potential
>  |  `quantum`                ``True`` to use the quantum mechanical model, ``False`` to use the classical model
>  |  `semiclassical`          ``True`` to use the semiclassical correction, ``False`` otherwise
>  |  ======================== ===================================================
>  |  
>  |  Note that the moment of inertia and the rotational constant are simply two
>  |  ways of representing the same quantity; only one of these can be specified
>  |  independently.

There is seemed to be an inconsistency between the two representations of the object. Is this intentional, or am I missing something? Thanks :)

Installation Information

Describe your installation method and system information if applicable.

mjohnson541 commented 1 year ago

RMG uses a different constructor when running the input file than it does in the raw code. I suspect this is the corresponding constructor: https://github.com/ReactionMechanismGenerator/RMG-Py/blob/1c1b9b052b53886e025264d8169103b2922ee623/arkane/statmech.py#L237.

kfir4444 commented 1 year ago

Thanks @mjohnson541, Should it not be hinderedRotor instead of HinderedRotor then?

mjohnson541 commented 1 year ago

It's related to how RMG defines functions when reading input files: https://github.com/ReactionMechanismGenerator/RMG-Py/blob/1c1b9b052b53886e025264d8169103b2922ee623/arkane/statmech.py#L354

kfir4444 commented 1 year ago

Ok, thanks @mjohnson541!