File tree Expand file tree Collapse file tree 5 files changed +14
-10
lines changed
src/nomad_simulation_parsers Expand file tree Collapse file tree 5 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 88from nomad .parsing .parser import MatchingParser
99from nomad .units import ureg
1010from nomad .utils import get_logger
11-
12- # from nomad_simulations.schema_packages.workflow import molecular_dynamics
1311from structlog .stdlib import BoundLogger
1412
1513from nomad_simulation_parsers .parsers .utils .mdparserutils import MDParser
1614from nomad_simulation_parsers .schema_packages import h5md
17- from nomad_simulation_parsers .schema_packages .h5md import MolecularDynamics , Simulation
1815
1916LOGGER = get_logger (__name__ )
2017
@@ -504,10 +501,10 @@ def write_to_archive(self) -> None:
504501 # TODO consider using a single parser for the whole archive
505502 # create metainfo parsers
506503 self .simulation_parser .annotation_key = h5md .HDF5_KEY
507- simulation_data = Simulation ()
504+ simulation_data = h5md . Simulation ()
508505 self .simulation_parser .data_object = simulation_data
509506 self .workflow_parser .annotation_key = h5md .HDF5_KEY
510- workflow_data = MolecularDynamics ()
507+ workflow_data = h5md . MolecularDynamics ()
511508 self .workflow_parser .data_object = workflow_data
512509
513510 # map from h5 source to metainfo target
Original file line number Diff line number Diff line change @@ -435,7 +435,7 @@ def __init__(self) -> None:
435435
436436 def init_quantities (self ) -> None :
437437 def str_op (val : str ) -> str | list [str ]:
438- val = val .split ('#' , 1 )[0 ]
438+ val = val .split ('#' , 1 )[0 ]
439439 val = re .sub (f'&{ RE_N } +' , ' ' , val )
440440 val = val .split ()
441441 val = val if len (val ) > 1 else val [0 ]
Original file line number Diff line number Diff line change @@ -553,7 +553,7 @@ def _create_custom_parser(
553553 else :
554554 # TODO: Assumes the extension is always a valid lammps dump format, improve
555555 # Fallback to file extension
556- file_type = traj_file .split ('.' , 1 )[- 1 ]
556+ file_type = traj_file .rsplit ('.' , 1 )[- 1 ]
557557
558558 # TODO: add support for other LAMMPS dump file formats (https://docs.lammps.org/dump.html)
559559 if file_type == 'dcd' or file_type == 'xyz' and data_file :
Original file line number Diff line number Diff line change @@ -266,6 +266,13 @@ class CustomProperty(physical_property.PhysicalProperty):
266266 )
267267 add_mapping_annotation (name , HDF5_KEY , '.name' )
268268
269+ contribution_type = Quantity (
270+ type = str ,
271+ description = """
272+ Type of contribution to the physical property.
273+ """ ,
274+ )
275+
269276 value = Quantity (
270277 type = np .dtype (np .float64 ),
271278 shape = [],
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ def assert_systems(archive: EntryArchive) -> None:
6161
6262 assert sec_systems [2 ].positions [80 ][1 ].to ('angstrom' ).magnitude == approx (28.748762 )
6363 assert sec_systems [2 ].velocities [50 ][2 ].to ('angstrom/ps' ).magnitude == approx (400.0 )
64- assert sec_systems [3 ].lattice_vectors [2 ][2 ].to (
65- 'angstrom'
66- ). magnitude == approx ( 68.22318 )
64+ assert sec_systems [3 ].lattice_vectors [2 ][2 ].to ('angstrom' ). magnitude == approx (
65+ 68.22318
66+ )
6767 assert sec_systems [3 ].periodic_boundary_conditions == [True , True , True ]
6868 assert sec_systems [0 ].bond_list [200 ][0 ] == 198
6969 assert sec_systems [0 ].dimensionality == 3
You can’t perform that action at this time.
0 commit comments