Skip to content

Commit ac96702

Browse files
TorecLuikfolterj
andauthored
Dev bilayers (#4)
* Extend to read bilayers yaml * Add output types * Revert outputparam change, add zarr types to format * Extend outputs as outputs must contain these options * Extend format and sub_type format * Add docker type * Add value-choices to base model * Add output_dir_set for params * Add computed fields for requires_zarr and requires_plate * Add optional advanced mode and value choice labels * Add other input support * Add file attachment support * Add file_count for outputs * Update README * Github for version and pypi * Expand github actions to more tests and package * Some encoding for cli results * Change versioning of schema --------- Co-authored-by: Joost de Folter <folterj@gmail.com>
1 parent 529b67d commit ac96702

11 files changed

Lines changed: 976 additions & 58 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
deploy:
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: prefix-dev/setup-pixi@v0.8.0
23+
with:
24+
pixi-version: latest
25+
env:
26+
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.ref_name }}
27+
- name: Build package
28+
env:
29+
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.ref_name }}
30+
run: pixi run build-package
31+
- name: Generate JSON schema
32+
run: pixi run json-schema > biomero-schema.json
33+
- name: Upload schema to release
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
run: gh release upload ${{ github.ref_name }} biomero-schema.json --clobber
37+
- name: Publish package
38+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
39+
with:
40+
user: __token__
41+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: windows-latest
10+
env:
11+
PYTHONUTF8: "1"
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- uses: prefix-dev/setup-pixi@v0.8.0
17+
with:
18+
pixi-version: latest
19+
- run: pixi run test
20+
- run: pixi run test-validate
21+
- run: pixi run test-parse
22+
- run: pixi run test-pparse
23+
- run: pixi run test-jparse

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ cython_debug/
177177
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
178178
# and can be added to the global gitignore or merged into this file. For a more nuclear
179179
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
180-
#.idea/
180+
.idea/
181181

182182
# Ruff stuff:
183183
.ruff_cache/

README.md

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,23 @@ schema =
100100
{
101101
"name": "string", // Required. GitHub workflow repository name (without prefix). E.g. NucleiTracking-ImageJ
102102
"description": "string" // Required. Description of workflow.
103-
"schema-version": "string" // Required. Semver of schema version.
103+
"schema-version": "string" // Required. Schema format identifier. Use the current schema version constant, e.g. "biomero-0.1".
104104
"authors": // Optional. Authors list.
105105
[
106106
{
107107
"name": "string", // Required. Full name of author.
108-
"email": "optional", // Optional. Email address of author.
109-
"affiliations": "string[]" // Optional. List of affiliations matching "id" of an instituttion in instititions list.
108+
"email": "string", // Optional. Email address of author.
109+
"affiliations": "string[]" // Optional. List of affiliations matching "id" of an institution in institutions list.
110110
}
111111
],
112112
"institutions": // Optional. Institutions list.
113113
[
114114
{
115115
"id": "string", // Required. Unique institute identifier.
116-
"name": "string" // Optional. Name of the institions. Defaults to id.
116+
"name": "string" // Optional. Name of the institution. Defaults to id.
117117
}
118118
],
119-
"citations": // Optional. List of citations for the tool. Defaults to empty list.
119+
"citations": // Required. List of citations for the tool. At least one citation required.
120120
[
121121
{
122122
"name": "string", // Required. Name of the tool being cited.
@@ -127,16 +127,16 @@ schema =
127127
],
128128
// corresponding to: https://neubias-wg5.github.io/problem_class_ground_truth.html#steps-section
129129
"problem-class": // Optional. Biaflows problem class ("object-segmentation" | "pixel-classification" | "object-counting" | "object-detection" | "filament-tree-tracing" | "filament-networks-tracing" | "landmark-detection" | "particle-tracking" | "object-tracking").
130-
"container-image": // Required. Base cotnainer description.
130+
"container-image": // Required. Base container description.
131131
{
132132
"image": "string", // Required. Image to match the name of your workflow GitHub repository (lower case only). E.g. neubiaswg5/w_nucleitracking-imagej:1.0.0
133-
"type": "string", // Required. "oci" | "singularity" (lower case only).
133+
"type": "string", // Required. "oci" | "singularity" | "docker" (lower case only).
134134
"platforms": "string"[] // Optional. Build-time multi-platform targets.
135135
},
136136
"configuration": // Optional. Technical configuration.
137137
{
138138
"input_folder": "string", // Optional. Full path where the input folder must be mounted in the container. Defaults to "/inputs".
139-
"output_folder": "string", // Optional. Full path where teh output folder must be mounted in the container. Defaults to "/outputs".
139+
"output_folder": "string", // Optional. Full path where the output folder must be mounted in the container. Defaults to "/outputs".
140140
"resources": // Optional.
141141
{
142142
"networking": "boolean", // Optional. Whether internet connection is needed. Defaults to False.
@@ -158,14 +158,22 @@ schema =
158158
// references to "@id" get the value of "id" in lowercase
159159
// references to "@ID" get the value of "id" in uppercase
160160
"id": "string", // Required. Unique parameter identifier.
161-
"type": "string", // Required. Data type of the parameter (Number|String|ineger|flaot|boolean|string|file|image|array).
162-
"name": "string", // Optional. Human-readable display name appearing in BIAFLOWS UI (paramater dialog box). Defaults to "@id".
163-
"description": "string", // Optional. Description of paramater. Context help in BIAFLOWS UI (paramater dialog box). Soft Defaults to "".
161+
"type": "string", // Required. Data type of the parameter (Number|String|integer|float|boolean|string|file|image|array|measurement|executable).
162+
"name": "string", // Optional. Human-readable display name appearing in BIAFLOWS UI (parameter dialog box). Defaults to "@id".
163+
"description": "string", // Optional. Description of parameter. Context help in BIAFLOWS UI (parameter dialog box). Soft Defaults to "".
164164
"value-key": "string", // Optional. Substitution key in CLI. Defaults to "[@ID]".
165165
"command-line-flag": "string", // Optional. CLI flag. Defaults to "--@id".
166-
"default-value": "string|number|boolean", // Optional. Default value in BIAFLOWS UI (paramater dialog box). Soft Defaults to empty string.
166+
"default-value": "string|number|boolean", // Optional. Default value in BIAFLOWS UI (parameter dialog box). Soft Defaults to empty string.
167167
"optional": "boolean", // Optional. If true, parameter not required. Soft Defaults to False.
168168
"set-by-server": "boolean", // Optional. If true, parameter is server-assigned. Soft Defaults to False.
169+
"value-choices": "array", // Optional. List of allowed values for this parameter.
170+
"value-choices-labels": "string[]", // Optional. Display labels for value-choices, index-aligned. When null, value is used as label.
171+
"mode": "string", // Optional. UI display mode — "beginner" | "advanced". Advanced params are collapsed by default in the UI.
172+
"file-count": "string", // Optional. For file-type inputs: "single" | "multiple".
173+
"format": "string|string[]", // Optional. Type-specific. File extension(s) — see file/image/array sections below.
174+
"sub-type": "string|string[]", // Optional. Type-specific. Image sub-type(s) — see image section below.
175+
"output-dir-set": "boolean", // Optional. If true, this parameter specifies the output directory. Biomero will supply the data/out path.
176+
"file-attachment": "boolean", // Optional. If true, this is a user-supplied OMERO file-attachment input (annotation ID). Biomero will download the file from OMERO and transfer it to the HPC at runtime, then inject the resolved path as the CLI argument.
169177
}
170178
]
171179
"outputs": // Optional. List of output parameter descriptors.
@@ -174,32 +182,45 @@ schema =
174182
// references to "@id" get the value of "id" in lowercase
175183
// references to "@ID" get the value of "id" in uppercase
176184
"id": "string", // Required. Unique parameter identifier.
177-
"type": "string", // Required. Data type of the parameter (Number|String).
178-
"name": "string", // Optional. Human-readable display name appearing in BIAFLOWS UI (paramater dialog box). Defaults to "@id".
179-
"description": "string", // Optional. Description of paramater. Context help in BIAFLOWS UI (paramater dialog box). Soft Defaults to "".
185+
"type": "string", // Required. Data type of the parameter (Number|String|integer|float|boolean|string|file|image|array|measurement|executable).
186+
"name": "string", // Optional. Human-readable display name appearing in BIAFLOWS UI (parameter dialog box). Defaults to "@id".
187+
"description": "string", // Optional. Description of parameter. Context help in BIAFLOWS UI (parameter dialog box). Soft Defaults to "".
180188
"value-key": "string", // Optional. Substitution key in CLI. Defaults to "[@ID]".
181189
"command-line-flag": "string", // Optional. CLI flag. Defaults to "--@id".
182-
"default-value": "string|number|boolean", // Optional. Default value in BIAFLOWS UI (paramater dialog box). Soft Defaults to empty string.
190+
"default-value": "string|number|boolean", // Optional. Default value in BIAFLOWS UI (parameter dialog box). Soft Defaults to empty string.
183191
"optional": "boolean", // Optional. If true, parameter not required. Soft Defaults to False.
184192
"set-by-server": "boolean", // Optional. If true, parameter is server-assigned. Soft Defaults to False.
193+
"value-choices": "array", // Optional. List of allowed values for this parameter.
194+
"value-choices-labels": "string[]", // Optional. Display labels for value-choices, index-aligned. When null, value is used as label.
195+
"mode": "string", // Optional. UI display mode — "beginner" | "advanced". Advanced params are collapsed by default in the UI.
196+
"file-count": "string", // Optional. For file-type outputs: "single" | "multiple".
197+
"format": "string|string[]", // Optional. Type-specific. File extension(s) — see file/image/array sections below.
198+
"sub-type": "string|string[]", // Optional. Type-specific. Image sub-type(s) — see image section below.
185199
}
186200
]
187201
"command-line": "string" // Required. e.g. "python wrapper.py CYTOMINE_HOST CYTOMINE_PUBLIC_KEY CYTOMINE_PRIVATE_KEY CYTOMINE_ID_PROJECT CYTOMINE_ID_SOFTWARE IJ_RADIUS IJ_THRESHOLD".
188202
}
189203

190204
file =
191205
{
192-
"format": "string" // Required. Extension of the file type (.csv).
206+
"format": "string" // Optional. Extension of the file type (e.g. .csv).
193207
}
194208

195209
image =
196210
{
197-
"sub-type": "string", // Required. Image type (grayscale|color|binary|labeled|class).
198-
"format": "string" // Required. Extension of the image type (tif, png, jpg, jpeg, tiff, ometiff).
211+
"sub-type": "string|string[]", // Optional. Image type (grayscale|color|binary|labeled|class|plate). Can be a single value or list.
212+
"format": "string|string[]" // Optional. Extension of the image type (tif|png|jpg|jpeg|tiff|ometiff|zarr|omezarr|ome.zarr|ome-zarr). Can be a single value or list.
199213
}
200214

201215
array =
202216
{
203-
"format": "string" // Required. Extension of the file type (npy, npz)
217+
"format": "string" // Optional. Extension of the file type (npy, npz)
204218
}
205219
```
220+
221+
## Computed Fields
222+
223+
The following fields are automatically computed from the schema and included in the JSON output:
224+
225+
- **`requires-zarr`** (`boolean`): `true` when any image input uses a ZARR format (`zarr`, `omezarr`, `ome.zarr`, `ome-zarr`) or has `plate` sub-type.
226+
- **`requires-plate`** (`boolean`): `true` when any image input has `plate` sub-type.

0 commit comments

Comments
 (0)