ngio 0.2.9__py3-none-any.whl → 0.3.0a1__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.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngio
3
- Version: 0.2.9
3
+ Version: 0.3.0a1
4
4
  Summary: Next Generation file format IO
5
- Project-URL: homepage, https://github.com/lorenzocerrone/ngio
6
- Project-URL: repository, https://github.com/lorenzocerrone/ngio
5
+ Project-URL: homepage, https://github.com/fractal-analytics-platform/ngio
6
+ Project-URL: repository, https://github.com/fractal-analytics-platform/ngio
7
7
  Author-email: Lorenzo Cerrone <lorenzo.cerrone@uzh.ch>
8
8
  License: BSD-3-Clause
9
9
  License-File: LICENSE
@@ -50,6 +50,7 @@ Requires-Dist: mkdocs; extra == 'docs'
50
50
  Requires-Dist: mkdocs-autorefs; extra == 'docs'
51
51
  Requires-Dist: mkdocs-git-committers-plugin-2; extra == 'docs'
52
52
  Requires-Dist: mkdocs-git-revision-date-localized-plugin; extra == 'docs'
53
+ Requires-Dist: mkdocs-include-markdown-plugin; extra == 'docs'
53
54
  Requires-Dist: mkdocs-jupyter; extra == 'docs'
54
55
  Requires-Dist: mkdocs-material; extra == 'docs'
55
56
  Requires-Dist: mkdocstrings[python]; extra == 'docs'
@@ -1,5 +1,5 @@
1
1
  ngio/__init__.py,sha256=zce-RIfRhkiFyfKwO6s7A1-9ZCD3n6RuVuW3GeRj_VA,1309
2
- ngio/common/__init__.py,sha256=tMKp1eZzGfpdKDkpfHn0iVzSO11dmp-RZARpuxoGGQk,1351
2
+ ngio/common/__init__.py,sha256=BttXCAV2ks6_oXVDfapk1Lvlxp4J0ffX7-FXR3LL1BM,1834
3
3
  ngio/common/_array_pipe.py,sha256=we3gZLhgUsiPQwPQqg_XVkyG_9EpQ2xoe0L_nOALDho,7828
4
4
  ngio/common/_axes_transforms.py,sha256=kWU0M5erNmgWBXdu5LNv-tLW3jqkT00MMYX7cz-kyHs,2035
5
5
  ngio/common/_common_types.py,sha256=OkAYNSNjZkixL1MI-HPBVuXamheFBr862uJ4PvTxmhk,129
@@ -8,20 +8,21 @@ ngio/common/_masking_roi.py,sha256=-o6meGP17iTXEbkO9aGh1VX2drkc2laIcRJvCy_pRRM,4
8
8
  ngio/common/_pyramid.py,sha256=SJzPauuduuqcm9B7nFCJhMTzIg6Knjsnp4CY4lN61Is,7411
9
9
  ngio/common/_roi.py,sha256=dq1iVT8-G_zWuxcYWJeHfviBSbPgsyKUcDL3Vg6jx6I,5122
10
10
  ngio/common/_slicer.py,sha256=AKpwXRncOmF9nhjKYma0C_41WqAgSv860beKGx-aw-0,3075
11
+ ngio/common/_table_ops.py,sha256=oTjCcecBOG_GJoLgJLgag6yl_nznThOKBKANQJow0h8,15493
11
12
  ngio/common/_zoom.py,sha256=KsURa5VuixmpbAAY5-6obmuQV8vfiHKZqBxZDXvchpM,5473
12
13
  ngio/hcs/__init__.py,sha256=5oAYT_454WGhms97kxo8gS4_rKHtFf_x-9uu8M_VeVM,356
13
- ngio/hcs/plate.py,sha256=WmUw8qZgWUPBBTqtV8lh_7T0vtRzMkAmduM8b969Ni4,30082
14
+ ngio/hcs/plate.py,sha256=Y_d-ZuV9FmYsSHqwZfcnm_Y024jfdiMd7WlaeNJy73k,43696
14
15
  ngio/images/__init__.py,sha256=DYbXAdBgPxyjBRdJrWvU0UnBRI0gUMmx9KaJ-Bucvz4,533
15
16
  ngio/images/abstract_image.py,sha256=8PNQPZjiDz-pcTFXSJAVw7nUr4yL_iRwqDEUTKkAnp0,10266
16
17
  ngio/images/create.py,sha256=XYn30m_2OSZeHHASYHc3eK9u_gZIYy9wo6mGdRGaq5c,9473
17
18
  ngio/images/image.py,sha256=mKLIR2DGQUWtQbf3my2fh0bEPkbbsabUoge_XJPhfWE,17824
18
19
  ngio/images/label.py,sha256=qgbBHFPGYpUR2fHf1OiXZh4sn0FgCeeWwH1F4SrOM1c,10460
19
20
  ngio/images/masked_image.py,sha256=IBo8x2jHyXBXn7ORo8fSiwBPjV_1JOTb_vatjKNxbJ0,8531
20
- ngio/images/ome_zarr_container.py,sha256=-9bbzNtsVAjU1X_h78Lr5LOV0JXtOiWVWqmt3DFpXus,28927
21
+ ngio/images/ome_zarr_container.py,sha256=jOodimQzAnaLUSYG1OnBsWqtHeL8_V4wkg_4RSXbwcM,30003
21
22
  ngio/ome_zarr_meta/__init__.py,sha256=oZ8PEsWM7U0KwzpsnvVfX9k4UfuTz5sZ8B6B9eY5hyY,1193
22
- ngio/ome_zarr_meta/_meta_handlers.py,sha256=BLvYt5PONYrWkEb2XgEiAXR_OX9rfeX_C0eEqen0jQA,25549
23
+ ngio/ome_zarr_meta/_meta_handlers.py,sha256=ctknNDT8jxwyvxQf9on5gW31H1tRRsnneO38GT2UXoE,25880
23
24
  ngio/ome_zarr_meta/ngio_specs/__init__.py,sha256=05NQukZG0nNvjzf8AKWGu7PhjhQcImGSAOK3D3Bg-Js,1786
24
- ngio/ome_zarr_meta/ngio_specs/_axes.py,sha256=tHtx6NfBgDcCgDk9CosjIjw1KZJ2qi0i_eoLgrdiEWw,16681
25
+ ngio/ome_zarr_meta/ngio_specs/_axes.py,sha256=Kqe9T7LWa_9o3UWS5uzALyyNluIhXxWhDGxWY4-GIo8,16707
25
26
  ngio/ome_zarr_meta/ngio_specs/_channels.py,sha256=2L-HM9K1Xu4qRI2MiXPqgCuHdCBRydEW1StThcqEuvY,15120
26
27
  ngio/ome_zarr_meta/ngio_specs/_dataset.py,sha256=hY8ogPPxvCgVg6k02t3zUr24lasYrvnxBd1iPEigdG4,5892
27
28
  ngio/ome_zarr_meta/ngio_specs/_ngio_hcs.py,sha256=uh345KQmEQtslIyMmLK9sB-NbjPYxi0Y9FuYIFhd3Rc,17465
@@ -30,28 +31,31 @@ ngio/ome_zarr_meta/ngio_specs/_pixel_size.py,sha256=5TT8250XdCKUnk3OwZeyXIMNFKOg
30
31
  ngio/ome_zarr_meta/v04/__init__.py,sha256=dJRzzxyYc81kf-0Hip_bqvbdManaM8XTdQX2meWyCSs,583
31
32
  ngio/ome_zarr_meta/v04/_custom_models.py,sha256=5GxiDERvLuvq4QvApcA6EiKLS6hLFX1R0R_9rSaa85A,530
32
33
  ngio/ome_zarr_meta/v04/_v04_spec_utils.py,sha256=05tEr2eEP_XVIfBMOAWLT7lzJV4KS5eYrpK8l94tn3w,15876
33
- ngio/tables/__init__.py,sha256=gxvNvAgLePgrngOm06H5qU50Axc6boeIs5iCfrmqTi0,609
34
- ngio/tables/_validators.py,sha256=7Eqln9j1tWmNakSCnryy2q39SbTuk6V31O2iMByTWWw,3363
35
- ngio/tables/tables_container.py,sha256=DFlz_6ts5p0lHkm6NMBtKZget30OicCYHrLbiG4xU1s,10188
36
- ngio/tables/backends/__init__.py,sha256=Y9MIFefwUaSmhhv5FDZFn7jBdYXDML2FovO-uK-vxgI,936
37
- ngio/tables/backends/_abstract_backend.py,sha256=--4qeVHs4YRo5i5XsREmDm6BxMsQ5tIqc6XZ810GJno,8776
34
+ ngio/tables/__init__.py,sha256=np-XWjUY_HkwMfSy_bIRxh5t5SFZJ9yHEtvtbuaaSgg,824
35
+ ngio/tables/abstract_table.py,sha256=naAeDsPTVjDUOnAxj_57UWXApg_nyWCsWdZ0f7bm740,8169
36
+ ngio/tables/tables_container.py,sha256=c7YnzLy2aaDc0jCH8ih8FTAKpAX8dIAu743nF7EjNTY,11871
37
+ ngio/tables/backends/__init__.py,sha256=tx97ZkK5kF_sAGU2kf_ZI9JxbOXn8GVjE0rUUq9h-QM,1525
38
+ ngio/tables/backends/_abstract_backend.py,sha256=jtai3AqcLNZyxYyK0rernbMtcwxWhWAahCS0fPlMNls,7454
39
+ ngio/tables/backends/_anndata.py,sha256=8RX2NO15CLxys3p6gw54Nd-_0WATU4WBlNndX06wvzI,2587
38
40
  ngio/tables/backends/_anndata_utils.py,sha256=DBWIcR0btnH-DIvDvzlcnMXoYhhtXc9DstryiOP0Qsg,3122
39
- ngio/tables/backends/_anndata_v1.py,sha256=5p_8pWUkYM4rEhm7g-b2yCXt2mmyd6lFisc1ubksAio,2469
40
- ngio/tables/backends/_csv_v1.py,sha256=o5AGlBH3UQdXx6MP2DtMm7zmXkOwnBBzu5TKk-QgQdI,5847
41
- ngio/tables/backends/_json_v1.py,sha256=7ALjB2thKTxPBeYOleqn2LNuAy6erp0Nzd-GZ9Xcd4Y,3079
42
- ngio/tables/backends/_table_backends.py,sha256=NXdH4pxo9XWZ_YxC5RVaw4PTOg-do30c3vlIy8KG4vQ,5831
43
- ngio/tables/backends/_utils.py,sha256=D0zI8_b6HEBZ2ER-80JvEEh_2-aCC1kpyKJGDPBPHco,14661
44
- ngio/tables/v1/__init__.py,sha256=XWi6f_KbjbX45Ku-7uymJRSTVWyFAPAAEp_TXDeZV4s,314
45
- ngio/tables/v1/_feature_table.py,sha256=2pZEENyZAmn_Awezu8VLGq90d-J7aXd6Ry8gNNR0wAQ,6104
46
- ngio/tables/v1/_generic_table.py,sha256=O2fu8k_TjhWEZtJxlU3Uj7ZTZnc75vLlvjw5lweSnd8,5710
47
- ngio/tables/v1/_roi_table.py,sha256=zGoISSC5q0UHyc0hcxfm2xpw2W6wUocoYctdi5nMmwg,11460
41
+ ngio/tables/backends/_csv.py,sha256=Ev61D-AUKo4LIhXRmWPJgYbHI7eQdxiajQR574DevEM,932
42
+ ngio/tables/backends/_json.py,sha256=1ZsEuXDJm1rOZV_KjFm8CB0qhv7L1W7L2EGWPf4q_p0,3137
43
+ ngio/tables/backends/_non_zarr_backends.py,sha256=SvPPhT6n5TrKUOyV1mNcdHQK49huZ5lwR8EVe9MdydM,7254
44
+ ngio/tables/backends/_parquet.py,sha256=ic-p86h8lce8q9luBJGRzy6vxlWyJvA0-2l5cUD6OqY,1398
45
+ ngio/tables/backends/_table_backends.py,sha256=9bAwiB93gR8E7NdpH9WMMQhjn34Iz6oW9i_H4upYbW4,6567
46
+ ngio/tables/backends/_utils.py,sha256=tJBSWN6OhO_1ybxl4vT2l3ImB028Fb6h0vaitPRcr8A,19668
47
+ ngio/tables/v1/__init__.py,sha256=Wr1_9RZFpaN8FYMTnxT9Yjkw4AS7y9FMWailmB_uj5g,617
48
+ ngio/tables/v1/_condition_table.py,sha256=LwtmygyhsSgAUoI_XuzF4lsHhTO5SIJqytxNAxqRCFU,1780
49
+ ngio/tables/v1/_feature_table.py,sha256=6QiaHYTxBGwkIkBndA0pIgTpLSnlkJ6b_Nqs_H5g3GI,3819
50
+ ngio/tables/v1/_generic_table.py,sha256=jFpW1vCDurN-TFQtQEyz1Rqnax7sVQoJzdPPBAVopFE,1239
51
+ ngio/tables/v1/_roi_table.py,sha256=VQDLJnXGniups4bhZxn9ga9LRQnEI5PJzWDrQNsjmDM,13455
48
52
  ngio/utils/__init__.py,sha256=r3nuLWgp6-cQlS4ODjYSBrfgdTLkCOVke9jKbn1NpkA,1129
49
53
  ngio/utils/_datasets.py,sha256=EdYJHIifpRou4f43dIuiKsdxe4K6FaeS4f1_e_EYrcI,1727
50
54
  ngio/utils/_errors.py,sha256=pKQ12LUjQLYE1nUawemA5h7HsgznjaSvV1n2PQU33N0,759
51
- ngio/utils/_fractal_fsspec_store.py,sha256=7qoGLiLi8JQFh9Ej_z5WNwQQuWrujb0f6p9nj8ocsS8,548
55
+ ngio/utils/_fractal_fsspec_store.py,sha256=0PMqPRCw7CYdLPxsNtp_vMLXfiQVwqs5EWrn2YVEuvA,1549
52
56
  ngio/utils/_logger.py,sha256=HIuqD_2ShfFGDswBddcouStbKfL0Vz_ah8cAIFGhbS8,888
53
57
  ngio/utils/_zarr_utils.py,sha256=qOI-HL2HsfFLCj_yxsTR-aq4oHpSqS9KR13aEIvhGDY,13593
54
- ngio-0.2.9.dist-info/METADATA,sha256=3hSjDhHlP2G3U8g1HcTNO5bQWGBEB0S1FLSMwDh4RlQ,5215
55
- ngio-0.2.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
56
- ngio-0.2.9.dist-info/licenses/LICENSE,sha256=UgN_a1QCeNh9rZWfz-wORQFxE3elQzLWPQaoK6N6fxQ,1502
57
- ngio-0.2.9.dist-info/RECORD,,
58
+ ngio-0.3.0a1.dist-info/METADATA,sha256=7yRX4zM74DQkNKw-w5OijTUM7afR7OSks8zLd-1R1ro,5304
59
+ ngio-0.3.0a1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
60
+ ngio-0.3.0a1.dist-info/licenses/LICENSE,sha256=UgN_a1QCeNh9rZWfz-wORQFxE3elQzLWPQaoK6N6fxQ,1502
61
+ ngio-0.3.0a1.dist-info/RECORD,,
@@ -1,108 +0,0 @@
1
- from collections.abc import Iterable
2
- from typing import Protocol
3
-
4
- import pandas as pd
5
-
6
- from ngio.utils import NgioTableValidationError
7
-
8
-
9
- class TableValidator(Protocol):
10
- def __call__(self, table: pd.DataFrame) -> pd.DataFrame:
11
- """Validate the table DataFrame.
12
-
13
- A Validator is just a simple callable that takes a
14
- DataFrame and returns a DataFrame.
15
-
16
- If the DataFrame is valid, the same DataFrame is returned.
17
- If the DataFrame is invalid, the Validator can either modify the DataFrame
18
- to make it valid or raise a NgioTableValidationError.
19
-
20
- Args:
21
- table (pd.DataFrame): The DataFrame to validate.
22
-
23
- Returns:
24
- pd.DataFrame: The validated DataFrame.
25
-
26
- """
27
- ...
28
-
29
-
30
- def validate_table(
31
- table_df: pd.DataFrame,
32
- validators: Iterable[TableValidator] | None = None,
33
- ) -> pd.DataFrame:
34
- """Validate the table DataFrame.
35
-
36
- Args:
37
- table_df (pd.DataFrame): The DataFrame to validate.
38
- validators (Collection[Validator] | None): A collection of functions
39
- used to validate the table. Default is None.
40
-
41
- Returns:
42
- pd.DataFrame: The validated DataFrame.
43
- """
44
- validators = validators or []
45
-
46
- # Apply all provided validators
47
- for validator in validators:
48
- table_df = validator(table_df)
49
-
50
- return table_df
51
-
52
-
53
- ####################################################################################################
54
- #
55
- # Common table validators
56
- #
57
- ####################################################################################################
58
- def validate_columns(
59
- table_df: pd.DataFrame,
60
- required_columns: list[str],
61
- optional_columns: list[str] | None = None,
62
- ) -> pd.DataFrame:
63
- """Validate the columns headers of the table.
64
-
65
- If a required column is missing, a TableValidationError is raised.
66
- If a list of optional columns is provided, only required and optional columns are
67
- allowed in the table.
68
-
69
- Args:
70
- table_df (pd.DataFrame): The DataFrame to validate.
71
- required_columns (list[str]): A list of required columns.
72
- optional_columns (list[str] | None): A list of optional columns.
73
- Default is None.
74
-
75
- Returns:
76
- pd.DataFrame: The validated DataFrame.
77
- """
78
- table_header = table_df.columns
79
- for column in required_columns:
80
- if column not in table_header:
81
- raise NgioTableValidationError(
82
- f"Could not find required column: {column} in the table"
83
- )
84
-
85
- if optional_columns is None:
86
- return table_df
87
-
88
- possible_columns = [*required_columns, *optional_columns]
89
- for column in table_header:
90
- if column not in possible_columns:
91
- raise NgioTableValidationError(
92
- f"Could not find column: {column} in the list of possible columns. ",
93
- f"Possible columns are: {possible_columns}",
94
- )
95
-
96
- return table_df
97
-
98
-
99
- def validate_unique_index(table_df: pd.DataFrame) -> pd.DataFrame:
100
- """Validate that the index of the table is unique."""
101
- if table_df.index.is_unique:
102
- return table_df
103
-
104
- # Find the duplicates
105
- duplicates = table_df.index[table_df.index.duplicated()].tolist()
106
- raise NgioTableValidationError(
107
- f"Index of the table contains duplicates values. Duplicate: {duplicates}"
108
- )
File without changes