Skip to content

Initialize SpaceGroupType from spacegroup symbols #77

Description

@janosh

currently the recently added (2559486) can only be created from spacegroup numbers:

class SpaceGroupType:
"""Space-group type information."""
def __init__(self, number: int): ...
# Space group type
@property
def number(self) -> int:
"""ITA number for space group types (1 - 230)."""
@property
def hm_short(self) -> str:
"""Hermann-Mauguin symbol in short notation."""
@property
def hm_full(self) -> str:
"""Hermann-Mauguin symbol in full notation."""
# Arithmetic crystal class
@property

would be very useful to be able to pass strings in as well. happy to submit a PR if this sounds sensible

from moyopy import SpaceGroupType

# these throw TypeError: argument 'number': 'str' object cannot be interpreted as an integer
sgt1 = SpaceGroupType("Fm-3m")
sgt2 = SpaceGroupType("P6_3/m")
sgt3 = SpaceGroupType("Fmmm")

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions