Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Feb 5, 2024
1 parent cad646a commit 9211672
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions ecml_tools/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ def _make_slice_or_index_from_list_or_tuple(indices):
return indices


def _tuple_with_slices(t):
"""
Replace all integers in a tuple with slices, so we preserve the dimensionality.
"""

result = tuple(slice(i, i + 1) if isinstance(i, int) else i for i in t)
changes = tuple(j for (j, i) in enumerate(t) if isinstance(i, int))

return result, changes


def _apply_tuple_changes(result, changes):
if changes:
shape = result.shape
for i in changes:
assert shape[i] == 1, shape
result = np.squeeze(result, axis=changes)
return result


class Dataset:
arguments = {}

Expand Down

0 comments on commit 9211672

Please sign in to comment.