Skip to content

Commit

Permalink
Add check to see if dtype has a "shape" when checking object shapes (#…
Browse files Browse the repository at this point in the history
…124)

* only check shapes of shapey dtypes
* Bump version

---------

Co-authored-by: chris-langfield <[email protected]>
Co-authored-by: Miles Wells <[email protected]>
  • Loading branch information
3 people authored Jul 17, 2024
1 parent eb90285 commit c7961b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog
## [Latest](https://github.com/int-brain-lab/ONE/commits/main) [2.8.0]
## [Latest](https://github.com/int-brain-lab/ONE/commits/main) [2.8.1]

### Modified

- HOTFIX: fix error when sizing npz objects in alf.io.load_object

## [2.8.0]
This version of ONE adds support for loading .npz files.

### Modified
Expand Down
2 changes: 1 addition & 1 deletion one/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""The Open Neurophysiology Environment (ONE) API."""
__version__ = '2.8.0'
__version__ = '2.8.1'
5 changes: 4 additions & 1 deletion one/alf/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ def rename_columns(field):
# Expand timeseries if necessary
out[key] = ts2vec(out[key], n_samples)
if status != 0:
print_sizes = '\n'.join(f'{v.shape},\t{k}' for k, v in out.items())
supported = (np.ndarray, pd.DataFrame)
print_sizes = '\n'.join(
f'{v.shape},\t{k}' for k, v in out.items() if isinstance(v, supported)
)
_logger.warning(f'Inconsistent dimensions for object: {object} \n{print_sizes}')
return out

Expand Down

0 comments on commit c7961b4

Please sign in to comment.