Skip to content

Commit

Permalink
Merge branch 'master' into data-drop-method
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkohler committed Jan 26, 2024
2 parents a151998 + 880e054 commit 963e56c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/psf/black
rev: 23.7.0 # Replace by any tag/version: https://github.com/psf/black/tags
rev: 23.12.1 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
args: ["--line-length", "99"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: datasets|.data$
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
### Added
- `Data.squeeze`: squeezing the data object to the shape of the axes.

### Fixed
- `interact2D`: fixed bug where use_imshow broke the sliders

## [3.5.0]

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions WrightTools/artists/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _parse_plot_args(self, *args, **kwargs):
raise wt_exceptions.ValueError("Cannot squeeze axis to fit channel")
zi = data.channels[channel_index].points
if not zi.ndim == 2:
raise wt_exceptions.DimensionalityError(zi.ndim, data.ndim)
raise wt_exceptions.DimensionalityError(2, zi.ndim)
squeeze = tuple([0 if i else slice(None) for i in squeeze])
if plot_type == "imshow":
if "aspect" not in kwargs.keys():
Expand Down Expand Up @@ -646,7 +646,7 @@ def plot(self, *args, **kwargs):
zi = data.channels[channel_index].points
xi = xa[squeeze]
if not zi.ndim == 1:
raise wt_exceptions.DimensionalityError(1, data.ndim)
raise wt_exceptions.DimensionalityError(1, zi.ndim)
args = [xi, zi] + args
else:
data = None
Expand Down
4 changes: 2 additions & 2 deletions WrightTools/artists/_interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ def update_slider(info, use_imshow=use_imshow):
)
if use_imshow:
transpose = _order_for_imshow(
current_state[xaxis.natural_name][:],
current_state[yaxis.natural_name][:],
current_state.dat[xaxis.natural_name][:],
current_state.dat[yaxis.natural_name][:],
)
obj2D.set_data(current_state.dat[channel.natural_name][:].transpose(transpose))
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/artists/test_interact2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_4D():
data.create_variable("d_1", values=tau[None, None, None, :], units="ps")

data.transform("w_1", "w_2", "w_3", "d_1")
return wt.artists.interact2D(data, xaxis=0, yaxis=1, local=True)
return wt.artists.interact2D(data, xaxis=0, yaxis=1, local=True, use_imshow=True)


if __name__ == "__main__":
Expand Down

0 comments on commit 963e56c

Please sign in to comment.