Skip to content

Commit 350a53f

Browse files
committed
Extend octopus parser
1 parent 3dbe3d3 commit 350a53f

File tree

3 files changed

+502
-18
lines changed

3 files changed

+502
-18
lines changed

src/nomad_simulation_parsers/parsers/octopus/file_parsers.py renamed to src/nomad_simulation_parsers/parsers/octopus/file_parser.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,18 +184,10 @@ def str_to_line(val_in: str) -> list[str]:
184184
)
185185
]
186186

187-
@property
188-
def mainfile(self):
189-
return super().mainfile
190-
191-
@mainfile.setter
192-
def mainfile(self, val):
193-
# TODO pylint complains when inheriting property
194-
# self._results = None
195-
# self._file_handler = None
196-
# self._mainfile = os.path.abspath(val) if val is not None else val
197-
super().mainfile = val
198-
super().__init__()
187+
def reset(self):
188+
super().reset()
189+
self._info = None
190+
self._keys_mapping = dict()
199191

200192
def evaluate_value(self, value: Any) -> Any:
201193
"""
@@ -357,10 +349,10 @@ def get_coordinates(self) -> tuple[str, np.ndarray]:
357349
val = self.info.get('Coordinates', self.info.get('ReducedCoordinates', [[]]))[0]
358350

359351
for v in val:
360-
if isinstance(v, str):
361-
symbols.append(v.strip())
362-
else:
352+
if v[0].isdecimal() or not isinstance(v, str):
363353
coordinates.append(v)
354+
else:
355+
symbols.append(v.strip())
364356

365357
coordinates = np.array(coordinates, dtype=float)
366358
coordinates.shape = (len(symbols), 3)

0 commit comments

Comments
 (0)