Skip to content

Run notebooks in CI #1013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

selmanozleyen
Copy link
Member

Closes #993

@selmanozleyen selmanozleyen marked this pull request as draft June 30, 2025 16:06
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.67%. Comparing base (d8b8f91) to head (77c7eca).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
+ Coverage   66.63%   66.67%   +0.03%     
==========================================
  Files          40       40              
  Lines        6060     6067       +7     
  Branches     1015     1015              
==========================================
+ Hits         4038     4045       +7     
  Misses       1662     1662              
  Partials      360      360              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@selmanozleyen selmanozleyen marked this pull request as ready for review June 30, 2025 23:09
@selmanozleyen
Copy link
Member Author

Hi,

I added all the notebooks except the tutorials as they required plenty of external modules. Only one notebook (squidpy/docs/notebooks/examples/image/compute_crops.ipynb) failed because of trying to use a deprecated function. So I created an issue for it: scverse/squidpy_notebooks#147

This is the error log

------------------
crop_corner.interactive(adata_crop)
------------------

----- stderr -----
/tmp/ipykernel_2900/2108321461.py:1: DeprecationWarning: Call to deprecated function interactive (The squidpy napari plugin is deprecated, please use https://github.com/scverse/napari-spatialdata).
  crop_corner.interactive(adata_crop)
------------------

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[8], line 1
----> 1 crop_corner.interactive(adata_crop)

File ~/work/squidpy/squidpy/src/squidpy/_utils.py:313, in deprecated.<locals>.decorator.<locals>.new_func1(*args, **kwargs)
    307 warnings.warn(
    308     fmt1.format(name=func1.__name__, reason=reason),
    309     category=DeprecationWarning,
    310     stacklevel=2,
    311 )
    312 warnings.simplefilter("default", DeprecationWarning)
--> 313 return func1(*args, **kwargs)

File ~/work/squidpy/squidpy/src/squidpy/im/_container.py:1136, in ImageContainer.interactive(self, adata, spatial_key, library_key, library_id, cmap, palette, blending, symbol, key_added)
   1079 @d.get_sections(base="_interactive", sections=["Parameters"])
   1080 @d.dedent
   1081 @deprecated(
   (...)   1094     key_added: str = "shapes",
   1095 ) -> Interactive:  # type: ignore[type-var]
   1096     """
   1097     Launch :mod:`napari` viewer.
   1098 
   (...)   1134     :meth:`squidpy.pl.Interactive.screenshot`.
   1135     """
-> 1136     from squidpy.pl import Interactive  # type: ignore[attr-defined]
   1138     return Interactive(  # type: ignore[no-any-return]
   1139         img=self,
   1140         adata=adata,
   (...)   1148         symbol=symbol,
   1149     ).show()

ImportError: cannot import name 'Interactive' from 'squidpy.pl' (/home/runner/work/squidpy/squidpy/src/squidpy/pl/__init__.py)

Failed to run /home/runner/work/squidpy/squidpy/docs/notebooks/examples/image/compute_crops.ipynb

@selmanozleyen selmanozleyen requested a review from timtreis July 1, 2025 08:41
@selmanozleyen selmanozleyen requested a review from ilan-gold July 10, 2025 16:44
@flying-sheep
Copy link
Member

flying-sheep commented Aug 7, 2025

@LucaMarconato wants to look into how to do this with caching, see also scverse/cookiecutter-scverse#40

PS: shell scripting is the devil, if you add shell scripts, also add CI that runs shellcheck on them and fails if shellcheck complains. Or just don’t use shell scripts, Python is a very nice scripting language that you already know much better 😉

@LucaMarconato
Copy link
Member

@selmanozleyen how long do they take to run? Around 15 minutes?

@selmanozleyen
Copy link
Member Author

@LucaMarconato yes they take around 15 for the selected notebooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run notebooks in CI
4 participants