Skip to content

Commit 3d16162

Browse files
author
Max Jones
authored
Fix copybutton and sample dim name in docstring (#67)
1 parent 613a1cd commit 3d16162

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

doc/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ def setup(app):
7777
'issue': ('https://github.com/pangeo-data/xbatcher/issues/%s', 'GH')
7878
}
7979

80+
# sphinx-copybutton configurations (from https://github.com/pydata/xarray/blob/main/doc/conf.py)
81+
copybutton_prompt_text = (
82+
r'>>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: '
83+
)
84+
copybutton_prompt_is_regexp = True
85+
8086
autosummary_generate = True
8187
numpydoc_class_members_toctree = False
8288
numpydoc_show_class_members = False

xbatcher/generators.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,20 @@ class BatchGenerator:
8787
A dictionary specifying the size of the inputs in each dimension,
8888
e.g. ``{'lat': 30, 'lon': 30}``
8989
These are the dimensions the ML library will see. All other dimensions
90-
will be stacked into one dimension called ``batch``.
90+
will be stacked into one dimension called ``sample``.
9191
input_overlap : dict, optional
9292
A dictionary specifying the overlap along each dimension
9393
e.g. ``{'lat': 3, 'lon': 3}``
9494
batch_dims : dict, optional
9595
A dictionary specifying the size of the batch along each dimension
96-
e.g. ``{'time': 10}``. These will always be interated over.
96+
e.g. ``{'time': 10}``. These will always be iterated over.
9797
concat_input_dims : bool, optional
9898
If ``True``, the dimension chunks specified in ``input_dims`` will be
99-
concatenated and stacked into the batch dimension. If ``False``, they
100-
will be iterated over.
99+
concatenated and stacked into the ``sample`` dimension. The batch index
100+
will be included as a new level ``input_batch`` in the ``sample``
101+
coordinate.
102+
If ``False``, the dimension chunks specified in ``input_dims`` will be
103+
iterated over.
101104
preload_batch : bool, optional
102105
If ``True``, each batch will be loaded into memory before reshaping /
103106
processing, triggering any dask arrays to be computed.

0 commit comments

Comments
 (0)