Skip to content

Commit

Permalink
Merge branch 'main' into haesleinhuepf-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
haesleinhuepf authored Aug 29, 2024
2 parents c161759 + b13a5f2 commit 97159a9
Show file tree
Hide file tree
Showing 10 changed files with 348 additions and 9 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/comment-on-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
echo "Organization - ${{ github.repository_owner }}"
echo "Repository Name - ${{ github.repository }}"
- name: Print Job details
run: |
echo "Run ID - ${{ github.run_id }}"
echo "Job ID - ${{ github.job }}"
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -33,9 +38,11 @@ jobs:
- name: Run Python
env:
#ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"
GIT_BOB_LLM_NAME: "gpt-4o-2024-05-13"
ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"
GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}"
GIT_BOB_LLM_NAME: "${{ secrets.GIT_BOB_LLM_NAME }}"
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
GITHUB_API_KEY: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_RUN_ID: "${{ github.run_id }}"
run: |
git-bob comment-on-issue-action ${{ github.repository }} ${{ github.event.pull_request.number }} ${{ github.event.issue.number }}
11 changes: 9 additions & 2 deletions .github/workflows/review-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
echo "Organization - ${{ github.repository_owner }}"
echo "Repository Name - ${{ github.repository }}"
- name: Print Job details
run: |
echo "Run ID - ${{ github.run_id }}"
echo "Job ID - ${{ github.job }}"
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -32,10 +37,12 @@ jobs:
- name: Run Python
env:
#ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"
GIT_BOB_LLM_NAME: "gpt-4o-2024-05-13"
ANTHROPIC_API_KEY: "${{ secrets.ANTHROPIC_API_KEY }}"
GOOGLE_API_KEY: "${{ secrets.GOOGLE_API_KEY }}"
GIT_BOB_LLM_NAME: "${{ secrets.GIT_BOB_LLM_NAME }}"
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
GITHUB_API_KEY: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_RUN_ID: "${{ github.run_id }}"
run: |
git-bob review-pull-request-action ${{ github.repository }} ${{ github.event.pull_request.number }}
306 changes: 306 additions & 0 deletions docs/clusterplot.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="stackview",
version="0.8.0",
version="0.9.0",
author="Robert Haase",
author_email="robert.haase@uni-leipzig.de",
description="Interactive image stack viewing in jupyter notebooks",
Expand Down
2 changes: 1 addition & 1 deletion stackview/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.8.0"
__version__ = "0.9.0"

from ._static_view import jupyter_displayable_output, insight
from ._utilities import merge_rgb
Expand Down
10 changes: 10 additions & 0 deletions stackview/_animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def animate(timelapse, filename:str=None, overwrite_file:bool=True, frame_delay_
from stackview._image_widget import _img_to_rgb
from ._utilities import numpy_to_gif_bytestream, _gif_to_html

if isinstance(timelapse, list):
timelapse = np.asarray(timelapse)

if 0 <= timelapse.min() <= 1 and 0 <= timelapse.max() <= 1:
warnings.warn("The timelapse has a small intensity range between 0 and 1. Consider normalizing it to the range between 0 and 255.")
if timelapse.min() < 0 or timelapse.max() > 255:
Expand Down Expand Up @@ -115,6 +118,13 @@ def animate_curtain(timelapse, timelapse_curtain,
import numpy as np
from ._image_widget import _img_to_rgb


if isinstance(timelapse, list):
timelapse = np.asarray(timelapse)

if isinstance(timelapse_curtain, list):
timelapse_curtain = np.asarray(timelapse_curtain)

max_size = timelapse.shape[1]

images = []
Expand Down
5 changes: 4 additions & 1 deletion stackview/_clusterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def clusterplot(df, labels, column_x:str="x", column_y:str="y", column_selection
from ._scatterplot import scatterplot
import functools

labels = np.asarray(labels)

if column_selection in df.columns:
selection = df["selection"].tolist()

Expand Down Expand Up @@ -72,6 +74,7 @@ def update(selection, label_image, selected_image, widget):

return grid([[
image_display,
scatterplot
scatterplot,

]])

2 changes: 1 addition & 1 deletion stackview/_image_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _img_to_rgb(image,
display_max=None):
from ._colormaps import _labels_lut, create_colormap

if len(image.shape) > 2 and image.shape[-1] == 3:
if len(image.shape) > 2 and (image.shape[-1] == 3 or image.shape[-1] == 4):
return image

if image.dtype == bool:
Expand Down
4 changes: 3 additions & 1 deletion stackview/_scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def __init__(self, df, column_x, column_y, column_selection, figsize, selection_
manager = Gcf.get_active()
Gcf.figs.pop(manager.num, None)

self.selector = Selector(self.fig, self.ax, self.plotted_points, callback=self.set_selection)
self.selector = None
#self.selector = Selector(self.fig, self.ax, self.plotted_points, callback=self.set_selection)
self.update()

# show selection if defined
if column_selection in df.columns:
Expand Down
4 changes: 4 additions & 0 deletions stackview/_static_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def __array_finalize__(self, obj):
if obj is None: return
self.library_name = getattr(obj, 'library_name', None)
self.help_url = getattr(obj, 'help_url', None)
self.obj = obj

def __getitem__(self, index):
return self.obj.__getitem__(index)

def _repr_html_(self):
"""HTML representation of the image object for IPython.
Expand Down

0 comments on commit 97159a9

Please sign in to comment.