Skip to content

Commit 3940159

Browse files
committed
Update documentation.
1 parent 63890d2 commit 3940159

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

docs/examples/workflow.ipynb

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"source": [
3737
"## TL;DR\n",
3838
"\n",
39-
"This cell shows how build a pipeline and use it to compute a ``TimeBinned`` histogram with file type of ``FileTypeMcStas``."
39+
"This cell shows how build a pipeline and use it to compute a ``TimeBinned`` histogram."
4040
]
4141
},
4242
{
@@ -47,20 +47,27 @@
4747
"source": [
4848
"import sciline as sl\n",
4949
"from ess.nmx.workflow import collect_default_parameters, providers\n",
50-
"from ess.nmx.loader import InputFileName, MaximumProbability, DefaultMaximumProbability\n",
50+
"from ess.nmx.loader import InputFileName, MaximumProbability, DefaultMaximumProbability, DefaultMcStasEventDataSchema, McStasEventDataSchema\n",
5151
"from ess.nmx.data import small_mcstas_sample\n",
5252
"from ess.nmx.reduction import TimeBinned, TimeBinStep, get_intervals_mcstas\n",
5353
"from ess.nmx.logging import get_logger as get_nmx_logger\n",
5454
"\n",
5555
"file_path = small_mcstas_sample() # Replace it with your data file path\n",
56-
"\n",
57-
"nmx_workflow = sl.Pipeline(list(providers)+[get_nmx_logger, get_intervals_mcstas],\n",
58-
" params={\n",
59-
" **collect_default_parameters(),\n",
60-
" MaximumProbability: DefaultMaximumProbability,\n",
61-
" TimeBinStep: TimeBinStep(1),\n",
62-
" InputFileName: InputFileName(file_path),\n",
63-
" })\n",
56+
"mcstas_proivders = [\n",
57+
" *providers,\n",
58+
" get_nmx_logger, # For logging.\n",
59+
" get_intervals_mcstas # Additional provider for McStas data handling.\n",
60+
"]\n",
61+
"mcstas_params = {\n",
62+
" **collect_default_parameters(),\n",
63+
" TimeBinStep: TimeBinStep(1),\n",
64+
" InputFileName: InputFileName(file_path),\n",
65+
" # Additional parameters for McStas data handling.\n",
66+
" McStasEventDataSchema: DefaultMcStasEventDataSchema,\n",
67+
" MaximumProbability: DefaultMaximumProbability,\n",
68+
" }\n",
69+
"\n",
70+
"nmx_workflow = sl.Pipeline(mcstas_proivders, params=mcstas_params)\n",
6471
"\n",
6572
"time_binned = nmx_workflow.compute(TimeBinned)\n",
6673
"time_binned"

0 commit comments

Comments
 (0)