fractal-task-tools 0.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fractal-task-tools might be problematic. Click here for more details.
- fractal_task_tools/__init__.py +5 -0
- fractal_task_tools/_args_schemas.py +214 -0
- fractal_task_tools/_cli.py +72 -0
- fractal_task_tools/_create_manifest.py +190 -0
- fractal_task_tools/_descriptions.py +236 -0
- fractal_task_tools/_package_name_tools.py +27 -0
- fractal_task_tools/_pydantic_generatejsonschema.py +81 -0
- fractal_task_tools/_signature_constraints.py +101 -0
- fractal_task_tools/_task_docs.py +109 -0
- fractal_task_tools/_titles.py +100 -0
- fractal_task_tools/task_models.py +94 -0
- fractal_task_tools-0.0.2.dist-info/LICENSE +29 -0
- fractal_task_tools-0.0.2.dist-info/METADATA +85 -0
- fractal_task_tools-0.0.2.dist-info/RECORD +17 -0
- fractal_task_tools-0.0.2.dist-info/WHEEL +5 -0
- fractal_task_tools-0.0.2.dist-info/entry_points.txt +2 -0
- fractal_task_tools-0.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class _BaseTask(BaseModel):
|
|
9
|
+
class Config:
|
|
10
|
+
arbitrary_types_allowed = True
|
|
11
|
+
extra = "forbid"
|
|
12
|
+
|
|
13
|
+
name: str
|
|
14
|
+
executable: str
|
|
15
|
+
meta: Optional[dict[str, Any]] = None
|
|
16
|
+
input_types: Optional[dict[str, bool]] = None
|
|
17
|
+
output_types: Optional[dict[str, bool]] = None
|
|
18
|
+
category: Optional[str] = None
|
|
19
|
+
modality: Optional[str] = None
|
|
20
|
+
tags: list[str] = Field(default_factory=list)
|
|
21
|
+
docs_info: Optional[str] = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class CompoundTask(_BaseTask):
|
|
25
|
+
"""
|
|
26
|
+
A `CompoundTask` object must include both `executable_init` and
|
|
27
|
+
`executable` attributes, and it may include the `meta_init` and `meta`
|
|
28
|
+
attributes.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
executable_init: str
|
|
32
|
+
meta_init: Optional[dict[str, Any]] = None
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def executable_non_parallel(self) -> str:
|
|
36
|
+
return self.executable_init
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def meta_non_parallel(self) -> Optional[dict[str, Any]]:
|
|
40
|
+
return self.meta_init
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def executable_parallel(self) -> str:
|
|
44
|
+
return self.executable
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def meta_parallel(self) -> Optional[dict[str, Any]]:
|
|
48
|
+
return self.meta
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class NonParallelTask(_BaseTask):
|
|
52
|
+
"""
|
|
53
|
+
A `NonParallelTask` object must include the `executable` attribute, and it
|
|
54
|
+
may include the `meta` attribute.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def executable_non_parallel(self) -> str:
|
|
59
|
+
return self.executable
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def meta_non_parallel(self) -> Optional[dict[str, Any]]:
|
|
63
|
+
return self.meta
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def executable_parallel(self) -> None:
|
|
67
|
+
return None
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def meta_parallel(self) -> None:
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class ParallelTask(_BaseTask):
|
|
75
|
+
"""
|
|
76
|
+
A `ParallelTask` object must include the `executable` attribute, and it may
|
|
77
|
+
include the `meta` attribute.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def executable_non_parallel(self) -> None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def meta_non_parallel(self) -> None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def executable_parallel(self) -> str:
|
|
90
|
+
return self.executable
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def meta_parallel(self) -> Optional[dict[str, Any]]:
|
|
94
|
+
return self.meta
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright 2024 (C) Friedrich Miescher Institute for Biomedical Research and University of Zurich
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: fractal-task-tools
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Shared tools for Fractal tasks
|
|
5
|
+
Author-email: Tommaso Comparin <tommaso.comparin@exact-lab.it>
|
|
6
|
+
License: BSD-3-Clause
|
|
7
|
+
Project-URL: homepage, https://github.com/fractal-analytics-platform/fractal-task-tools
|
|
8
|
+
Project-URL: repository, https://github.com/fractal-analytics-platform/fractal-task-tools
|
|
9
|
+
Project-URL: changelog, https://github.com/fractal-analytics-platform/fractal-task-tools/blob/main/CHANGELOG.md
|
|
10
|
+
Requires-Python: <3.13,>=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: pydantic<=2.8.2,>=2.0.0
|
|
14
|
+
Requires-Dist: docstring-parser==0.15
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: bumpver==2024.1130; extra == "dev"
|
|
17
|
+
Requires-Dist: devtools==0.12.2; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest<9.0.0,>=8.3.0; extra == "dev"
|
|
19
|
+
Requires-Dist: coverage<7.7.0,>=7.6.0; extra == "dev"
|
|
20
|
+
|
|
21
|
+
# Fractal task tools
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/fractal-task-tools/)
|
|
24
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
25
|
+
[](https://github.com/fractal-analytics-platform/fractal-task-tools/actions/workflows/ci_pip.yml)
|
|
26
|
+
[](https://htmlpreview.github.io/?https://github.com/fractal-analytics-platform/fractal-task-tools/blob/python-coverage-comment-action-data/htmlcov/index.html)
|
|
27
|
+
|
|
28
|
+
Fractal-task-tools provides some basic tools for building tasks for the [Fractal](https://fractal-analytics-platform.github.io/) framework.
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
[Fractal](https://fractal-analytics-platform.github.io/) is a framework developed at the [BioVisionCenter](https://www.biovisioncenter.uzh.ch/en.html) to process bioimaging data at scale in the OME-Zarr format and prepare the images for interactive visualization.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# Get started
|
|
36
|
+
```console
|
|
37
|
+
$ python -m venv venv
|
|
38
|
+
|
|
39
|
+
$ source venv/bin/activate
|
|
40
|
+
|
|
41
|
+
$ python -m pip install -e .
|
|
42
|
+
[...]
|
|
43
|
+
Successfully installed annotated-types-0.7.0 docstring-parser-0.15 fractal-task-tools-0.0.1 pydantic-2.8.2 pydantic-core-2.20.1 typing-extensions-4.12.2
|
|
44
|
+
|
|
45
|
+
$ fractal-manifest create --help
|
|
46
|
+
usage: fractal-manifest create [-h] --package PACKAGE [--task-list-path TASK_LIST_PATH]
|
|
47
|
+
|
|
48
|
+
Create new manifest file
|
|
49
|
+
|
|
50
|
+
options:
|
|
51
|
+
-h, --help show this help message and exit
|
|
52
|
+
--package PACKAGE Example: 'fractal_tasks_core'
|
|
53
|
+
--task-list-path TASK_LIST_PATH
|
|
54
|
+
Dot-separated path to the `task_list.py` module, relative to the package root (default value:
|
|
55
|
+
'dev.task_list').
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
# Development
|
|
60
|
+
|
|
61
|
+
```console
|
|
62
|
+
$ python -m venv venv
|
|
63
|
+
|
|
64
|
+
$ source venv/bin/activate
|
|
65
|
+
|
|
66
|
+
$ python -m pip install -e .[dev]
|
|
67
|
+
[...]
|
|
68
|
+
Successfully installed asttokens-2.4.1 bumpver-2024.1130 click-8.1.8 colorama-0.4.6 coverage-7.6.12 devtools-0.12.2 exceptiongroup-1.2.2 executing-2.2.0 fractal-task-tools-0.0.1 iniconfig-2.0.0 lexid-2021.1006 packaging-24.2 pluggy-1.5.0 pygments-2.19.1 pytest-8.3.5 six-1.17.0 toml-0.10.2 tomli-2.2.1
|
|
69
|
+
|
|
70
|
+
$ pre-commit install
|
|
71
|
+
pre-commit installed at .git/hooks/pre-commit
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## How to make a release
|
|
75
|
+
From the development environment:
|
|
76
|
+
```
|
|
77
|
+
bumpver update --patch --dry
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## Contributors and license
|
|
82
|
+
|
|
83
|
+
Fractal was conceived in the Liberali Lab at the Friedrich Miescher Institute for Biomedical Research and in the Pelkmans Lab at the University of Zurich by [@jluethi](https://github.com/jluethi) and [@gusqgm](https://github.com/gusqgm). The Fractal project is now developed at the [BioVisionCenter](https://www.biovisioncenter.uzh.ch/en.html) at the University of Zurich and the project lead is with [@jluethi](https://github.com/jluethi). The core development is done under contract by [eXact lab S.r.l.](https://www.exact-lab.it).
|
|
84
|
+
|
|
85
|
+
Unless otherwise specified, Fractal components are released under the BSD 3-Clause License, and copyright is with the BioVisionCenter at the University of Zurich.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
fractal_task_tools/__init__.py,sha256=MRGHqa12kl23-BtFENLSAtLR5nzimughL2HEce80xc0,79
|
|
2
|
+
fractal_task_tools/_args_schemas.py,sha256=Ka5IAAEdC7xg03ZHMl5jFbv4Sk8JR1QKbxFl7soevlQ,7829
|
|
3
|
+
fractal_task_tools/_cli.py,sha256=ikEwNVhzvr_X5PY5_s02lH7JvRcuHgjFs-hoIFQjXYo,1869
|
|
4
|
+
fractal_task_tools/_create_manifest.py,sha256=Ses8N5RliTtbvaHGJwTjuE2sGyBCoJUJtcyO7JPX23w,6147
|
|
5
|
+
fractal_task_tools/_descriptions.py,sha256=n7WcoIBQ4FEd16BI26iL-Sh6bEQ76jlU32JfJBF4U0A,7566
|
|
6
|
+
fractal_task_tools/_package_name_tools.py,sha256=_UT2cThh742V6M0XT9m0_aByhj5fXRSjATKt_MIXFVg,819
|
|
7
|
+
fractal_task_tools/_pydantic_generatejsonschema.py,sha256=qZuID7YUXOdAcL8OqsWjNFNumOIAgdJillc1lA2cHIY,3136
|
|
8
|
+
fractal_task_tools/_signature_constraints.py,sha256=1ixh8acxwY5_jRdyn7KfyRDDuwqQQ2R6Zf1xlElheWY,3216
|
|
9
|
+
fractal_task_tools/_task_docs.py,sha256=aEXozSKf3a7weOwJMHyTVJTvHlCKgDr1qoU-AAO3bZI,3401
|
|
10
|
+
fractal_task_tools/_titles.py,sha256=GLWn-06fgQD6qzOM75H59EV0MMCXc8jVpHqGanYzNbw,3000
|
|
11
|
+
fractal_task_tools/task_models.py,sha256=xTbdk3lf6T70o8idEWw-bdjA2dDz0KDIrBjdoh_A9Lc,2243
|
|
12
|
+
fractal_task_tools-0.0.2.dist-info/LICENSE,sha256=1SGAsQ3Jm_nIU7c2TgtTZe_IOKjm9BDsrcf2r98xrdk,1584
|
|
13
|
+
fractal_task_tools-0.0.2.dist-info/METADATA,sha256=07uk2zPoBCvv5Nv9Sb_k2jNsBw_2xYb-09XUwouo8Ps,4212
|
|
14
|
+
fractal_task_tools-0.0.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
15
|
+
fractal_task_tools-0.0.2.dist-info/entry_points.txt,sha256=zE4qv7QhuiqN6DaPkmJV18X1xyYoUi0HIJ-uAg2M6TU,66
|
|
16
|
+
fractal_task_tools-0.0.2.dist-info/top_level.txt,sha256=2VBpiMDIBMJGOEPiHHX3njYEZGLhr4L0nu8vfkcNVzw,19
|
|
17
|
+
fractal_task_tools-0.0.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fractal_task_tools
|