Skip to content

Commit

Permalink
Fix API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sitic committed May 7, 2024
1 parent 7510211 commit 75920e3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions optimap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
show_video,
show_video_pair,
show_videos,
show_video_overlay,
)
from .video import (
play as play_video,
Expand Down Expand Up @@ -81,6 +82,7 @@
"show_video",
"show_video_pair",
"show_videos",
"show_video_overlay",

"save_image",
"save_image_sequence",
Expand Down
1 change: 1 addition & 0 deletions optimap/image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"flip_up_down",
"crop",
"pad",
"normalize",
"collage",
"smooth_gaussian",

Expand Down
2 changes: 1 addition & 1 deletion optimap/video/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"show_videos",
"show_video",
"show_video_pair",
"show_video_overlay"
"show_video_overlay",

"rotate_left",
"rotate_right",
Expand Down
4 changes: 2 additions & 2 deletions optimap/video/_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def temporal_difference(array: np.ndarray, n: int, fill_value: float = 0, center
Value to fill the padded frames with, by default 0
center : bool, optional
If True, the padding is centered around the signal, by default False
Returns
-------
Expand All @@ -206,7 +206,7 @@ def temporal_difference(array: np.ndarray, n: int, fill_value: float = 0, center
"""
if not (np.issubdtype(array.dtype, np.floating) or np.issubdtype(array.dtype, np.complexfloating)):
array = array.astype(np.float32)

diff = array[n:] - array[:-n]
if center:
padding = ((n - n//2, n//2),)
Expand Down
3 changes: 2 additions & 1 deletion optimap/video/_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def play_with_overlay(*args, **kwargs):
def show_video(video, skip_frame=1, title="", vmin=None, vmax=None, cmap="gray", interval=10, **kwargs):
"""Simple video player based on matplotlib's animate function.
See :py:func:`optimap.video.play2` for a player for two videos side-by-side, and :py:func:`optimap.video.playn`
See :py:func:`optimap.video.show_video_pair` for a player for two videos side-by-side, and :py:func:`optimap.video.show_videos`
for a player for `n` videos side-by-side.
.. note::
Expand Down Expand Up @@ -151,6 +151,7 @@ def show_video_pair(
interval=interval,
**kwargs)


@interactive_backend
def show_videos(videos, skip_frame=1, titles=None, cmaps="gray", vmins=None, vmaxs=None, interval=10, **kwargs):
"""Video player for `n` side-by-side videos based on matplotlib's animate function.
Expand Down
4 changes: 2 additions & 2 deletions optimap/video/_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def save_image_sequence(directory: Union[str, Path],
video = np.random.rand(100, 100, 100)
om.save_image_sequence("my_folder", video, filepattern="frame_{:03d}", format=".png")
Will create a folder ``my_folder`` and save the images as ``my_folder/frame_000.png``, ``my_folder/frame_001.png``, etc.
Parameters
Expand Down Expand Up @@ -99,7 +99,7 @@ def save_tiff(filename, video, photometric="minisblack", **kwargs):
warnings.warn("The order of arguments for optimap.save_video() has changed. "
"Please use save_video(filename, video) instead of save_video(video, filename).",
DeprecationWarning)

filename = Path(filename)
if filename.suffix.lower() not in [".tif, .tiff"]:
filename = filename.with_suffix(".tiff")
Expand Down

0 comments on commit 75920e3

Please sign in to comment.