Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrakenhoff committed Sep 7, 2023
1 parent 3b8bb0b commit 15f3bcb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pastastore/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,27 @@ def get_model_timeseries_names(
return structure

def apply(self, libname, func, names=None, progressbar=True):
"""Apply function to items in library.
Supported libraries are oseries, stresses, and models.
Parameters
----------
libname : str
library name, supports "oseries", "stresses" and "models"
func : callable
function that accepts items from one of the supported libraries as input
names : str, list of str, optional
apply function to these names, by default None which loops over all stored
items in library
progressbar : bool, optional
show progressbar, by default True
Returns
-------
list
list of results of func
"""
names = self.conn._parse_names(names, libname)
result = []
if libname not in ("oseries", "stresses", "models"):
Expand Down

0 comments on commit 15f3bcb

Please sign in to comment.