Skip to content

Commit

Permalink
docs: add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jokasimr committed Oct 23, 2024
1 parent 4716e4d commit a70a7cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
supermirror
types
tools
workflow
```

## Amor
Expand Down
17 changes: 17 additions & 0 deletions src/ess/reflectometry/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ def _concatenate_lists(*x):
def with_filenames(
workflow, runtype: Hashable, runs: Sequence[Filename[RunType]]
) -> sciline.Pipeline:
'''Sets a number of :code:`Filename[runtype]` simultaneously.
The events from all listed files are concatenated in the workflow.
Arguments
----------
workflow:
the workflow to copy and add the filenames to
runtype:
the kind of runtype to add the files as.
Example: :code:`SampleRun` or :code:`ReferenceRun`.
runs:
the list of filenames to map over
Returns
---------
A copy of the original workflow mapping over the provided files.
'''
axis_name = f'{str(runtype).lower()}_runs'
df = pd.DataFrame({Filename[runtype]: runs}).rename_axis(axis_name)
wf = workflow.copy()
Expand Down

0 comments on commit a70a7cc

Please sign in to comment.