datamaestro 1.5.0__py3-none-any.whl → 1.5.2__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/__init__.py +1 -1
- datamaestro/__main__.py +0 -0
- datamaestro/context.py +10 -3
- datamaestro/definitions.py +11 -1
- datamaestro/version.py +4 -21
- {datamaestro-1.5.0.dist-info → datamaestro-1.5.2.dist-info}/METADATA +18 -48
- {datamaestro-1.5.0.dist-info → datamaestro-1.5.2.dist-info}/RECORD +9 -10
- {datamaestro-1.5.0.dist-info → datamaestro-1.5.2.dist-info}/WHEEL +1 -2
- datamaestro-1.5.0.dist-info/top_level.txt +0 -1
- {datamaestro-1.5.0.dist-info → datamaestro-1.5.2.dist-info}/entry_points.txt +0 -0
- {datamaestro-1.5.0.dist-info → datamaestro-1.5.2.dist-info}/licenses/LICENSE +0 -0
datamaestro/__init__.py
CHANGED
datamaestro/__main__.py
CHANGED
|
File without changes
|
datamaestro/context.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from typing import Iterable, Iterator, Dict, Union
|
|
2
|
+
from typing import Iterable, Iterator, Dict, Optional, Union
|
|
3
3
|
import importlib
|
|
4
4
|
import os
|
|
5
5
|
import hashlib
|
|
@@ -423,16 +423,23 @@ def find_dataset(dataset_id: str):
|
|
|
423
423
|
return AbstractDataset.find(dataset_id)
|
|
424
424
|
|
|
425
425
|
|
|
426
|
-
def prepare_dataset(
|
|
426
|
+
def prepare_dataset(
|
|
427
|
+
dataset_id: Union[str, "DatasetWrapper", Config],
|
|
428
|
+
context: Optional[Union[Context, Path]] = None,
|
|
429
|
+
):
|
|
427
430
|
"""Find a dataset given its id and download the resources"""
|
|
428
431
|
from .definitions import AbstractDataset, DatasetWrapper
|
|
429
432
|
|
|
433
|
+
match context:
|
|
434
|
+
case Path() | str():
|
|
435
|
+
context = Context(Path(context))
|
|
436
|
+
|
|
430
437
|
if isinstance(dataset_id, DatasetWrapper):
|
|
431
438
|
ds = dataset_id
|
|
432
439
|
elif isinstance(dataset_id, Config):
|
|
433
440
|
ds = dataset_id.__datamaestro_dataset__
|
|
434
441
|
else:
|
|
435
|
-
ds = AbstractDataset.find(dataset_id)
|
|
442
|
+
ds = AbstractDataset.find(dataset_id, context=context)
|
|
436
443
|
|
|
437
444
|
return ds.prepare(download=True)
|
|
438
445
|
|
datamaestro/definitions.py
CHANGED
|
@@ -204,6 +204,14 @@ class AbstractDataset(AbstractData):
|
|
|
204
204
|
from datamaestro.data import Base
|
|
205
205
|
|
|
206
206
|
if isinstance(data, Base):
|
|
207
|
+
try:
|
|
208
|
+
if data.id:
|
|
209
|
+
# There is already an ID, skip this
|
|
210
|
+
# and the descendants
|
|
211
|
+
return
|
|
212
|
+
except KeyError:
|
|
213
|
+
pass
|
|
214
|
+
|
|
207
215
|
if self.repository is None:
|
|
208
216
|
data.id = id
|
|
209
217
|
else:
|
|
@@ -228,10 +236,12 @@ class AbstractDataset(AbstractData):
|
|
|
228
236
|
return success
|
|
229
237
|
|
|
230
238
|
@staticmethod
|
|
231
|
-
def find(name: str) -> "DataDefinition":
|
|
239
|
+
def find(name: str, context: Optional["Context"] = None) -> "DataDefinition":
|
|
232
240
|
"""Find a dataset given its name"""
|
|
233
241
|
from datamaestro.context import Context # noqa: F811
|
|
234
242
|
|
|
243
|
+
context = Context.instance() if context is None else context
|
|
244
|
+
|
|
235
245
|
logging.debug("Searching dataset %s", name)
|
|
236
246
|
for repository in Context.instance().repositories():
|
|
237
247
|
logging.debug("Searching dataset %s in %s", name, repository)
|
datamaestro/version.py
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
# file generated by
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
TYPE_CHECKING = False
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from typing import Tuple
|
|
9
|
-
from typing import Union
|
|
10
|
-
|
|
11
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
12
|
-
else:
|
|
13
|
-
VERSION_TUPLE = object
|
|
14
|
-
|
|
15
|
-
version: str
|
|
16
|
-
__version__: str
|
|
17
|
-
__version_tuple__: VERSION_TUPLE
|
|
18
|
-
version_tuple: VERSION_TUPLE
|
|
19
|
-
|
|
20
|
-
__version__ = version = '1.5.0'
|
|
21
|
-
__version_tuple__ = version_tuple = (1, 5, 0)
|
|
1
|
+
# This file is auto-generated by Hatchling. As such, do not:
|
|
2
|
+
# - modify
|
|
3
|
+
# - track in version control e.g. be sure to add to .gitignore
|
|
4
|
+
__version__ = VERSION = '1.5.2'
|
|
@@ -1,42 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datamaestro
|
|
3
|
-
Version: 1.5.
|
|
4
|
-
Summary:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Author-email: benjamin@piwowarski.fr
|
|
8
|
-
License: GPL-3
|
|
9
|
-
Keywords: dataset manager
|
|
10
|
-
Platform: any
|
|
3
|
+
Version: 1.5.2
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author-email: Benjamin Piwowarski <benjamin@piwowarski.fr>
|
|
6
|
+
License-File: LICENSE
|
|
11
7
|
Classifier: Development Status :: 4 - Beta
|
|
12
8
|
Classifier: Intended Audience :: Science/Research
|
|
13
9
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
14
10
|
Classifier: Operating System :: OS Independent
|
|
15
11
|
Classifier: Programming Language :: Python
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
13
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
-
Requires-Python: >=3.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Requires-Dist: click
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist: urllib3
|
|
26
|
-
Requires-Dist: marshmallow
|
|
27
|
-
Requires-Dist: cached_property
|
|
28
|
-
Requires-Dist: requests
|
|
29
|
-
Requires-Dist: bitmath
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Requires-Dist: bitmath>=1.3.3.1
|
|
16
|
+
Requires-Dist: cached-property>=2.0.1
|
|
17
|
+
Requires-Dist: click>=8.2.1
|
|
18
|
+
Requires-Dist: docstring-parser>=0.16
|
|
30
19
|
Requires-Dist: experimaestro>=1.8.9
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist: mkdocs
|
|
34
|
-
Requires-Dist: docstring_parser
|
|
20
|
+
Requires-Dist: marshmallow>=3.26.1
|
|
21
|
+
Requires-Dist: mkdocs-material>=9.6.15
|
|
22
|
+
Requires-Dist: mkdocs>=1.6.1
|
|
35
23
|
Requires-Dist: numpy
|
|
36
|
-
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
Requires-Dist: pymdown-extensions>=10.16
|
|
25
|
+
Requires-Dist: requests>=2.32.4
|
|
26
|
+
Requires-Dist: tqdm>=4.67.1
|
|
27
|
+
Requires-Dist: urllib3>=2.5.0
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
40
29
|
|
|
41
30
|
[](https://badge.fury.io/py/datamaestro) [](https://github.com/pre-commit/pre-commit) [](https://zenodo.org/badge/latestdoi/4573876)
|
|
42
31
|
|
|
@@ -192,22 +181,3 @@ This will allow to
|
|
|
192
181
|
|
|
193
182
|
1. Document the dataset
|
|
194
183
|
2. Allow to use the command line interface to manipulate it (download resources, etc.)
|
|
195
|
-
|
|
196
|
-
# 0.8.0
|
|
197
|
-
|
|
198
|
-
- Integration with other repositories: abstracting away the notion of dataset
|
|
199
|
-
- Repository prefix
|
|
200
|
-
- Set sub-datasets IDs automatically
|
|
201
|
-
|
|
202
|
-
# 0.7.3
|
|
203
|
-
|
|
204
|
-
- Updates for new experimaestro (0.8.5)
|
|
205
|
-
- Search types with "type:..."
|
|
206
|
-
|
|
207
|
-
# 0.6.17
|
|
208
|
-
|
|
209
|
-
- Allow remote access through rpyc
|
|
210
|
-
|
|
211
|
-
# 0.6.9
|
|
212
|
-
|
|
213
|
-
`version` command
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
datamaestro/__init__.py,sha256=
|
|
1
|
+
datamaestro/__init__.py,sha256=WA9Jrikg-1GcQ6TRezV0qBAv7wQfsfRLdtBwzEWQE6Q,311
|
|
2
2
|
datamaestro/__main__.py,sha256=2p36ZcJcZAL9NZBUkMaYRUhKyqhheVPXMGw6K1KNwhk,9196
|
|
3
|
-
datamaestro/context.py,sha256=
|
|
4
|
-
datamaestro/definitions.py,sha256
|
|
3
|
+
datamaestro/context.py,sha256=kVbChQy2Nr7Z0Jz9Qbz8AC-XCAIes50SIpROwez910k,13712
|
|
4
|
+
datamaestro/definitions.py,sha256=-9rKgFxqn103HslqWLovq4EdoSkJmx9FNTKneLGBfTo,19812
|
|
5
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=nuWd41kVXDQdWyAwYcshPXgiAAgKAIVDM6QbgRkd4GE,171
|
|
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,8 @@ 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.5.
|
|
44
|
-
datamaestro-1.5.
|
|
45
|
-
datamaestro-1.5.
|
|
46
|
-
datamaestro-1.5.
|
|
47
|
-
datamaestro-1.5.
|
|
48
|
-
datamaestro-1.5.0.dist-info/RECORD,,
|
|
43
|
+
datamaestro-1.5.2.dist-info/METADATA,sha256=hHB6tXBNZjirZXG7II5ff3bovHhoig1I51JGIImnHkw,7635
|
|
44
|
+
datamaestro-1.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
45
|
+
datamaestro-1.5.2.dist-info/entry_points.txt,sha256=8qMhwSRvFG2iBqtJYVD22Zd4s4c3YkODtcp0Ajw1knw,133
|
|
46
|
+
datamaestro-1.5.2.dist-info/licenses/LICENSE,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
|
|
47
|
+
datamaestro-1.5.2.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
datamaestro
|
|
File without changes
|
|
File without changes
|