Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .[dev] numpy==${{matrix.numpy-version}}.*
pip install -e .[dev,partners] numpy==${{matrix.numpy-version}}.*
- name: Pyright
if: matrix.run-expensive-tests # pyright is not expensive, but we only want to run it once due to otherwise inconsistent typing
run: |
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -e .[dev]
- run: pip install -e .[dev,partners]
- name: Generate developer docs
run: ./scripts/pdoc/run.sh
- run: cp README.md ./dist/README.md
Expand Down
109 changes: 8 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,108 +361,15 @@ There are different environment files available that only install tensorflow or

`bioimageio.spec` and `bioimageio.core` use [loguru](https://github.com/Delgan/loguru) for logging, hence the logging level
may be controlled with the `LOGURU_LEVEL` environment variable.
The `bioimageio` CLI has logging enabled by default.
To activate logging when using bioimageio.spec/bioimageio.core as a library, add

## Changelog

### 0.9.3

- bump bioimageio.spec library version to 0.5.5.5
- more robust test model reporting
- improved user input axis intepretation
- fixed conda subprocess calls

### 0.9.2

- fix model inference tolerance reporting

### 0.9.1

- fixes:
- CLI
- improved handling of summary argument to not create a path with brackets when given a list of paths.
- improved backward compatibility when runnig tests for models specifying an older bioimageio.core version in their environment.
This is relevant when using `runtime_env="as-described"`.
It works by simply trying option `--summary` (new option name) and `--summary-path` (outdated option name)

### 0.9.0

- update to [bioimageio.spec 0.5.4.3](https://github.com/bioimage-io/spec-bioimage-io/blob/main/changelog.md#bioimageiospec-0543)

### 0.8.0

- breaking: removed `decimals` argument from bioimageio CLI and `bioimageio.core.commands.test()`
- New feature: `bioimageio.core.test_description` accepts **runtime_env** and **run_command** to test a resource
using the conda environment described by that resource (or another specified conda env)
- new CLI command: `bioimageio add-weights` (and utility function: bioimageio.core.add_weights)
- removed `bioimageio.core.proc_ops.get_proc_class` in favor of `bioimageio.core.proc_ops.get_proc`
- new CLI command: `bioimageio update-format`
- new CLI command: `bioimageio update-hashes`

### 0.7.0

- breaking:
- bioimageio CLI now has implicit boolean flags
- non-breaking:
- use new `ValidationDetail.recommended_env` in `ValidationSummary`
- improve `get_io_sample_block_metas()`
- now works for sufficiently large, but not exactly shaped inputs
- update to support `zipfile.ZipFile` object with bioimageio.spec==0.5.3.5
- add io helpers `resolve` and `resolve_and_extract`
- added `enable_determinism` function and **determinism** input argument for testing with seeded
random generators and optionally (determinsim=="full") instructing DL frameworks to use
deterministic algorithms.

### 0.6.10

- fix #423

### 0.6.9

- improve bioimageio command line interface (details in #157)
- add `predict` command
- package command input `path` is now required

### 0.6.8
```python
from loguru import logger

- testing model inference will now check all weight formats
(previously only the first one for which model adapter creation succeeded had been checked)
- fix predict with blocking (Thanks @thodkatz)

### 0.6.7

- `predict()` argument `inputs` may be sample

### 0.6.6

- add aliases to match previous API more closely

### 0.6.5

- improve adapter error messages

### 0.6.4

- add `bioimageio validate-format` command
- improve error messages and display of command results

### 0.6.3

- Fix [#386](https://github.com/bioimage-io/core-bioimage-io-python/issues/386)
- (in model inference testing) stop assuming model inputs are tileable

### 0.6.2

- Fix [#384](https://github.com/bioimage-io/core-bioimage-io-python/issues/384)

### 0.6.1

- Fix [#378](https://github.com/bioimage-io/core-bioimage-io-python/pull/378) (with [#379](https://github.com/bioimage-io/core-bioimage-io-python/pull/379))*

### 0.6.0

- add compatibility with new bioimageio.spec 0.5 (0.5.2post1)
- improve interfaces
logger.enable("bioimageio")
```

### 0.5.10
## Changelog

- [Fix critical bug in predict with tiling](https://github.com/bioimage-io/core-bioimage-io-python/pull/359)
See [changelog.md](changelog.md)
109 changes: 109 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
### 0.9.4

- bump bioimageio.spec library version to 0.5.5.6
- Replace `conda activate <env name>` with `conda run -n <env name> python --version` when checking if a conda environment exists
(This is closer to the actual `conda run` command we need and avoids requests by conda to rerun `conda init` (in CI).)
- remove upper xarray pin (use ops from xarray.computation.ops, fallback to xarray.core.ops for older xarray versions)

### 0.9.3

- bump bioimageio.spec library version to 0.5.5.5
- more robust test model reporting
- improved user input axis intepretation
- fixed conda subprocess calls

### 0.9.2

- fix model inference tolerance reporting

### 0.9.1

- fixes:
- CLI
- improved handling of summary argument to not create a path with brackets when given a list of paths.
- improved backward compatibility when runnig tests for models specifying an older bioimageio.core version in their environment.
This is relevant when using `runtime_env="as-described"`.
It works by simply trying option `--summary` (new option name) and `--summary-path` (outdated option name)

### 0.9.0

- update to [bioimageio.spec 0.5.4.3](https://github.com/bioimage-io/spec-bioimage-io/blob/main/changelog.md#bioimageiospec-0543)

### 0.8.0

- breaking: removed `decimals` argument from bioimageio CLI and `bioimageio.core.commands.test()`
- New feature: `bioimageio.core.test_description` accepts **runtime_env** and **run_command** to test a resource
using the conda environment described by that resource (or another specified conda env)
- new CLI command: `bioimageio add-weights` (and utility function: bioimageio.core.add_weights)
- removed `bioimageio.core.proc_ops.get_proc_class` in favor of `bioimageio.core.proc_ops.get_proc`
- new CLI command: `bioimageio update-format`
- new CLI command: `bioimageio update-hashes`

### 0.7.0

- breaking:
- bioimageio CLI now has implicit boolean flags
- non-breaking:
- use new `ValidationDetail.recommended_env` in `ValidationSummary`
- improve `get_io_sample_block_metas()`
- now works for sufficiently large, but not exactly shaped inputs
- update to support `zipfile.ZipFile` object with bioimageio.spec==0.5.3.5
- add io helpers `resolve` and `resolve_and_extract`
- added `enable_determinism` function and **determinism** input argument for testing with seeded
random generators and optionally (determinsim=="full") instructing DL frameworks to use
deterministic algorithms.

### 0.6.10

- fix #423

### 0.6.9

- improve bioimageio command line interface (details in #157)
- add `predict` command
- package command input `path` is now required

### 0.6.8

- testing model inference will now check all weight formats
(previously only the first one for which model adapter creation succeeded had been checked)
- fix predict with blocking (Thanks @thodkatz)

### 0.6.7

- `predict()` argument `inputs` may be sample

### 0.6.6

- add aliases to match previous API more closely

### 0.6.5

- improve adapter error messages

### 0.6.4

- add `bioimageio validate-format` command
- improve error messages and display of command results

### 0.6.3

- Fix [#386](https://github.com/bioimage-io/core-bioimage-io-python/issues/386)
- (in model inference testing) stop assuming model inputs are tileable

### 0.6.2

- Fix [#384](https://github.com/bioimage-io/core-bioimage-io-python/issues/384)

### 0.6.1

- Fix [#378](https://github.com/bioimage-io/core-bioimage-io-python/pull/378) (with [#379](https://github.com/bioimage-io/core-bioimage-io-python/pull/379))*

### 0.6.0

- add compatibility with new bioimageio.spec 0.5 (0.5.2post1)
- improve interfaces

### 0.5.10

- [Fix critical bug in predict with tiling](https://github.com/bioimage-io/core-bioimage-io-python/pull/359)
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires-python = ">=3.9"
readme = "README.md"
dynamic = ["version"]
dependencies = [
"bioimageio.spec ==0.5.5.5",
"bioimageio.spec ==0.5.5.6",
"h5py",
"imagecodecs",
"imageio>=2.10",
Expand All @@ -18,7 +18,7 @@ dependencies = [
"scipy",
"tqdm",
"typing-extensions",
"xarray>=2023.01,<2025.3.0",
"xarray>=2023.01",
]
classifiers = [
"Development Status :: 3 - Alpha",
Expand All @@ -43,16 +43,19 @@ Source = "https://github.com/bioimage-io/core-bioimage-io-python"
onnx = ["onnxruntime"]
pytorch = ["torch>=1.6,<3", "torchvision>=0.21", "keras>=3.0,<4"]
tensorflow = ["tensorflow", "keras>=2.15,<4"]
dev = [
partners = [
# "biapy", # pins core exactly
"careamics",
"cellpose", # for model testing
# "stardist", # for model testing and stardist postprocessing # TODO: add updated stardist to partners env
]
dev = [
"cellpose", # for model testing
"crick",
"httpx",
"jupyter",
"keras>=3.0,<4",
"matplotlib",
"monai", # for model testing
"monai", # for model testing
"numpy",
"onnx",
"onnxruntime",
Expand All @@ -63,8 +66,7 @@ dev = [
"pytest-cov",
"pytest",
"python-dotenv",
"segment-anything", # for model testing
# "stardist", # for model testing and stardist postprocessing # TODO: add updated stardist to dev env
"segment-anything", # for model testing
"tensorflow",
"timm", # for model testing
"torch>=1.6,<3",
Expand Down
2 changes: 1 addition & 1 deletion src/bioimageio/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
# ruff: noqa: E402

__version__ = "0.9.3"
__version__ = "0.9.4"
from loguru import logger

logger.disable("bioimageio.core")
Expand Down
9 changes: 8 additions & 1 deletion src/bioimageio/core/_magic_tensor_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
from typing import Any, Callable

from typing_extensions import Self
from xarray.core import nputils, ops
from xarray.core import nputils

try:
# xarray >= 2025.03
from xarray.computation import ops
except ImportError:
# xarray < 2025.03
from xarray.core import ops # type: ignore


class MagicTensorOpsMixin:
Expand Down
16 changes: 13 additions & 3 deletions src/bioimageio/core/_resource_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,15 @@ def test_description(
else:
assert_never(runtime_env)

try:
run_command(["thiscommandshouldalwaysfail", "please"])
except Exception:
pass
else:
raise RuntimeError(
"given run_command does not raise an exception for a failing command"
)

td_kwargs: Dict[str, Any] = (
dict(ignore_cleanup_errors=True) if sys.version_info >= (3, 10) else {}
)
Expand Down Expand Up @@ -387,8 +396,8 @@ def _test_in_env(
raise RuntimeError("Conda not available") from e

try:
run_command([CONDA_CMD, "activate", env_name])
except Exception:
run_command([CONDA_CMD, "run", "-n", env_name, "python", "--version"])
except Exception as e:
working_dir.mkdir(parents=True, exist_ok=True)
path = working_dir / "env.yaml"
try:
Expand All @@ -405,7 +414,8 @@ def _test_in_env(
]
+ (["--quiet"] if settings.CI else [])
)
run_command([CONDA_CMD, "activate", env_name])
# double check that environment was created successfully
run_command([CONDA_CMD, "run", "-n", env_name, "python", "--version"])
except Exception as e:
summary = descr.validation_summary
summary.add_detail(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bioimageio_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def depends_on(dep: str) -> bool:

for skip_if_depends_on in (
"biapy",
"git+https://github.com/CAREamics/careamics.git",
"careamics",
"git+https://github.com/CAREamics/careamics.git", # TODO: include tests depending on careamics
"careamics", # TODO: include tests depending on careamics
"inferno",
"plantseg",
):
Expand Down
Loading