datamaestro 1.4.1__py3-none-any.whl → 1.4.3__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.
- datamaestro/definitions.py +28 -25
- datamaestro/record.py +11 -2
- datamaestro/version.py +2 -2
- {datamaestro-1.4.1.dist-info → datamaestro-1.4.3.dist-info}/METADATA +1 -1
- {datamaestro-1.4.1.dist-info → datamaestro-1.4.3.dist-info}/RECORD +9 -9
- {datamaestro-1.4.1.dist-info → datamaestro-1.4.3.dist-info}/WHEEL +1 -1
- {datamaestro-1.4.1.dist-info → datamaestro-1.4.3.dist-info}/entry_points.txt +0 -0
- {datamaestro-1.4.1.dist-info → datamaestro-1.4.3.dist-info}/licenses/LICENSE +0 -0
- {datamaestro-1.4.1.dist-info → datamaestro-1.4.3.dist-info}/top_level.txt +0 -0
datamaestro/definitions.py
CHANGED
|
@@ -381,33 +381,36 @@ class DatasetWrapper(AbstractDataset):
|
|
|
381
381
|
if self.base is self.t:
|
|
382
382
|
self.config = self.base.__create_dataset__(self)
|
|
383
383
|
|
|
384
|
-
# Construct the object
|
|
385
|
-
resources = {key: value.prepare() for key, value in self.resources.items()}
|
|
386
|
-
|
|
387
|
-
result = self.t(**resources)
|
|
388
|
-
|
|
389
|
-
# Download resources
|
|
390
|
-
logging.debug("Building with data type %s and dataset %s", self.base, self.t)
|
|
391
|
-
for hook in self.hooks["pre-use"]:
|
|
392
|
-
hook(self)
|
|
393
|
-
|
|
394
|
-
if result is None:
|
|
395
|
-
name = self.t.__name__
|
|
396
|
-
filename = inspect.getfile(self.t)
|
|
397
|
-
raise Exception(
|
|
398
|
-
f"The dataset method {name} defined in "
|
|
399
|
-
f"{filename} returned a null object"
|
|
400
|
-
)
|
|
401
|
-
|
|
402
|
-
if isinstance(result, dict):
|
|
403
|
-
self.config = self.base(**result)
|
|
404
|
-
elif isinstance(result, self.base):
|
|
405
|
-
self.config = result
|
|
406
384
|
else:
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
385
|
+
# Construct the object
|
|
386
|
+
resources = {key: value.prepare() for key, value in self.resources.items()}
|
|
387
|
+
|
|
388
|
+
result = self.t(**resources)
|
|
389
|
+
|
|
390
|
+
# Download resources
|
|
391
|
+
logging.debug(
|
|
392
|
+
"Building with data type %s and dataset %s", self.base, self.t
|
|
410
393
|
)
|
|
394
|
+
for hook in self.hooks["pre-use"]:
|
|
395
|
+
hook(self)
|
|
396
|
+
|
|
397
|
+
if result is None:
|
|
398
|
+
name = self.t.__name__
|
|
399
|
+
filename = inspect.getfile(self.t)
|
|
400
|
+
raise Exception(
|
|
401
|
+
f"The dataset method {name} defined in "
|
|
402
|
+
f"{filename} returned a null object"
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
if isinstance(result, dict):
|
|
406
|
+
self.config = self.base.C(**result)
|
|
407
|
+
elif isinstance(result, self.base):
|
|
408
|
+
self.config = result
|
|
409
|
+
else:
|
|
410
|
+
raise RuntimeError(
|
|
411
|
+
f"The dataset method {name} defined in "
|
|
412
|
+
f"{filename} returned an object of type {type(dict)}"
|
|
413
|
+
)
|
|
411
414
|
|
|
412
415
|
# Setup ourself
|
|
413
416
|
self.config.__datamaestro_dataset__ = self
|
datamaestro/record.py
CHANGED
|
@@ -160,11 +160,20 @@ class Record:
|
|
|
160
160
|
def __getitem__(self, key: Type[T]) -> T:
|
|
161
161
|
"""Get an item given its type"""
|
|
162
162
|
base = key.__get_base__()
|
|
163
|
-
|
|
163
|
+
try:
|
|
164
|
+
entry = self.items[base]
|
|
165
|
+
except KeyError:
|
|
166
|
+
raise KeyError(
|
|
167
|
+
f"""No entry with type {key}: """
|
|
168
|
+
f"""{",".join(str(s) for s in self.items.keys())}"""
|
|
169
|
+
)
|
|
164
170
|
|
|
165
171
|
# Check if this matches the expected class
|
|
166
172
|
if not isinstance(entry, key):
|
|
167
|
-
raise KeyError(
|
|
173
|
+
raise KeyError(
|
|
174
|
+
f"""No entry with type {key}: """
|
|
175
|
+
f"""{",".join(str(s) for s in self.items.keys())}"""
|
|
176
|
+
)
|
|
168
177
|
return entry
|
|
169
178
|
|
|
170
179
|
def update(self, *items: T, target: RecordType = None) -> "Record":
|
datamaestro/version.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
datamaestro/__init__.py,sha256=LR8nx7H3Fo97O0gJXV2PxQezsmSTDLAg_nQEXB5QAjc,322
|
|
2
2
|
datamaestro/__main__.py,sha256=2p36ZcJcZAL9NZBUkMaYRUhKyqhheVPXMGw6K1KNwhk,9196
|
|
3
3
|
datamaestro/context.py,sha256=KsXYNTt4xX4zEVrnd2hciP7PVCh1StRzjU1Ih6VeCtU,13532
|
|
4
|
-
datamaestro/definitions.py,sha256=
|
|
5
|
-
datamaestro/record.py,sha256=
|
|
4
|
+
datamaestro/definitions.py,sha256=eaBieK0btJBkrp9h3xARC4SC-FiOcDyLh-RxnWD7kJs,18963
|
|
5
|
+
datamaestro/record.py,sha256=IxxcrSIf99iluohtpnuMBTFkqeHRe5S-T_hWEqBgeME,5812
|
|
6
6
|
datamaestro/registry.py,sha256=M7QJkcWJP_cxAoqIioLQ01ou2Zg9RqGQvW0XGVspYFE,1421
|
|
7
7
|
datamaestro/search.py,sha256=bRT-91-2VJJ2JSfNaS1mzaVfqq_HMVBVs-RBj0w-ypM,2906
|
|
8
8
|
datamaestro/settings.py,sha256=HYSElTUYZ6DZocBb9o3ifm6WW9knRO64XJUwxGIpvwQ,1304
|
|
9
9
|
datamaestro/sphinx.py,sha256=bp7x_2BFoTSwTqcVZDM8R8cWa7G2pz0Zb8GS054lLYM,6996
|
|
10
10
|
datamaestro/utils.py,sha256=9m-AVVww6InAZfGFiGy6XJzfExpYNqH1fhWQEezjafA,6536
|
|
11
|
-
datamaestro/version.py,sha256=
|
|
11
|
+
datamaestro/version.py,sha256=uWjnlZlgd9LaZgshHJh7ATRsNToqJlu-hyova-D62E0,511
|
|
12
12
|
datamaestro/annotations/__init__.py,sha256=jLprrxSBa5QIqc--vqycEcxU4CR9WjVNRaqR5lH0EuE,39
|
|
13
13
|
datamaestro/annotations/agreement.py,sha256=xEH0ddZxdJ_oG_150PoOa-WjY_OaeQja3FzMzY5IB6k,955
|
|
14
14
|
datamaestro/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -40,9 +40,9 @@ datamaestro/test/conftest.py,sha256=it4S5Qq1CA_U8qM0pr4m7v-1dhLj5Y49WjVg5Ee3mpM,
|
|
|
40
40
|
datamaestro/test/test_annotations.py,sha256=XUjDWb3FJimSD91wcItJ0lLwTBmvN4wVu_EgTKSvV2c,278
|
|
41
41
|
datamaestro/test/test_download_handlers.py,sha256=-Gofr89zqIyeI8C4rZqfYR3JfiZVImdcSz9s6q361zQ,641
|
|
42
42
|
datamaestro/test/test_record.py,sha256=hNZ3uo2i5FZ0VsOHRwvLO1Z6Zce92PdipAF65UptPB8,1156
|
|
43
|
-
datamaestro-1.4.
|
|
44
|
-
datamaestro-1.4.
|
|
45
|
-
datamaestro-1.4.
|
|
46
|
-
datamaestro-1.4.
|
|
47
|
-
datamaestro-1.4.
|
|
48
|
-
datamaestro-1.4.
|
|
43
|
+
datamaestro-1.4.3.dist-info/licenses/LICENSE,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
|
|
44
|
+
datamaestro-1.4.3.dist-info/METADATA,sha256=ZXU8804YcxPh_GwhdxzPN5D6pCwrRJrF5l5Pk8hOHrs,8189
|
|
45
|
+
datamaestro-1.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
46
|
+
datamaestro-1.4.3.dist-info/entry_points.txt,sha256=8qMhwSRvFG2iBqtJYVD22Zd4s4c3YkODtcp0Ajw1knw,133
|
|
47
|
+
datamaestro-1.4.3.dist-info/top_level.txt,sha256=XSznaMNAA8jELV7-TOqaAgDsjLzUf9G9MxL7C4helT0,12
|
|
48
|
+
datamaestro-1.4.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|