-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from bioimage-io/change_0.3.2
Change 0.3.2
- Loading branch information
Showing
38 changed files
with
789 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from . import nodes | ||
from .utils import load_and_resolve_spec, load_model_spec, load_spec, maybe_convert_manifest, maybe_convert_model | ||
from . import v0_1, v0_3 | ||
from .latest import * | ||
|
||
__version__ = nodes.FormatVersion.__args__[-1] | ||
__version__ = FormatVersion.__args__[-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import typing | ||
|
||
from . import v0_1, v0_3 | ||
|
||
FormatVersion = typing.Literal[v0_1.FormatVersion, v0_3.FormatVersion] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
from marshmallow import ValidationError | ||
|
||
|
||
class PyBioException(Exception): | ||
pass | ||
|
||
|
||
class PyBioRunnerException(Exception): | ||
pass | ||
|
||
|
||
class PyBioValidationException(PyBioException, ValidationError): | ||
pass | ||
|
||
|
||
class PyBioUnconvertibleException(PyBioValidationException): | ||
class UnconvertibleError(ValidationError): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from bioimageio.spec.v0_3 import * # noqa | ||
from .build_spec import build_spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .common import yaml, BIOIMAGEIO_CACHE_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import pathlib | ||
|
||
from ruamel.yaml import YAML | ||
|
||
yaml = YAML(typ="safe") | ||
|
||
BIOIMAGEIO_CACHE_PATH = pathlib.Path(os.getenv("BIOIMAGEIO_CACHE_PATH", pathlib.Path.home() / "bioimageio_cache")) | ||
|
||
|
||
class Singleton(type): | ||
_instances = {} | ||
|
||
def __call__(cls, *args, **kwargs): | ||
if cls not in cls._instances: | ||
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) | ||
return cls._instances[cls] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""shared nodes that shared transformer act on""" | ||
|
||
from .raw_nodes import * | ||
|
||
|
||
@dataclass | ||
class ImportedSource: | ||
factory: callable | ||
|
||
def __call__(self, *args, **kwargs): | ||
return self.factory(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"""shared raw nodes that shared transformer act on""" | ||
|
||
from dataclasses import dataclass | ||
from pathlib import Path | ||
from typing import List | ||
|
||
from marshmallow import missing | ||
|
||
|
||
@dataclass | ||
class Node: | ||
pass | ||
|
||
|
||
@dataclass | ||
class URI(Node): | ||
"""URI as scheme:[//authority]path[?query][#fragment]""" | ||
|
||
scheme: str = missing | ||
authority: str = missing | ||
path: str = missing | ||
query: str = missing | ||
fragment: str = missing | ||
|
||
def __str__(self): | ||
"""scheme:[//authority]path[?query][#fragment]""" | ||
return ( | ||
(self.scheme + ":" if self.scheme else "") | ||
+ ("//" + self.authority if self.authority else "") | ||
+ self.path | ||
+ ("?" + self.query if self.query else "") | ||
+ ("#" + self.fragment if self.fragment else "") | ||
) | ||
|
||
|
||
@dataclass | ||
class ImportablePath(Node): | ||
filepath: Path = missing | ||
callable_name: str = missing | ||
|
||
|
||
@dataclass | ||
class ImportableModule(Node): | ||
module_name: str = missing | ||
callable_name: str = missing | ||
|
||
|
||
@dataclass | ||
class ImplicitInputShape(Node): | ||
min: List[float] = missing | ||
step: List[float] = missing | ||
|
||
def __len__(self): | ||
return len(self.min) | ||
|
||
|
||
@dataclass | ||
class ImplicitOutputShape(Node): | ||
reference_input: str = missing | ||
scale: List[float] = missing | ||
offset: List[int] = missing | ||
|
||
def __len__(self): | ||
return len(self.scale) |
Oops, something went wrong.