Skip to content

Commit 1b748ac

Browse files
authored
Merge pull request #143 from maxsch3/82-replace-mentions-of-struct_index-in-batch_shaperpy
replaced mentions of struct_index to multiindex_xy_keys
2 parents af656af + 67b0503 commit 1b748ac

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

keras_batchflow/base/batch_shapers/batch_shaper.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def _validate_multiindex_xy_keys(self, x_structure, y_structure, multiindex_xy_k
5252
if type(multiindex_xy_keys) is not tuple:
5353
raise ValueError('Error: srtuct_index parameter must be a tuple')
5454
if (len(multiindex_xy_keys) < 2) and y_structure:
55-
raise ValueError(f'Error: when y_structure is not None, struct_index must have two values. '
55+
raise ValueError(f'Error: when y_structure is not None, multiindex_xy_keys must have two values. '
5656
f'got {len(multiindex_xy_keys)}')
5757
if len(multiindex_xy_keys) > 2:
58-
raise ValueError(f'Error: struct_index must not be longer than 2. Got {len(multiindex_xy_keys)}')
58+
raise ValueError(f'Error: multiindex_xy_keys must not be longer than 2. Got {len(multiindex_xy_keys)}')
5959
if len(multiindex_xy_keys) != len(set(multiindex_xy_keys)):
6060
raise ValueError(f"Error: All elements of 'multiindex_xy_keys' parameter must be unique")
6161

@@ -186,9 +186,9 @@ def _get_data_xy(self, data):
186186
elif nlevels == 2:
187187
# define generator that will
188188
if not all([name in data for name in self.multiindex_xy_keys]):
189-
raise KeyError(f"Error: of the indices defined in struct_index parameter was not found in data. "
190-
f"Please check the parameter, input data or batch transforms, such as BatchFork, "
191-
f"'that might add the required indices. If you used BatchFork, please check that "
192-
f"its parameter 'levels' is aligned with parameter 'multiindex_xy_keys' of the "
193-
f"BatchShaper.")
189+
raise KeyError(f"Error: one or more index, defined in multiindex_xy_keys parameter, was not found "
190+
f"in the data. Please check the parameter, input data or batch transforms, such as "
191+
f"BatchFork, 'that might add the required indices. If you used BatchFork, "
192+
f"please check that its parameter 'levels' is aligned with parameter "
193+
f"'multiindex_xy_keys' of the BatchShaper.")
194194
return tuple([data[name] for name in self.multiindex_xy_keys])

0 commit comments

Comments
 (0)