Skip to content

Commit

Permalink
more review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudz committed Dec 14, 2023
1 parent b6a9aeb commit da9a36a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 286 deletions.
21 changes: 10 additions & 11 deletions atomisticparsers/h5md/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,17 @@ def atom_parameters(self):
@property
def system_info(self):
if self._system_info is None:
self._system_info = {'system': {}, 'calculation': {}}
particles_group = self.h5md_particle_group_all
positions_group = self.h5md_positions_group_all
positions_value = self.h5md_positions_value_all
if not particles_group:
return
self._system_info = {'system': {}, 'calculation': {}}
n_frames = self.n_frames
return self._system_info

n_frames = self.n_frames
if positions_value is None: # For now we require that positions are present in the H5MD file to store other particle attributes
self.logger.warning('No positions available in H5MD file. Other particle attributes will not be stored')
return
return self._system_info
self._system_info['system']['positions'] = positions_value
self._system_info['system']['n_atoms'] = self.n_atoms
# get the times and steps based on the positions
Expand Down Expand Up @@ -317,15 +317,14 @@ def system_info(self):
@property
def observable_info(self):
if self._observable_info is None:
observables_group = self.h5md_groups.get('observables')
if observables_group is None:
return

self._observable_info = {
'configurational': {},
'ensemble_average': {},
'correlation_function': {}
}
observables_group = self.h5md_groups.get('observables')
if observables_group is None:
return self._observable_info

def get_observable_paths(observable_group, current_path, paths):
for obs_key in observable_group.keys():
Expand Down Expand Up @@ -390,13 +389,13 @@ def is_valid_key_val(self, metainfo_class, key, val):
@property
def parameter_info(self):
if self._parameter_info is None:
parameters_group = self.h5md_groups.get('parameters')
if parameters_group is None:
return
self._parameter_info = {
'force_calculations': {},
'workflow': {}
}
parameters_group = self.h5md_groups.get('parameters')
if parameters_group is None:
return self._parameter_info

def get_parameters(parameter_group):
param_dict = {}
Expand Down
275 changes: 0 additions & 275 deletions atomisticparsers/h5md/parser_stripped.py

This file was deleted.

0 comments on commit da9a36a

Please sign in to comment.