votes up 1

`group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'

Package:
scipy
github stars 8546
Exception Class:
ValueError

Raise code

    if group in ['I', 'O', 'T']:
        symbol = group
        order = 1
    elif group[:1] in ['C', 'D'] and group[1:].isdigit():
        symbol = group[:1]
        order = int(group[1:])
    else:
        raise ValueError("`group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'")

    if order < 1:
        raise ValueError("Group order must be positive")

    axis = 'xyz'.index(axis.lower())
    if symbol == 'I':
        return icosahedral(cls)
­čś▓ Agile task management is now easier than calling a taxi. #Tracklify
­čÖĆ Scream for help to Ukraine
Today, 2nd July 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this ­čśá, civilians and children are dying too! We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.

Ways to fix

votes up 2 votes down

The method scipy.spatial.transform.Rotation.create_group() is used to create  a 3D rotation group.

The valid value of the group parameters are:

'I', 'O', 'T', 'Dn', 'Cn', # here n is a postive intger.

These values stand for:

  • I: Icosahedral group
  • O: Octahedral group
  • T: Tetrahedral group
  • D: Dicyclic group
  • C: Cyclic group

Reproducing the error:

$ pipenv install scipy

$ pipenv shell

from scipy.spatial.transform import Rotation
rotation = Rotation.create_group('W',axis ="X")

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-11-0135faf3e4c9> in <module>()  1 from scipy.spatial.transform import Rotation ----> 2 rotation = Rotation.create_group('W',axis ="X") 
/usr/local/lib/python3.7/dist-packages/scipy/spatial/transform/rotation.py in create_group(cls, group, axis)  1653 on Wikipedia.  1654 """ -> 1655 return create_group(cls, group, axis=axis)  1656   1657 def __getitem__(self, indexer): 
/usr/local/lib/python3.7/dist-packages/scipy/spatial/transform/_rotation_groups.py in create_group(cls, group, axis)  121 order = int(group[1:])  122 else: --> 123 raise ValueError("`group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'")  124   125 if order < 1: 
ValueError: `group` must be one of 'I', 'O', 'T', 'Dn', 'Cn'

Fixed version of the code:

from scipy.spatial.transform import Rotation
rotation = Rotation.create_group('C3',axis ="X")
Sep 18, 2021 kellemnegasi answer
kellemnegasi 30.0k

Add a possible fix

Please authorize to post fix