ialdev-dataman 0.2.4__tar.gz → 0.2.6__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.
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/PKG-INFO +5 -5
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/pyproject.toml +6 -5
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/__init__.py +1 -1
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/datacast/caster.py +41 -7
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/datacast/scan.py +5 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/datacast/transtools.py +18 -11
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/factories.py +6 -1
- ialdev_dataman-0.2.6/tests/datacast/data/res/verosnap.scm.yml +26 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/test_scheme.py +53 -1
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/README.md +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/docs/use_cases.md +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/docs/use_cases.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/datacast/__init__.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/datacast/collect.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/datacast/labeled.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/datacast/transforms.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/env.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/models.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/__init__.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/__init__.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/compat/__init__.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/compat/hacks.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/compat/old_enums.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/compat/representers.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/compat/types.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/compat/yaml_lib.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/ext/__init__.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/ext/semver.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/ext/versioned_model.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/main.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/mixin.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/model.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/py.typed +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/version.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/models.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/resman.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/conftest.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/datasets/toy/datasource.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/datasource.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/res/FT3D.col.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/res/FT3D.ds.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/res/FT3D.scm.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/res/source_1.src.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/res/source_2.src.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/res/test_FT3D.src.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/res/toy_split.ds.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/scheme.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/test_collect.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/datasets/toy/datasource.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/datasource.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/res/FT3D.col.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/res/FT3D.ds.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/res/FT3D.scm.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/res/source_1.src.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/res/source_2.src.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/res/test_FT3D.src.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/res/toy_split.ds.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/scheme.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/test_datasets.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/test_models.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/data/dump.json +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/data/dump.yaml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/data/example_yaml.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/__init__.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/recursive.yaml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_advanced_yaml.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_basic.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_io.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_resursive.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_secret_types.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_sorting.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_types.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_versioned.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/versioned.yaml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/test_models.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/resman/data/res/nested/wind.dply.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/resman/data/res/nested/windtwo.dply.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/resman/data/res/wind.dply.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/resman/test_resource.py +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test.env +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/StereoImage_1058262900228717.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/bench/tiny/metrics_94362.hdf +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/evals/tiny/Adirondack##1#1#1/conf#NU40#0.0#6de6#L.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/evals/tiny/Adirondack##1#1#1/disp#NU40#0.0#6de6#L.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/evals/tiny/Piano##1#1#1/conf#NU40#0.0#6de6#L.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/evals/tiny/Piano##1#1#1/disp#NU40#0.0#6de6#L.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/calib.txt +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/disp0GT.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/disp1GT.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/im0.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/im0_gray.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/im1.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/im1_gray.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/mask0nocc.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Adirondack/mask1nocc.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/calib.txt +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/disp0GT.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/disp1GT.tif +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/im0.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/im0_gray.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/im1.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/im1_gray.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/mask0nocc.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/mask1nocc.jpg +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/datasource.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/benchmarks/tiny.bmk.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/collections/tiny.col.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/collections/tiny_2.col.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/datasets/tiny.ds.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/issues/categorical/issue.xlsx +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/issues/selector_issues.csv +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/depth/Monkaa_output_from_NU.scm.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/depth/labels.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/depth/repos/bench_evals.scm.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/depth/repos/bench_results.scm.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/labels.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/tiny.scm.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/trainings/test_training_config.trn.yml +0 -0
- {ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/trainings/test_training_curriculum_config.trn.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ialdev-dataman
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Imported as `iad.dataman` — data casting, resource models, and dataset bridge
|
|
5
5
|
Author: ipcoder
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -12,10 +12,10 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Requires-Dist: ialdev-core>=0.2.
|
|
16
|
-
Requires-Dist: ialdev-io>=0.2.
|
|
17
|
-
Requires-Dist: ialdev-img>=0.2.
|
|
18
|
-
Requires-Dist: ialdev-maths>=0.2.
|
|
15
|
+
Requires-Dist: ialdev-core>=0.2.5
|
|
16
|
+
Requires-Dist: ialdev-io>=0.2.3
|
|
17
|
+
Requires-Dist: ialdev-img>=0.2.3
|
|
18
|
+
Requires-Dist: ialdev-maths>=0.2.4
|
|
19
19
|
Requires-Dist: pandas>=2.0.0
|
|
20
20
|
Requires-Dist: numpy>=1.26.4,<2
|
|
21
21
|
Requires-Dist: pydantic>=2.0
|
|
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ialdev-dataman"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.6"
|
|
8
8
|
description = "Imported as `iad.dataman` — data casting, resource models, and dataset bridge"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -23,10 +23,10 @@ classifiers = [
|
|
|
23
23
|
]
|
|
24
24
|
|
|
25
25
|
dependencies = [
|
|
26
|
-
"ialdev-core>=0.2.
|
|
27
|
-
"ialdev-io>=0.2.
|
|
28
|
-
"ialdev-img>=0.2.
|
|
29
|
-
"ialdev-maths>=0.2.
|
|
26
|
+
"ialdev-core>=0.2.5",
|
|
27
|
+
"ialdev-io>=0.2.3",
|
|
28
|
+
"ialdev-img>=0.2.3",
|
|
29
|
+
"ialdev-maths>=0.2.4",
|
|
30
30
|
"pandas>=2.0.0",
|
|
31
31
|
"numpy>=1.26.4,<2",
|
|
32
32
|
"pydantic>=2.0",
|
|
@@ -51,6 +51,7 @@ name = "iad.dataman"
|
|
|
51
51
|
|
|
52
52
|
[tool.pytest.ini_options]
|
|
53
53
|
testpaths = ["tests"]
|
|
54
|
+
addopts = "--import-mode=importlib"
|
|
54
55
|
python_files = ["test_*.py"]
|
|
55
56
|
python_classes = ["Test*"]
|
|
56
57
|
python_functions = ["test_*"]
|
|
@@ -4,7 +4,7 @@ from .models import DataSourceRM, SchemeRM, DatasetRM, CollectionRM, DSample, di
|
|
|
4
4
|
from .factories import create_caster, create_collection, create_sink
|
|
5
5
|
from .datacast.collect import DataCollection, SinkRepo
|
|
6
6
|
|
|
7
|
-
__version__ = "0.2.
|
|
7
|
+
__version__ = "0.2.6"
|
|
8
8
|
|
|
9
9
|
__all__ = [
|
|
10
10
|
"__version__",
|
|
@@ -32,13 +32,13 @@ class CasterConfig:
|
|
|
32
32
|
__slots__ = ('name', 'root', 'search', 'labels', 'mappings',
|
|
33
33
|
'reverse', 'bundle', 'filters', 'sample')
|
|
34
34
|
|
|
35
|
-
def __init__(self, *, name: str = None, root: Path | str,
|
|
35
|
+
def __init__(self, *, name: str = None, root: Path | str | None,
|
|
36
36
|
search: GuideScan, labels: dict = None,
|
|
37
37
|
mappings: dict = None, reverse: bool = False,
|
|
38
38
|
bundle: list | None = None, filters: dict = None,
|
|
39
39
|
sample: dict = None):
|
|
40
40
|
self.name = name
|
|
41
|
-
self.root = Path(root)
|
|
41
|
+
self.root = root and Path(root)
|
|
42
42
|
self.search = search
|
|
43
43
|
self.labels = labels or {}
|
|
44
44
|
self.mappings = mappings or {}
|
|
@@ -116,7 +116,7 @@ class DataCaster:
|
|
|
116
116
|
CacheMode = CacheMode # allow PathScheme.CacheMode instead of scheme.CacheMode
|
|
117
117
|
|
|
118
118
|
def __init__(self, name: str = None, *,
|
|
119
|
-
root: Path | str,
|
|
119
|
+
root: Path | str | list[str],
|
|
120
120
|
search: GuideScan,
|
|
121
121
|
labels: dict = None,
|
|
122
122
|
mappings: dict = None,
|
|
@@ -128,16 +128,24 @@ class DataCaster:
|
|
|
128
128
|
temp_cache=False, cache: Optional[CacheMode | bool] = True,
|
|
129
129
|
progress: dict | bool = None):
|
|
130
130
|
"""
|
|
131
|
-
Create data caster semantic parser for particularly structured files tree.
|
|
131
|
+
Create a data caster semantic parser for a particularly structured files tree.
|
|
132
132
|
::
|
|
133
133
|
tree -> [pattern] -> files -> [label] -> [filter] -> labeled
|
|
134
134
|
|
|
135
135
|
All parameters must be fully resolved (no name-based lookup).
|
|
136
|
-
For name-based construction (e.g.
|
|
137
|
-
factory in
|
|
136
|
+
For name-based construction (e.g. `DataCaster('ETH3D')`), use the
|
|
137
|
+
factory in `dataman` (e.g. ``dataman.create_caster``).
|
|
138
|
+
|
|
139
|
+
**Debug Mode**
|
|
140
|
+
There is a special "debug" mode, when instead of a root of the tree, a list of paths is provided.
|
|
141
|
+
That allows evaluating the labeling pipeline on a specific set of files
|
|
142
|
+
without the need for a full tree structure.
|
|
143
|
+
(`GuideScan.samples` may be used as such input if the scheme defines them)
|
|
144
|
+
In this case caching is always disabled.
|
|
138
145
|
"""
|
|
139
146
|
self.config = CasterConfig(
|
|
140
|
-
name=name, root=root,
|
|
147
|
+
name=name, root=root if isinstance(root, (Path, str)) else '',
|
|
148
|
+
search=search, labels=labels,
|
|
141
149
|
mappings=mappings, reverse=reverse, bundle=bundle,
|
|
142
150
|
filters=filters, sample=sample,
|
|
143
151
|
)
|
|
@@ -146,6 +154,11 @@ class DataCaster:
|
|
|
146
154
|
reverse=self.config.reverse, namespace=self.labeling_namespace)
|
|
147
155
|
self.categories = labeler.categories
|
|
148
156
|
self.bundle = self.config.bundle or []
|
|
157
|
+
|
|
158
|
+
if isinstance(root, list): # debug mode: evaluate labeling on explicit path samples
|
|
159
|
+
self.cached_pipe = self._files_list_pipeline(labeler, files=root, cache=False)
|
|
160
|
+
return
|
|
161
|
+
|
|
149
162
|
is_win = os.name == 'nt'
|
|
150
163
|
stages = [
|
|
151
164
|
CachedPipe.Source(self.config.search.scanner(self.root, is_win), 'wlk',
|
|
@@ -162,6 +175,25 @@ class DataCaster:
|
|
|
162
175
|
serial=PickleRelativePath(self.root, safe=False), progress=progress
|
|
163
176
|
)
|
|
164
177
|
|
|
178
|
+
def _files_list_pipeline(self, labeler: Labeler, files: list[str], cache: bool=False):
|
|
179
|
+
"""Create a pipeline for labeling a list of files"""
|
|
180
|
+
search = self.config.search
|
|
181
|
+
method = 'search' if search.method == 'end' else 'fullmatch'
|
|
182
|
+
|
|
183
|
+
def path_labels():
|
|
184
|
+
for p in files:
|
|
185
|
+
if (m := search.parse(p, method=method)) is not None:
|
|
186
|
+
yield m | {'path': p}
|
|
187
|
+
|
|
188
|
+
stages = [
|
|
189
|
+
CachedPipe.Source(path_labels(), 'files'),
|
|
190
|
+
CachedPipe.Map(labeler.processor, 'lbl', cfg=labeler.to_yaml()),
|
|
191
|
+
]
|
|
192
|
+
if self.config.filters:
|
|
193
|
+
stages.append(CachedPipe.Filter(Filter(self.config.filters), 'flt',
|
|
194
|
+
cfg=yaml.dump(self.config.filters)))
|
|
195
|
+
return CachedPipe(stages=stages, folder=Path('.'), mode=CacheMode(cache))
|
|
196
|
+
|
|
165
197
|
@property
|
|
166
198
|
def labeling_namespace(self):
|
|
167
199
|
from iad.core.strings import hash_str
|
|
@@ -181,6 +213,8 @@ class DataCaster:
|
|
|
181
213
|
|
|
182
214
|
@property
|
|
183
215
|
def root(self):
|
|
216
|
+
if not self.config.root:
|
|
217
|
+
raise RuntimeError(f"Root path is not set for caster '{self.config.name}'")
|
|
184
218
|
return self.config.root
|
|
185
219
|
|
|
186
220
|
def __repr__(self):
|
|
@@ -58,6 +58,11 @@ class GuideScan(YamlModel, hash_exclude=['_pather', '_match_skip_folders']):
|
|
|
58
58
|
_pather: PrivateAttr = PrivateAttr()
|
|
59
59
|
_match_skip_folders: PrivateAttr = PrivateAttr()
|
|
60
60
|
|
|
61
|
+
@property
|
|
62
|
+
def parse(self):
|
|
63
|
+
"""Parse a string into labels using the pattern (shortcut to internal parse function)"""
|
|
64
|
+
return self._pather.regex.parse
|
|
65
|
+
|
|
61
66
|
def verify_samples(self, fail=False):
|
|
62
67
|
"""Return list of sample failed parsing"""
|
|
63
68
|
total = self.samples and len(self.samples) or 0
|
|
@@ -222,16 +222,20 @@ def apply_column_transform(df: pd.Series | pd.DataFrame, *,
|
|
|
222
222
|
except:
|
|
223
223
|
return fallback(g)
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
# These are deliberate writes into the working frame; suppress the
|
|
226
|
+
# false-positive SettingWithCopyWarning when the caller passed a frame
|
|
227
|
+
# that pandas flags as a copy-of-slice (e.g. a `.qix()`/`.select()` result).
|
|
228
|
+
with pd.option_context('mode.chained_assignment', None):
|
|
229
|
+
df_out.loc[:, out] = df_out.apply(func, axis=1)
|
|
226
230
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
if drop is True:
|
|
232
|
+
drop = set(inputs) - {out} | {trans}
|
|
233
|
+
if drop:
|
|
234
|
+
if not inplace:
|
|
235
|
+
df.drop(drop, axis=1, inplace=True) # drop used columns in the original df, if returning new df
|
|
236
|
+
return df_out.drop(drop, axis=1)
|
|
237
|
+
df_out.drop(drop, axis=1, inplace=True) # drop used columns in the inplace df
|
|
238
|
+
return df_out
|
|
235
239
|
|
|
236
240
|
|
|
237
241
|
def row_func_prepend_transform(fnc: Callable, trans=Col.read_trans, inp=Col.path, out=Col.data):
|
|
@@ -533,7 +537,7 @@ class Fetchable:
|
|
|
533
537
|
trans_labels = [Col.path, Col.read_trans]
|
|
534
538
|
|
|
535
539
|
if self.empty:
|
|
536
|
-
self['data'] = None
|
|
540
|
+
self.loc[:, 'data'] = None
|
|
537
541
|
return self
|
|
538
542
|
|
|
539
543
|
if not isinstance(self, pd.DataFrame): # Series, must be already with data
|
|
@@ -551,7 +555,10 @@ class Fetchable:
|
|
|
551
555
|
if reuse or check_file: # change to conditional read if required
|
|
552
556
|
kws = {'check_file': check_file} | (reuse and {'check_data': reuse} or {})
|
|
553
557
|
trans = '__cond_trans__'
|
|
554
|
-
self
|
|
558
|
+
# Deliberate write into self (fetch documents in-place data loading);
|
|
559
|
+
# suppress the false-positive copy-of-slice warning.
|
|
560
|
+
with pd.option_context('mode.chained_assignment', None):
|
|
561
|
+
self.loc[:, trans] = O(cond_read_trans, **kws)
|
|
555
562
|
trans_args = dict(drop=trans, args='series', inp=None) # series with all columns
|
|
556
563
|
else:
|
|
557
564
|
trans = Col.read_trans
|
|
@@ -20,12 +20,17 @@ def create_caster(name_or_dataset=None, *, source=None, scheme=None,
|
|
|
20
20
|
|
|
21
21
|
create_caster('ETH3D')
|
|
22
22
|
create_caster(source='/data/ETH3D', scheme='ETH3D')
|
|
23
|
+
create_caster(scheme='/path/to/scheme.scm.yml', source='/data/root')
|
|
23
24
|
create_caster(DatasetRM(source='/', scheme='*'))
|
|
24
25
|
|
|
25
26
|
:returns: a fully-constructed DataCaster
|
|
26
27
|
"""
|
|
27
|
-
from .models import DatasetRM
|
|
28
|
+
from .models import DatasetRM, SchemeRM
|
|
28
29
|
from .datacast.caster import DataCaster
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
|
|
32
|
+
if isinstance(scheme, (str, Path)):
|
|
33
|
+
scheme = SchemeRM.from_config(scheme)
|
|
29
34
|
|
|
30
35
|
config_args = dict(
|
|
31
36
|
name=name_or_dataset, source=source, scheme=scheme,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: verosnap
|
|
2
|
+
description: test scheme
|
|
3
|
+
bundle: [vru, session, capture_time]
|
|
4
|
+
search:
|
|
5
|
+
pattern: >-
|
|
6
|
+
vru{vru:\d+}/images/{session:[\w-]+}/{date:[0-9_]+}/(?:{view:cam\d+}|(?:obstacle_map/occupancy_(?P<alg>grid_processed|grid))|)_?[a-z0-9-]+(?:\.(?P<kind>meta))?\.(?P<ext>jpg|json)
|
|
7
|
+
|
|
8
|
+
method: relative
|
|
9
|
+
max_depth: 7
|
|
10
|
+
samples:
|
|
11
|
+
- vru16/images/2026-05-10_12_16_26_b63303ca57/2026_05_10_08_33_23/obstacle_map/occupancy_grid_processed_e761f6da-2480-445d-8a5f-05408c4f3613.jpg
|
|
12
|
+
- vru16/images/2026-05-10_12_16_26_b63303ca57/2026_05_10_08_33_23/e761f6da-2480-445d-8a5f-05408c4f3613.meta.json
|
|
13
|
+
- vru16/images/2026-05-10_12_16_26_b63303ca57/2026_05_10_08_33_23/cam1_e761f6da-2480-445d-8a5f-05408c4f3613.jpg
|
|
14
|
+
- vru16/images/2026-05-10_12_16_26_b63303ca57/2026_05_10_08_33_23/obstacle_map/occupancy_grid_e761f6da-2480-445d-8a5f-05408c4f3613.jpg
|
|
15
|
+
|
|
16
|
+
mappings:
|
|
17
|
+
alg: { 'grid': detect, grid_processed: match}
|
|
18
|
+
|
|
19
|
+
if alg == 'detect' or alg == 'match':
|
|
20
|
+
view: bev
|
|
21
|
+
|
|
22
|
+
if view and 'cam' in view:
|
|
23
|
+
alg: cam
|
|
24
|
+
|
|
25
|
+
if ext == 'jpg':
|
|
26
|
+
kind: image
|
|
@@ -2,8 +2,11 @@ import os
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
import pytest
|
|
5
|
+
import yaml
|
|
5
6
|
|
|
6
|
-
from iad.dataman.datacast.caster import PickleRelativePath
|
|
7
|
+
from iad.dataman.datacast.caster import DataCaster, PickleRelativePath
|
|
8
|
+
from iad.dataman.factories import create_caster
|
|
9
|
+
from iad.dataman.models import SchemeRM
|
|
7
10
|
from iad.core.tbox import TBox
|
|
8
11
|
from iad.core.cache import Pickle, CacheInvalidError, CachedPipe, CacheMode
|
|
9
12
|
from iad.core.fs.paths import TransPath
|
|
@@ -155,6 +158,55 @@ def test_relative_pickle_serializer(pths_gen):
|
|
|
155
158
|
assert prp.add_root(pths_gen.file_path) == pths_gen.correct_path.__str__()
|
|
156
159
|
|
|
157
160
|
|
|
161
|
+
VEROSNAP_SCHEME_YAML = Path(__file__).parent / 'data/res/verosnap.scm.yml'
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
@pytest.fixture
|
|
165
|
+
def verosnap_scheme():
|
|
166
|
+
return SchemeRM.from_config(VEROSNAP_SCHEME_YAML)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def test_create_caster_from_scheme_yaml_path(tmp_path):
|
|
170
|
+
"""create_caster loads SchemeRM from a .scm.yml path and builds a DataCaster."""
|
|
171
|
+
caster = create_caster(scheme=VEROSNAP_SCHEME_YAML, source=tmp_path, cache=False)
|
|
172
|
+
assert caster.config.name == 'verosnap'
|
|
173
|
+
assert len(caster.config.search.samples) == 4
|
|
174
|
+
assert caster.config.mappings['alg']['grid'] == 'detect'
|
|
175
|
+
assert caster.root == tmp_path
|
|
176
|
+
|
|
177
|
+
caster_from_str = create_caster(scheme=str(VEROSNAP_SCHEME_YAML), source=tmp_path, cache=False)
|
|
178
|
+
assert caster_from_str.config.name == caster.config.name
|
|
179
|
+
assert caster_from_str.config.search.pattern == caster.config.search.pattern
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def test_debug_mode_verosnap_samples(verosnap_scheme):
|
|
183
|
+
"""DataCaster debug mode labels scheme samples without a dataset root."""
|
|
184
|
+
scheme = verosnap_scheme
|
|
185
|
+
samples = scheme.search.samples
|
|
186
|
+
caster = DataCaster(
|
|
187
|
+
name=scheme.name,
|
|
188
|
+
root=samples,
|
|
189
|
+
search=scheme.search,
|
|
190
|
+
labels=scheme.labels,
|
|
191
|
+
mappings=scheme.mappings,
|
|
192
|
+
bundle=scheme.bundle,
|
|
193
|
+
)
|
|
194
|
+
results = {lbs['path']: lbs for lbs in caster.iter()}
|
|
195
|
+
assert set(results) == set(samples)
|
|
196
|
+
expected = {
|
|
197
|
+
samples[0]: dict(vru='16', session=samples[0].split('/')[2], alg='match', view='bev', kind='image', ext='jpg'),
|
|
198
|
+
samples[1]: dict(vru='16', session=samples[1].split('/')[2], kind='meta', ext='json'),
|
|
199
|
+
samples[2]: dict(vru='16', session=samples[2].split('/')[2], alg='cam', view='cam1', kind='image', ext='jpg'),
|
|
200
|
+
samples[3]: dict(vru='16', session=samples[3].split('/')[2], alg='detect', view='bev', kind='image', ext='jpg'),
|
|
201
|
+
}
|
|
202
|
+
for path, exp in expected.items():
|
|
203
|
+
lbs = results[path]
|
|
204
|
+
for key, value in exp.items():
|
|
205
|
+
assert lbs[key] == value, f"{path}: {key}={lbs.get(key)!r}, expected {value!r}"
|
|
206
|
+
assert lbs['path'] == path
|
|
207
|
+
assert 'date' in lbs
|
|
208
|
+
|
|
209
|
+
|
|
158
210
|
def test_piped_relative_pickle_serializer_(pths_gen):
|
|
159
211
|
"""
|
|
160
212
|
Tests relative pickle behaviour when utilizes threw the caching mechanism.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/src/iad/dataman/pydantools/fixed_pydantic_yaml/main.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datacast/data/datasets/toy/datasource.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/datasets/data/datasets/toy/datasource.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/__init__.py
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/recursive.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_basic.py
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_io.py
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_resursive.py
RENAMED
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_sorting.py
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_types.py
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/test_versioned.py
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/pydantools/fixed_pydantic_yaml/versioned.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/bench/tiny/metrics_94362.hdf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/calib.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/im0.jpg
RENAMED
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/Piano/im1.jpg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/data/tiny_stereo/datasource.yml
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/benchmarks/tiny.bmk.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/datasets/tiny.ds.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/labels.yml
RENAMED
|
File without changes
|
{ialdev_dataman-0.2.4 → ialdev_dataman-0.2.6}/tests/test_resources/resources/schemes/tiny.scm.yml
RENAMED
|
File without changes
|
|
File without changes
|