Skip to content

Commit

Permalink
Added docstring for Run.set_group().
Browse files Browse the repository at this point in the history
  • Loading branch information
zakv committed Nov 2, 2020
1 parent afd9d8f commit 029fdda
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lyse/__init__.py
Expand Up @@ -145,6 +145,18 @@ def _create_group_if_not_exists(self, h5_path, location, groupname):
h5_file[location].create_group(groupname)

def set_group(self, groupname):
"""Set the default hdf5 file group for saving results.
The `save...()` methods will save their results to `self.group` if an
explicit value for their optional `group` argument is not given. This
method updates `self.group`, making sure to create the group in the hdf5
file if it does not already exist.
Args:
groupname (str): The name of the hdf5 file group in which to save
results by default. The group will be created in the
`'/results'` group of the hdf5 file.
"""
self._create_group_if_not_exists(self.h5_path, '/results', groupname)
self.group = groupname

Expand Down

0 comments on commit 029fdda

Please sign in to comment.