ome-arrow 0.0.3__tar.gz → 0.0.4__tar.gz
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.
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/workflows/publish-docs.yml +1 -1
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/workflows/publish-pypi.yml +1 -1
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/workflows/run-tests.yml +2 -2
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.pre-commit-config.yaml +2 -2
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/CITATION.cff +69 -0
- {ome_arrow-0.0.3/src/ome_arrow.egg-info → ome_arrow-0.0.4}/PKG-INFO +18 -9
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/README.md +10 -2
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/examples/learning_to_fly_with_ome-arrow.ipynb +57 -10
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/examples/learning_to_fly_with_ome-arrow.py +15 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/pyproject.toml +6 -2
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/_version.py +3 -3
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/core.py +11 -4
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/ingest.py +16 -42
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/view.py +29 -5
- {ome_arrow-0.0.3 → ome_arrow-0.0.4/src/ome_arrow.egg-info}/PKG-INFO +18 -9
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow.egg-info/SOURCES.txt +2 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow.egg-info/requires.txt +4 -2
- ome_arrow-0.0.4/tests/data/JUMP-BR00117006/BR00117006.ome.parquet +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/test_core.py +59 -1
- ome_arrow-0.0.4/tests/test_view.py +20 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/uv.lock +16 -9
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/ISSUE_TEMPLATE/issue.yml +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/dependabot.yml +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/release-drafter.yml +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.github/workflows/draft-release.yml +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.gitignore +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/.python-version +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/CODE_OF_CONDUCT.md +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/CONTRIBUTING.md +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/LICENSE +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/_static/logo.png +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/_static/references_to_files.png +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/_static/various_ome_arrow_schema.png +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/conf.py +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/index.md +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/docs/src/python-api.md +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/setup.cfg +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/__init__.py +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/export.py +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/meta.py +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/transform.py +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow/utils.py +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow.egg-info/dependency_links.txt +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/src/ome_arrow.egg-info/top_level.txt +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/conftest.py +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/examplehuman/AS_09125_050116030001_D03f00d0.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/examplehuman/AS_09125_050116030001_D03f00d1.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/examplehuman/AS_09125_050116030001_D03f00d2.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS000.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS001.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS002.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS003.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS004.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS005.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS006.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS007.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS008.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS009.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS010.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS011.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS012.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS013.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS014.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS015.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS016.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS017.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS018.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS019.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS020.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C111_ZS021.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS000.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS001.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS002.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS003.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS004.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS005.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS006.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS007.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS008.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS009.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS010.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS011.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS012.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS013.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS014.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS015.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS016.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS017.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS018.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS019.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS020.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/nviz-artificial-4d-dataset/E99_C222_ZS021.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/4D-series.ome.tiff +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/multi-channel-4D-series.ome.tiff +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/multi-channel-time-series.ome.tiff +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/multi-channel-z-series.ome.tiff +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/multi-channel.ome.tiff +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/single-channel.ome.tiff +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/time-series.ome.tif +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/data/ome-artificial-5d-datasets/z-series.ome.tiff +0 -0
- {ome_arrow-0.0.3 → ome_arrow-0.0.4}/tests/test_utils.py +0 -0
|
@@ -13,7 +13,7 @@ jobs:
|
|
|
13
13
|
runs-on: ubuntu-24.04
|
|
14
14
|
steps:
|
|
15
15
|
# checks out the repo
|
|
16
|
-
- uses: actions/checkout@
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
17
|
# run pre-commit
|
|
18
18
|
- name: Python setup
|
|
19
19
|
uses: actions/setup-python@v6
|
|
@@ -35,7 +35,7 @@ jobs:
|
|
|
35
35
|
OS: ${{ matrix.os }}
|
|
36
36
|
steps:
|
|
37
37
|
- name: Checkout
|
|
38
|
-
uses: actions/checkout@
|
|
38
|
+
uses: actions/checkout@v6
|
|
39
39
|
- name: Python setup
|
|
40
40
|
uses: actions/setup-python@v6
|
|
41
41
|
with:
|
|
@@ -39,12 +39,12 @@ repos:
|
|
|
39
39
|
- id: yamllint
|
|
40
40
|
exclude: pre-commit-config.yaml
|
|
41
41
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
42
|
-
rev: "v0.14.
|
|
42
|
+
rev: "v0.14.7"
|
|
43
43
|
hooks:
|
|
44
44
|
- id: ruff-format
|
|
45
45
|
- id: ruff-check
|
|
46
46
|
- repo: https://github.com/rhysd/actionlint
|
|
47
|
-
rev: v1.7.
|
|
47
|
+
rev: v1.7.9
|
|
48
48
|
hooks:
|
|
49
49
|
- id: actionlint
|
|
50
50
|
- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
|
|
@@ -29,6 +29,10 @@ abstract: >-
|
|
|
29
29
|
keywords:
|
|
30
30
|
- python
|
|
31
31
|
license: BSD-3-Clause
|
|
32
|
+
identifiers:
|
|
33
|
+
- description: Zenodo software DOI
|
|
34
|
+
type: doi
|
|
35
|
+
value: 10.5281/zenodo.17664969
|
|
32
36
|
references:
|
|
33
37
|
- authors:
|
|
34
38
|
- name: "ExampleHuman CellProfiler Data Team"
|
|
@@ -60,3 +64,68 @@ references:
|
|
|
60
64
|
- description: "OME Model Documentation — OME-TIFF Sample Data"
|
|
61
65
|
type: url
|
|
62
66
|
value: "https://ome-model.readthedocs.io/en/stable/ome-tiff/data.html"
|
|
67
|
+
- authors:
|
|
68
|
+
- family-names: Chandrasekaran
|
|
69
|
+
given-names: Srinivas Niranj
|
|
70
|
+
- family-names: Cimini
|
|
71
|
+
given-names: Beth A.
|
|
72
|
+
- family-names: Goodale
|
|
73
|
+
given-names: Amy
|
|
74
|
+
- family-names: Miller
|
|
75
|
+
given-names: Lisa
|
|
76
|
+
- family-names: Kost-Alimova
|
|
77
|
+
given-names: Maria
|
|
78
|
+
- family-names: Jamali
|
|
79
|
+
given-names: Nasim
|
|
80
|
+
- family-names: Doench
|
|
81
|
+
given-names: John G.
|
|
82
|
+
- family-names: Fritchman
|
|
83
|
+
given-names: Briana
|
|
84
|
+
- family-names: Skepner
|
|
85
|
+
given-names: Adam
|
|
86
|
+
- family-names: Melanson
|
|
87
|
+
given-names: Michelle
|
|
88
|
+
- family-names: Kalinin
|
|
89
|
+
given-names: Alexandr A.
|
|
90
|
+
- family-names: Arevalo
|
|
91
|
+
given-names: John
|
|
92
|
+
- family-names: Haghighi
|
|
93
|
+
given-names: Marzieh
|
|
94
|
+
- family-names: Caicedo
|
|
95
|
+
given-names: Juan C.
|
|
96
|
+
- family-names: Kuhn
|
|
97
|
+
given-names: Daniel
|
|
98
|
+
- family-names: Hernandez
|
|
99
|
+
given-names: Desiree
|
|
100
|
+
- family-names: Berstler
|
|
101
|
+
given-names: James
|
|
102
|
+
- family-names: Shafqat-Abbasi
|
|
103
|
+
given-names: Hamdah
|
|
104
|
+
- family-names: Root
|
|
105
|
+
given-names: David E.
|
|
106
|
+
- family-names: Swalley
|
|
107
|
+
given-names: Susanne E.
|
|
108
|
+
- family-names: Garg
|
|
109
|
+
given-names: Sakshi
|
|
110
|
+
- family-names: Singh
|
|
111
|
+
given-names: Shantanu
|
|
112
|
+
- family-names: Carpenter
|
|
113
|
+
given-names: Anne E.
|
|
114
|
+
date-accessed: "2024-08-21"
|
|
115
|
+
title: >-
|
|
116
|
+
Three million images and morphological profiles of cells treated with matched chemical and genetic perturbations
|
|
117
|
+
type: article
|
|
118
|
+
issn: 1548-7105
|
|
119
|
+
issue: 6
|
|
120
|
+
journal: Nature Methods
|
|
121
|
+
pages: 1114-1121
|
|
122
|
+
volume: 21
|
|
123
|
+
url: https://doi.org/10.1038/s41592-024-02241-6
|
|
124
|
+
date-published: "2024-06-01"
|
|
125
|
+
identifiers:
|
|
126
|
+
- type: doi
|
|
127
|
+
value: 10.1038/s41592-024-02241-6
|
|
128
|
+
notes: >-
|
|
129
|
+
JUMP (cpg0000-jump-pilot) was used to help demonstrate CytoDataFrame performance
|
|
130
|
+
with large data. See here for more information:
|
|
131
|
+
https://github.com/broadinstitute/cellpainting-gallery
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ome-arrow
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Using OME specifications with Apache Arrow for fast, queryable, and language agnostic bioimage data.
|
|
5
5
|
Author: Dave Bunten
|
|
6
6
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
@@ -16,17 +16,18 @@ Requires-Dist: bioio-ome-tiff>=1.4
|
|
|
16
16
|
Requires-Dist: bioio-ome-zarr>=3.0.3
|
|
17
17
|
Requires-Dist: bioio-tifffile>=1.3
|
|
18
18
|
Requires-Dist: fire>=0.7
|
|
19
|
-
Requires-Dist: ipywidgets>=8.1.8
|
|
20
|
-
Requires-Dist: jupyterlab-widgets>=3.0.16
|
|
21
19
|
Requires-Dist: matplotlib>=3.10.7
|
|
22
20
|
Requires-Dist: numpy>=2.2.6
|
|
23
21
|
Requires-Dist: pandas>=2.2.3
|
|
24
22
|
Requires-Dist: pillow>=12
|
|
25
23
|
Requires-Dist: pyarrow>=22
|
|
26
|
-
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
24
|
+
Provides-Extra: viz
|
|
25
|
+
Requires-Dist: ipywidgets>=8.1.8; extra == "viz"
|
|
26
|
+
Requires-Dist: jupyterlab-widgets>=3.0.16; extra == "viz"
|
|
27
|
+
Requires-Dist: pyvista>=0.46.4; extra == "viz"
|
|
28
|
+
Requires-Dist: trame>=3.12; extra == "viz"
|
|
29
|
+
Requires-Dist: trame-vtk>=2.10; extra == "viz"
|
|
30
|
+
Requires-Dist: trame-vuetify>=3.1; extra == "viz"
|
|
30
31
|
Dynamic: license-file
|
|
31
32
|
|
|
32
33
|
<img height="200" src="https://raw.githubusercontent.com/wayscience/ome-arrow/main/docs/src/_static/logo.png?raw=true">
|
|
@@ -35,6 +36,7 @@ Dynamic: license-file
|
|
|
35
36
|
[](https://github.com/wayscience/ome-arrow/actions/workflows/run-tests.yml?query=branch%3Amain)
|
|
36
37
|
[](https://github.com/astral-sh/ruff)
|
|
37
38
|
[](https://github.com/astral-sh/uv)
|
|
39
|
+
[](https://doi.org/10.5281/zenodo.17664969)
|
|
38
40
|
|
|
39
41
|
# Open, interoperable, and queryable microscopy images with OME Arrow
|
|
40
42
|
|
|
@@ -52,6 +54,13 @@ OME Arrow enables image data to be stored alongside metadata or derived data suc
|
|
|
52
54
|
Images in OME Arrow are composed of mutlilayer [structs](https://arrow.apache.org/docs/python/generated/pyarrow.struct.html) so they may be stored as values within tables.
|
|
53
55
|
This means you can store, query, and build relationships on data from the same location using any system which is compatible with Apache Arrow (including Parquet) through common data interfaces (such as SQL and DuckDB).
|
|
54
56
|
|
|
57
|
+
## Project focus
|
|
58
|
+
|
|
59
|
+
This package is intentionally dedicated to work at a per-image level and not large batch handling (though it may be used for those purposes by users or in other projects).
|
|
60
|
+
|
|
61
|
+
- For visualizing OME Arrow and OME Parquet data in Napari, please see the [`napari-ome-arrow`](https://github.com/WayScience/napari-ome-arrow) Napari plugin.
|
|
62
|
+
- For more comprehensive handling of many images and features in the context of the OME Parquet format please see the [`CytoDataFrame`](https://github.com/cytomining/CytoDataFrame) project (and relevant [example notebook](https://github.com/cytomining/CytoDataFrame/blob/main/docs/src/examples/cytodataframe_at_a_glance.ipynb)).
|
|
63
|
+
|
|
55
64
|
## Installation
|
|
56
65
|
|
|
57
66
|
Install OME Arrow from PyPI or from source:
|
|
@@ -89,7 +98,7 @@ oa_image.info()
|
|
|
89
98
|
oa_image.view(how="matplotlib")
|
|
90
99
|
|
|
91
100
|
# Display the image with pyvista
|
|
92
|
-
# (great for ZYX 3D images).
|
|
101
|
+
# (great for ZYX 3D images; install extras: `pip install 'ome-arrow[viz]'`).
|
|
93
102
|
oa_image.view(how="pyvista")
|
|
94
103
|
|
|
95
104
|
# Export to OME-Parquet.
|
|
@@ -107,5 +116,5 @@ OME Arrow is used or inspired by the following projects, check them out!
|
|
|
107
116
|
|
|
108
117
|
- [`napari-ome-arrow`](https://github.com/WayScience/napari-ome-arrow): enables you to view OME Arrow and related images.
|
|
109
118
|
- [`nViz`](https://github.com/WayScience/nViz): focuses on ingesting and visualizing various 3D image data.
|
|
110
|
-
- [`CytoDataFrame`](https://github.com/cytomining/CytoDataFrame): provides a DataFrame-like experience for viewing feature and microscopy image data within Jupyter notebook interfaces.
|
|
119
|
+
- [`CytoDataFrame`](https://github.com/cytomining/CytoDataFrame): provides a DataFrame-like experience for viewing feature and microscopy image data within Jupyter notebook interfaces and creating OME Parquet files.
|
|
111
120
|
- [`coSMicQC`](https://github.com/cytomining/coSMicQC): performs quality control on microscopy feature datasets, visualized using CytoDataFrames.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](https://github.com/wayscience/ome-arrow/actions/workflows/run-tests.yml?query=branch%3Amain)
|
|
5
5
|
[](https://github.com/astral-sh/ruff)
|
|
6
6
|
[](https://github.com/astral-sh/uv)
|
|
7
|
+
[](https://doi.org/10.5281/zenodo.17664969)
|
|
7
8
|
|
|
8
9
|
# Open, interoperable, and queryable microscopy images with OME Arrow
|
|
9
10
|
|
|
@@ -21,6 +22,13 @@ OME Arrow enables image data to be stored alongside metadata or derived data suc
|
|
|
21
22
|
Images in OME Arrow are composed of mutlilayer [structs](https://arrow.apache.org/docs/python/generated/pyarrow.struct.html) so they may be stored as values within tables.
|
|
22
23
|
This means you can store, query, and build relationships on data from the same location using any system which is compatible with Apache Arrow (including Parquet) through common data interfaces (such as SQL and DuckDB).
|
|
23
24
|
|
|
25
|
+
## Project focus
|
|
26
|
+
|
|
27
|
+
This package is intentionally dedicated to work at a per-image level and not large batch handling (though it may be used for those purposes by users or in other projects).
|
|
28
|
+
|
|
29
|
+
- For visualizing OME Arrow and OME Parquet data in Napari, please see the [`napari-ome-arrow`](https://github.com/WayScience/napari-ome-arrow) Napari plugin.
|
|
30
|
+
- For more comprehensive handling of many images and features in the context of the OME Parquet format please see the [`CytoDataFrame`](https://github.com/cytomining/CytoDataFrame) project (and relevant [example notebook](https://github.com/cytomining/CytoDataFrame/blob/main/docs/src/examples/cytodataframe_at_a_glance.ipynb)).
|
|
31
|
+
|
|
24
32
|
## Installation
|
|
25
33
|
|
|
26
34
|
Install OME Arrow from PyPI or from source:
|
|
@@ -58,7 +66,7 @@ oa_image.info()
|
|
|
58
66
|
oa_image.view(how="matplotlib")
|
|
59
67
|
|
|
60
68
|
# Display the image with pyvista
|
|
61
|
-
# (great for ZYX 3D images).
|
|
69
|
+
# (great for ZYX 3D images; install extras: `pip install 'ome-arrow[viz]'`).
|
|
62
70
|
oa_image.view(how="pyvista")
|
|
63
71
|
|
|
64
72
|
# Export to OME-Parquet.
|
|
@@ -76,5 +84,5 @@ OME Arrow is used or inspired by the following projects, check them out!
|
|
|
76
84
|
|
|
77
85
|
- [`napari-ome-arrow`](https://github.com/WayScience/napari-ome-arrow): enables you to view OME Arrow and related images.
|
|
78
86
|
- [`nViz`](https://github.com/WayScience/nViz): focuses on ingesting and visualizing various 3D image data.
|
|
79
|
-
- [`CytoDataFrame`](https://github.com/cytomining/CytoDataFrame): provides a DataFrame-like experience for viewing feature and microscopy image data within Jupyter notebook interfaces.
|
|
87
|
+
- [`CytoDataFrame`](https://github.com/cytomining/CytoDataFrame): provides a DataFrame-like experience for viewing feature and microscopy image data within Jupyter notebook interfaces and creating OME Parquet files.
|
|
80
88
|
- [`coSMicQC`](https://github.com/cytomining/coSMicQC): performs quality control on microscopy feature datasets, visualized using CytoDataFrames.
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"2D image, single-channel - shape (T=1, C=1, Z=1, Y=512, X=512)"
|
|
35
35
|
],
|
|
36
36
|
"text/plain": [
|
|
37
|
-
"<ome_arrow.core.OMEArrow at
|
|
37
|
+
"<ome_arrow.core.OMEArrow at 0x176418210>"
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"execution_count": 2,
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"3D image (z-stack), multi-channel (2 channels) - shape (T=1, C=2, Z=22, Y=128, X=128)"
|
|
130
130
|
],
|
|
131
131
|
"text/plain": [
|
|
132
|
-
"<ome_arrow.core.OMEArrow at
|
|
132
|
+
"<ome_arrow.core.OMEArrow at 0x17be69110>"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
135
|
"execution_count": 5,
|
|
@@ -167,12 +167,12 @@
|
|
|
167
167
|
{
|
|
168
168
|
"data": {
|
|
169
169
|
"application/vnd.jupyter.widget-view+json": {
|
|
170
|
-
"model_id": "
|
|
170
|
+
"model_id": "e438f2316a4b4348b00283242d346c63",
|
|
171
171
|
"version_major": 2,
|
|
172
172
|
"version_minor": 0
|
|
173
173
|
},
|
|
174
174
|
"text/plain": [
|
|
175
|
-
"Widget(value='<iframe src=\"http://localhost:
|
|
175
|
+
"Widget(value='<iframe src=\"http://localhost:63799/index.html?ui=P_0x17bdef790_0&reconnect=auto\" class=\"pyvista…"
|
|
176
176
|
]
|
|
177
177
|
},
|
|
178
178
|
"metadata": {},
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
{
|
|
199
199
|
"data": {
|
|
200
200
|
"text/plain": [
|
|
201
|
-
"<pyvista.plotting.plotter.Plotter at
|
|
201
|
+
"<pyvista.plotting.plotter.Plotter at 0x17bdef790>"
|
|
202
202
|
]
|
|
203
203
|
},
|
|
204
204
|
"execution_count": 6,
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
"3D image (z-stack), multi-channel (2 channels) - shape (T=1, C=2, Z=22, Y=128, X=128)"
|
|
224
224
|
],
|
|
225
225
|
"text/plain": [
|
|
226
|
-
"<ome_arrow.core.OMEArrow at
|
|
226
|
+
"<ome_arrow.core.OMEArrow at 0x1059985d0>"
|
|
227
227
|
]
|
|
228
228
|
},
|
|
229
229
|
"execution_count": 7,
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
"3D image (z-stack), multi-channel (2 channels) - shape (T=1, C=2, Z=22, Y=128, X=128)"
|
|
262
262
|
],
|
|
263
263
|
"text/plain": [
|
|
264
|
-
"<ome_arrow.core.OMEArrow at
|
|
264
|
+
"<ome_arrow.core.OMEArrow at 0x17f463c90>"
|
|
265
265
|
]
|
|
266
266
|
},
|
|
267
267
|
"execution_count": 8,
|
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
"3D image (z-stack), multi-channel (2 channels) - shape (T=1, C=2, Z=22, Y=128, X=128)"
|
|
300
300
|
],
|
|
301
301
|
"text/plain": [
|
|
302
|
-
"<ome_arrow.core.OMEArrow at
|
|
302
|
+
"<ome_arrow.core.OMEArrow at 0x17f434490>"
|
|
303
303
|
]
|
|
304
304
|
},
|
|
305
305
|
"execution_count": 9,
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
"3D image (z-stack), multi-channel (2 channels) - shape (T=1, C=2, Z=22, Y=128, X=128)"
|
|
338
338
|
],
|
|
339
339
|
"text/plain": [
|
|
340
|
-
"<ome_arrow.core.OMEArrow at
|
|
340
|
+
"<ome_arrow.core.OMEArrow at 0x17bf44390>"
|
|
341
341
|
]
|
|
342
342
|
},
|
|
343
343
|
"execution_count": 10,
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
"2D image, single-channel - shape (T=1, C=1, Z=1, Y=30, X=30)"
|
|
376
376
|
],
|
|
377
377
|
"text/plain": [
|
|
378
|
-
"<ome_arrow.core.OMEArrow at
|
|
378
|
+
"<ome_arrow.core.OMEArrow at 0x35ff46510>"
|
|
379
379
|
]
|
|
380
380
|
},
|
|
381
381
|
"execution_count": 11,
|
|
@@ -405,6 +405,53 @@
|
|
|
405
405
|
" z_indices=[20],\n",
|
|
406
406
|
")"
|
|
407
407
|
]
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"cell_type": "code",
|
|
411
|
+
"execution_count": null,
|
|
412
|
+
"id": "eddf849a",
|
|
413
|
+
"metadata": {},
|
|
414
|
+
"outputs": [
|
|
415
|
+
{
|
|
416
|
+
"data": {
|
|
417
|
+
"text/html": [
|
|
418
|
+
"2D image, single-channel - shape (T=1, C=1, Z=1, Y=73, X=97)"
|
|
419
|
+
],
|
|
420
|
+
"text/plain": [
|
|
421
|
+
"<ome_arrow.core.OMEArrow at 0x35ff67e10>"
|
|
422
|
+
]
|
|
423
|
+
},
|
|
424
|
+
"execution_count": 12,
|
|
425
|
+
"metadata": {},
|
|
426
|
+
"output_type": "execute_result"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"data": {
|
|
430
|
+
"image/png": "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",
|
|
431
|
+
"text/plain": [
|
|
432
|
+
"<Figure size 640x480 with 1 Axes>"
|
|
433
|
+
]
|
|
434
|
+
},
|
|
435
|
+
"metadata": {},
|
|
436
|
+
"output_type": "display_data"
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
"source": [
|
|
440
|
+
"# read from a multi-image OME Parquet file as OME-Arrow\n",
|
|
441
|
+
"# note: the Parquet file was created using the CytoDataFrame project\n",
|
|
442
|
+
"# which helps convert CellProfiler and Image data into OME-Parquet format.\n",
|
|
443
|
+
"# see here for more details:\n",
|
|
444
|
+
"# https://github.com/cytomining/CytoDataFrame/blob/main/docs/src/examples/cytodataframe_at_a_glance.ipynb\n",
|
|
445
|
+
"oa_image = OMEArrow(\n",
|
|
446
|
+
" data=\"../../../tests/data/JUMP-BR00117006/BR00117006.ome.parquet\",\n",
|
|
447
|
+
" # we can specify which column and row to read\n",
|
|
448
|
+
" # (or rely on OMEArrow to find a suitable default)\n",
|
|
449
|
+
" column_name=\"Image_FileName_OrigDNA_OMEArrow_LABL\",\n",
|
|
450
|
+
" row_index=2,\n",
|
|
451
|
+
")\n",
|
|
452
|
+
"# by default, the image and metadata are shown\n",
|
|
453
|
+
"oa_image"
|
|
454
|
+
]
|
|
408
455
|
}
|
|
409
456
|
],
|
|
410
457
|
"metadata": {
|
|
@@ -80,3 +80,18 @@ stack.slice(
|
|
|
80
80
|
c_indices=[0],
|
|
81
81
|
z_indices=[20],
|
|
82
82
|
)
|
|
83
|
+
|
|
84
|
+
# read from a multi-image OME Parquet file as OME-Arrow
|
|
85
|
+
# note: the Parquet file was created using the CytoDataFrame project
|
|
86
|
+
# which helps convert CellProfiler and Image data into OME-Parquet format.
|
|
87
|
+
# see here for more details:
|
|
88
|
+
# https://github.com/cytomining/CytoDataFrame/blob/main/docs/src/examples/cytodataframe_at_a_glance.ipynb
|
|
89
|
+
oa_image = OMEArrow(
|
|
90
|
+
data="../../../tests/data/JUMP-BR00117006/BR00117006.ome.parquet",
|
|
91
|
+
# we can specify which column and row to read
|
|
92
|
+
# (or rely on OMEArrow to find a suitable default)
|
|
93
|
+
column_name="Image_FileName_OrigDNA_OMEArrow_LABL",
|
|
94
|
+
row_index=2,
|
|
95
|
+
)
|
|
96
|
+
# by default, the image and metadata are shown
|
|
97
|
+
oa_image
|
|
@@ -24,13 +24,16 @@ dependencies = [
|
|
|
24
24
|
"bioio-ome-zarr>=3.0.3",
|
|
25
25
|
"bioio-tifffile>=1.3",
|
|
26
26
|
"fire>=0.7",
|
|
27
|
-
"ipywidgets>=8.1.8",
|
|
28
|
-
"jupyterlab-widgets>=3.0.16",
|
|
29
27
|
"matplotlib>=3.10.7",
|
|
30
28
|
"numpy>=2.2.6",
|
|
31
29
|
"pandas>=2.2.3",
|
|
32
30
|
"pillow>=12",
|
|
33
31
|
"pyarrow>=22",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
optional-dependencies.viz = [
|
|
35
|
+
"ipywidgets>=8.1.8",
|
|
36
|
+
"jupyterlab-widgets>=3.0.16",
|
|
34
37
|
"pyvista>=0.46.4",
|
|
35
38
|
"trame>=3.12",
|
|
36
39
|
"trame-vtk>=2.10",
|
|
@@ -49,6 +52,7 @@ docs = [
|
|
|
49
52
|
]
|
|
50
53
|
notebooks = [
|
|
51
54
|
"black>=25.1",
|
|
55
|
+
"ipykernel>=6.29.5",
|
|
52
56
|
"isort>=6.0.1",
|
|
53
57
|
"jupyterlab>=4.4.2",
|
|
54
58
|
"jupyterlab-code-formatter>=3.0.2",
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
31
|
+
__version__ = version = '0.0.4'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 0, 4)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g0496fa17a'
|
|
@@ -5,12 +5,11 @@ Core of the ome_arrow package, used for classes and such.
|
|
|
5
5
|
from __future__ import annotations
|
|
6
6
|
|
|
7
7
|
import pathlib
|
|
8
|
-
from typing import Any, Dict, Iterable, Optional, Tuple
|
|
8
|
+
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple
|
|
9
9
|
|
|
10
10
|
import matplotlib
|
|
11
11
|
import numpy as np
|
|
12
12
|
import pyarrow as pa
|
|
13
|
-
import pyvista
|
|
14
13
|
|
|
15
14
|
from ome_arrow.export import to_numpy, to_ome_parquet, to_ome_tiff, to_ome_zarr
|
|
16
15
|
from ome_arrow.ingest import (
|
|
@@ -25,6 +24,10 @@ from ome_arrow.transform import slice_ome_arrow
|
|
|
25
24
|
from ome_arrow.utils import describe_ome_arrow
|
|
26
25
|
from ome_arrow.view import view_matplotlib, view_pyvista
|
|
27
26
|
|
|
27
|
+
# if not in runtime, import pyvista for type hints
|
|
28
|
+
if TYPE_CHECKING:
|
|
29
|
+
import pyvista
|
|
30
|
+
|
|
28
31
|
|
|
29
32
|
class OMEArrow:
|
|
30
33
|
"""
|
|
@@ -47,6 +50,8 @@ class OMEArrow:
|
|
|
47
50
|
self,
|
|
48
51
|
data: str | dict | pa.StructScalar | "np.ndarray",
|
|
49
52
|
tcz: Tuple[int, int, int] = (0, 0, 0),
|
|
53
|
+
column_name: str = "ome_arrow",
|
|
54
|
+
row_index: int = 0,
|
|
50
55
|
) -> None:
|
|
51
56
|
"""
|
|
52
57
|
Construct an OMEArrow from:
|
|
@@ -91,7 +96,9 @@ class OMEArrow:
|
|
|
91
96
|
".parquet",
|
|
92
97
|
".pq",
|
|
93
98
|
}:
|
|
94
|
-
self.data = from_ome_parquet(
|
|
99
|
+
self.data = from_ome_parquet(
|
|
100
|
+
s, column_name=column_name, row_index=row_index
|
|
101
|
+
)
|
|
95
102
|
|
|
96
103
|
# TIFF
|
|
97
104
|
elif path.suffix.lower() in {".tif", ".tiff"} or s.lower().endswith(
|
|
@@ -293,7 +300,7 @@ class OMEArrow:
|
|
|
293
300
|
clim: tuple[float, float] | None = None,
|
|
294
301
|
show_axes: bool = True,
|
|
295
302
|
scaling_values: tuple[float, float, float] | None = (1.0, 0.1, 0.1),
|
|
296
|
-
) -> matplotlib.figure.Figure | pyvista.Plotter:
|
|
303
|
+
) -> matplotlib.figure.Figure | "pyvista.Plotter":
|
|
297
304
|
"""
|
|
298
305
|
Render an OME-Arrow record using Matplotlib or PyVista.
|
|
299
306
|
|
|
@@ -4,6 +4,7 @@ Converting to and from OME-Arrow formats.
|
|
|
4
4
|
|
|
5
5
|
import itertools
|
|
6
6
|
import re
|
|
7
|
+
import warnings
|
|
7
8
|
from datetime import datetime, timezone
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
from typing import Any, Dict, List, Optional, Sequence, Tuple
|
|
@@ -820,42 +821,6 @@ def from_ome_parquet(
|
|
|
820
821
|
) -> pa.StructScalar:
|
|
821
822
|
"""
|
|
822
823
|
Read an OME-Arrow record from a Parquet file and return a typed StructScalar.
|
|
823
|
-
|
|
824
|
-
Expected layout (as produced by `to_ome_parquet`):
|
|
825
|
-
- single Parquet file
|
|
826
|
-
- a single column (default name "ome_arrow") of `OME_ARROW_STRUCT` type
|
|
827
|
-
- one row (row_index=0)
|
|
828
|
-
|
|
829
|
-
This function is forgiving:
|
|
830
|
-
- If `column_name` is None or not found, it will auto-detect a struct column
|
|
831
|
-
that matches the OME-Arrow field names.
|
|
832
|
-
- If the table has multiple rows, you can choose which record to read
|
|
833
|
-
via `row_index`.
|
|
834
|
-
|
|
835
|
-
Parameters
|
|
836
|
-
----------
|
|
837
|
-
parquet_path : str | Path
|
|
838
|
-
Path to the .parquet file.
|
|
839
|
-
column_name : Optional[str], default "ome_arrow"
|
|
840
|
-
Name of the column that stores the OME-Arrow struct. If None, auto-detect.
|
|
841
|
-
row_index : int, default 0
|
|
842
|
-
Which row to read if the table contains multiple rows.
|
|
843
|
-
strict_schema : bool, default False
|
|
844
|
-
If True, require the column's type to equal `OME_ARROW_STRUCT` exactly.
|
|
845
|
-
If False, we only require the column to be a Struct with the same field
|
|
846
|
-
names (order can vary).
|
|
847
|
-
|
|
848
|
-
Returns
|
|
849
|
-
-------
|
|
850
|
-
pa.StructScalar
|
|
851
|
-
A validated OME-Arrow struct scalar.
|
|
852
|
-
|
|
853
|
-
Raises
|
|
854
|
-
------
|
|
855
|
-
FileNotFoundError
|
|
856
|
-
If the file does not exist.
|
|
857
|
-
ValueError
|
|
858
|
-
If a suitable column/row cannot be found or schema checks fail.
|
|
859
824
|
"""
|
|
860
825
|
p = Path(parquet_path)
|
|
861
826
|
if not p.exists():
|
|
@@ -874,7 +839,9 @@ def from_ome_parquet(
|
|
|
874
839
|
col_fields = {f.name for f in t}
|
|
875
840
|
return ome_fields == col_fields
|
|
876
841
|
|
|
842
|
+
requested_name = column_name
|
|
877
843
|
candidate_col = None
|
|
844
|
+
autodetected_name = None
|
|
878
845
|
|
|
879
846
|
if column_name is not None and column_name in table.column_names:
|
|
880
847
|
arr = table[column_name]
|
|
@@ -898,10 +865,12 @@ def from_ome_parquet(
|
|
|
898
865
|
if pa.types.is_struct(arr.type):
|
|
899
866
|
if strict_schema and arr.type == OME_ARROW_STRUCT:
|
|
900
867
|
candidate_col = arr
|
|
868
|
+
autodetected_name = name
|
|
901
869
|
column_name = name
|
|
902
870
|
break
|
|
903
871
|
if not strict_schema and _struct_matches_ome_fields(arr.type):
|
|
904
872
|
candidate_col = arr
|
|
873
|
+
autodetected_name = name
|
|
905
874
|
column_name = name
|
|
906
875
|
break
|
|
907
876
|
if candidate_col is None:
|
|
@@ -911,21 +880,26 @@ def from_ome_parquet(
|
|
|
911
880
|
hint = f"column '{column_name}' not found and auto-detection failed."
|
|
912
881
|
raise ValueError(f"Could not locate an OME-Arrow struct column: {hint}")
|
|
913
882
|
|
|
883
|
+
# Emit warning if auto-detection was used
|
|
884
|
+
if autodetected_name is not None and autodetected_name != requested_name:
|
|
885
|
+
warnings.warn(
|
|
886
|
+
f"Requested column '{requested_name}' was not usable or not found. "
|
|
887
|
+
f"Auto-detected OME-Arrow column '{autodetected_name}'.",
|
|
888
|
+
UserWarning,
|
|
889
|
+
stacklevel=2,
|
|
890
|
+
)
|
|
891
|
+
|
|
914
892
|
# 2) Extract the row as a Python dict
|
|
915
|
-
# (Using to_pylist() for the single element slice is simple & reliable.)
|
|
916
893
|
record_dict: Dict[str, Any] = candidate_col.slice(row_index, 1).to_pylist()[0]
|
|
917
894
|
|
|
918
895
|
# 3) Reconstruct a typed StructScalar using the canonical schema
|
|
919
|
-
# (this validates field names/types and normalizes order)
|
|
920
896
|
scalar = pa.scalar(record_dict, type=OME_ARROW_STRUCT)
|
|
921
897
|
|
|
922
898
|
# Optional: soft validation via file-level metadata (if present)
|
|
923
899
|
try:
|
|
924
900
|
meta = table.schema.metadata or {}
|
|
925
|
-
meta.get(b"ome.arrow.type", b"").decode() == str(
|
|
926
|
-
|
|
927
|
-
) and meta.get(b"ome.arrow.version", b"").decode() == str(OME_ARROW_TAG_VERSION)
|
|
928
|
-
# You could log/print a warning if tag_ok is False, but don't fail.
|
|
901
|
+
meta.get(b"ome.arrow.type", b"").decode() == str(OME_ARROW_TAG_TYPE)
|
|
902
|
+
meta.get(b"ome.arrow.version", b"").decode() == str(OME_ARROW_TAG_VERSION)
|
|
929
903
|
except Exception:
|
|
930
904
|
pass
|
|
931
905
|
|