From 412962278b60302a27d8fbc60b34ceba61f539cf Mon Sep 17 00:00:00 2001 From: Alvin Noe Ladines Date: Tue, 17 Sep 2024 12:02:47 +0200 Subject: [PATCH] Adapt binary header fix --- atomisticparsers/__init__.py | 8 ++------ atomisticparsers/gromacs/parser.py | 4 +++- atomisticparsers/lammps/parser.py | 4 +++- atomisticparsers/utils/mdanalysis.py | 5 ++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/atomisticparsers/__init__.py b/atomisticparsers/__init__.py index f2858f3..27328e5 100644 --- a/atomisticparsers/__init__.py +++ b/atomisticparsers/__init__.py @@ -40,11 +40,7 @@ class EntryPoint(ParserEntryPoint): def load(self): from nomad.parsing import MatchingParserInterface - return MatchingParserInterface( - **self.dict(), - mainfile_binary_header=self.mainfile_binary_header, - mainfile_binary_header_re=self.mainfile_binary_header_re, - ) + return MatchingParserInterface(**self.dict()) amber_parser_entry_point = EntryPoint( @@ -78,7 +74,7 @@ def load(self): python_package='atomisticparsers.asap', mainfile_binary_header_re=b'AFFormatASE\\-Trajectory', mainfile_mime_re='application/octet-stream', - mainfile_name_re=r'.*.traj$', # can this be specified here? to directly check for the emt calculator maybe? somehow we need to seperate the general ase/traj parser from the asap parser + mainfile_name_re=r'.*.traj$', # can this be specified here? to directly check for the emt calculator maybe? somehow we need to seperate the general ase/traj parser from the asap parser parser_class_name='atomisticparsers.asap.AsapParser', code_name='ASAP', code_homepage='https://wiki.fysik.dtu.dk/asap', diff --git a/atomisticparsers/gromacs/parser.py b/atomisticparsers/gromacs/parser.py index 6fa84a7..832c5c0 100644 --- a/atomisticparsers/gromacs/parser.py +++ b/atomisticparsers/gromacs/parser.py @@ -53,7 +53,9 @@ x_gromacs_section_input_output_files, ) from atomisticparsers.utils import MDAnalysisParser, MDParser -from simulationworkflowschema.molecular_dynamics import get_bond_list_from_model_contributions +from simulationworkflowschema.molecular_dynamics import ( + get_bond_list_from_model_contributions, +) re_float = r'[-+]?\d+\.*\d*(?:[Ee][-+]\d+)?' re_n = r'[\n\r]' diff --git a/atomisticparsers/lammps/parser.py b/atomisticparsers/lammps/parser.py index a200800..3d9b7fc 100644 --- a/atomisticparsers/lammps/parser.py +++ b/atomisticparsers/lammps/parser.py @@ -44,7 +44,9 @@ x_lammps_section_control_parameters, ) from atomisticparsers.utils import MDAnalysisParser, MDParser -from simulationworkflowschema.molecular_dynamics import get_bond_list_from_model_contributions +from simulationworkflowschema.molecular_dynamics import ( + get_bond_list_from_model_contributions, +) re_float = r'[-+]?\d+\.*\d*(?:[Ee][-+]\d+)?' diff --git a/atomisticparsers/utils/mdanalysis.py b/atomisticparsers/utils/mdanalysis.py index a85187a..278b9e6 100644 --- a/atomisticparsers/utils/mdanalysis.py +++ b/atomisticparsers/utils/mdanalysis.py @@ -35,7 +35,10 @@ from nomad.units import ureg from nomad.parsing.file_parser import FileParser -from simulationworkflowschema.molecular_dynamics import BeadGroup, shifted_correlation_average +from simulationworkflowschema.molecular_dynamics import ( + BeadGroup, + shifted_correlation_average, +) MOL = 6.022140857e23