Skip to content

Commit

Permalink
Merge branch 'master' into wt-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
ddkohler committed Feb 17, 2024
2 parents b797ef7 + ce85269 commit a4a0a45
Show file tree
Hide file tree
Showing 124 changed files with 264 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.1 # Replace by any tag/version: https://github.com/psf/black/tags
rev: 24.1.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+
Expand Down
18 changes: 13 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
requirements_file: requirements.txt
version: 2

build:
image: latest
os: ubuntu-22.04
tools:
python: "3.9"

python:
version: 3.8
pip_install: true
extra_requirements: [docs]
install:
- method: pip
path: .
extra_requirements:
- docs

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

formats:
- epub
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

## [Unreleased]

## [3.5.1]

### Added
- `kit.guess_signed` for empirically guessing channel sign (useful for automated workflows)
- `Data.squeeze`: squeezing the data object to the shape of the axes.

### Fixed
- `interact2D`: fixed bug where use_imshow broke the sliders
- `artists.stitch_to_animation`: use imageio v3 api and declare pillow plugin
- `data.join` ensures valid `method` is selected

### Changed
- `data.join` no longer supports `sum` method

## [3.5.0]

Expand Down Expand Up @@ -356,7 +367,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
### Added
- initial release

[Unreleased]: https://github.com/wright-group/WrightTools/-/compare/3.5.0...master
[Unreleased]: https://github.com/wright-group/WrightTools/-/compare/3.5.1...master
[3.5.1]: https://github.com/wright-group/WrightTools/compare/3.5.0...3.5.1
[3.5.0]: https://github.com/wright-group/WrightTools/compare/3.4.6...3.5.0
[3.4.6]: https://github.com/wright-group/WrightTools/compare/3.4.5...3.4.6
[3.4.5]: https://github.com/wright-group/WrightTools/compare/3.4.4...3.4.5
Expand Down
2 changes: 1 addition & 1 deletion WrightTools/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.0
3.5.1
1 change: 1 addition & 0 deletions WrightTools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""WrightTools init."""

# flake8: noqa


Expand Down
1 change: 0 additions & 1 deletion WrightTools/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define WrightTools version."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/__wt5_version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define wt5 version."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/_close.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Function to close all open wt5 files."""


# --- import -------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/_dataset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Dataset base class."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/_group.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Group base class."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/_open.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Generic open method for wt5 files."""


# --- import -------------------------------------------------------------------------------------


Expand Down
1 change: 1 addition & 0 deletions WrightTools/artists/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Artists."""

# flake8: noqa


Expand Down
1 change: 0 additions & 1 deletion WrightTools/artists/_base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Base tools for visualizing data."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/artists/_colors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Colormaps."""


# --- import --------------------------------------------------------------------------------------

import copy
Expand Down
24 changes: 11 additions & 13 deletions WrightTools/artists/_helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Functions to help with plotting."""


# --- import --------------------------------------------------------------------------------------


Expand All @@ -15,7 +14,7 @@
import matplotlib.patheffects as PathEffects
from mpl_toolkits.axes_grid1 import make_axes_locatable

import imageio
import imageio.v3 as iio
import warnings

from .. import exceptions as wt_exceptions
Expand Down Expand Up @@ -1082,14 +1081,14 @@ def subplots_adjust(fig=None, inches=1):
fig.subplots_adjust(top=top, right=right, bottom=bottom, left=left)


def stitch_to_animation(images, outpath=None, *, duration=0.5, palettesize=256, verbose=True):
def stitch_to_animation(paths, outpath=None, *, duration=0.5, palettesize=256, verbose=True):
"""Stitch a series of images into an animation.
Currently supports animated gifs, other formats coming as needed.
Parameters
----------
images : list of strings
paths : list of strings
Filepaths to the images to stitch together, in order of apperence.
outpath : string (optional)
Path of output, including extension. If None, bases output path on path
Expand All @@ -1098,22 +1097,21 @@ def stitch_to_animation(images, outpath=None, *, duration=0.5, palettesize=256,
Duration of (each) frame in seconds. Default is 0.5.
palettesize : int (optional)
The number of colors in the resulting animation. Input is rounded to
the nearest power of 2. Default is 1024.
the nearest power of 2. Default is 256.
verbose : bool (optional)
Toggle talkback. Default is True.
"""
# parse filename
if outpath is None:
outpath = os.path.splitext(images[0])[0] + ".gif"
outpath = os.path.splitext(paths[0])[0] + ".gif"
# write
t = wt_kit.Timer(verbose=False)
with t, imageio.get_writer(
outpath, mode="I", duration=duration, palettesize=palettesize
) as writer:
for p in images:
image = imageio.imread(p)
writer.append_data(image)
# finish
with t, iio.imopen(outpath, "w") as gif:
for p in paths:
frame = iio.imread(p)
gif.write(
frame, plugin="pillow", duration=duration * 1e3, loop=0, palettesize=palettesize
)
if verbose:
interval = np.round(t.interval, 2)
print("gif generated in {0} seconds - saved at {1}".format(interval, outpath))
Expand Down
1 change: 0 additions & 1 deletion WrightTools/artists/_quick.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Quick plotting."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/artists/_turbo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Define turbo colormap."""


# Copyright 2019 Google LLC.
# SPDX-License-Identifier: Apache-2.0

Expand Down
1 change: 1 addition & 0 deletions WrightTools/collection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection class and associated."""

# flake8: noqa


Expand Down
1 change: 0 additions & 1 deletion WrightTools/collection/_cary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Cary."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/collection/_collection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Collection."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/collection/_directory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Cary."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 1 addition & 0 deletions WrightTools/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Data class and associated."""

# flake8: noqa


Expand Down
1 change: 0 additions & 1 deletion WrightTools/data/_aramis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Aramis."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/data/_axis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Axis class and associated."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/data/_brunold.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Brunold."""


# --- import --------------------------------------------------------------------------------------


Expand Down
11 changes: 10 additions & 1 deletion WrightTools/data/_channel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Channel class and associated."""


# --- import --------------------------------------------------------------------------------------


Expand Down Expand Up @@ -225,3 +224,13 @@ def trim(self, neighborhood, method="ztest", factor=3, replace="nan", verbose=Tr
if verbose:
print("%i outliers removed" % len(outliers))
return outliers

def _to_dict(self):
out = {}
out["name"] = self.natural_name
out["values"] = self[:]
out["units"] = self.units
out["label"] = self.label
out["signed"] = self.signed
out.update(self.attrs)
return out
1 change: 0 additions & 1 deletion WrightTools/data/_colors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""COLORS."""


# --- import --------------------------------------------------------------------------------------


Expand Down
1 change: 0 additions & 1 deletion WrightTools/data/_constant.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Constant class and associated."""


# --- import --------------------------------------------------------------------------------------


Expand Down
Loading

0 comments on commit a4a0a45

Please sign in to comment.