Skip to content

Commit

Permalink
Cell is 'ParticleCell', normalizer still calls atomic_cell.to_ase_atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernadette-Mohr committed Nov 22, 2024
1 parent da38c46 commit 4f1692a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
5 changes: 4 additions & 1 deletion src/nomad_simulations/schema_packages/model_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ class ParticleCell(Cell):
def __init__(self, m_def: 'Section' = None, m_context: 'Context' = None, **kwargs):
super().__init__(m_def, m_context, **kwargs)
# Set the name of the section
self.name = self.m_def.name
self.name = self.m_def.name #! self.name here is 'ParticleCell'

def is_equal_cell(self, other) -> bool:
"""
Expand Down Expand Up @@ -1146,6 +1146,7 @@ class ModelSystem(System):
)

cell = SubSection(sub_section=Cell.m_def, repeats=True)
print(f'cell: {Cell.m_def}')

symmetry = SubSection(sub_section=Symmetry.m_def, repeats=True)

Expand Down Expand Up @@ -1279,6 +1280,8 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
'Could not find the originally parsed atomic system. `Symmetry` and `ChemicalFormula` extraction is thus not run.'
)
return

#! self.cell[0].name is ParticleCell
if self.cell[0].name == 'AtomicCell':
self.cell[0].type = 'original'
ase_atoms = self.cell[0].to_ase_atoms(logger=logger)
Expand Down
24 changes: 0 additions & 24 deletions src/nomad_simulations/schema_packages/particles_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,30 +94,6 @@ class Particles:
Periodic boundary conditions flags. Examples: True,
False, 0, 1, (1, 1, 0), (True, False, False). Default
value: False.
Examples:
These three are equivalent:
>>> d = 1.104 # N2 bondlength
>>> a = Atoms('N2', [(0, 0, 0), (0, 0, d)])
>>> a = Atoms(numbers=[7, 7], positions=[(0, 0, 0), (0, 0, d)])
>>> a = Atoms([Atom('N', (0, 0, 0)), Atom('N', (0, 0, d))])
FCC gold:
>>> a = 4.05 # Gold lattice constant
>>> b = a / 2
>>> fcc = Atoms('Au',
... cell=[(0, b, b), (b, 0, b), (b, b, 0)],
... pbc=True)
Hydrogen wire:
>>> d = 0.9 # H-H distance
>>> h = Atoms('H', positions=[(0, 0, 0)],
... cell=(d, 0, 0),
... pbc=(1, 0, 0))
"""

def __init__(
Expand Down

0 comments on commit 4f1692a

Please sign in to comment.