pipelime-python 1.9.0__tar.gz → 2.0.0__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.
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/PKG-INFO +10 -10
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/README.md +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/__init__.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/ast/nodes.py +3 -3
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/utils/io.py +4 -3
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/visitors/decoder.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/main.py +68 -4
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/pretty_print.py +10 -10
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/tui/tui.css +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/tui/tui.py +22 -18
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/tui/utils.py +2 -2
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/utils.py +7 -7
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/__init__.py +13 -15
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/general.py +26 -142
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/interfaces.py +34 -107
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/piper.py +10 -2
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/resume.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/shell.py +5 -5
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/split_ops.py +38 -38
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/tempman.py +13 -9
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/commands/toy_dataset.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/base.py +25 -138
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/checkpoint.py +5 -4
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/drawing/mermaid.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/executors/base.py +2 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/executors/factory.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/model.py +9 -8
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/model.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/grabber.py +61 -7
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/pipes/base.py +3 -2
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/pipes/mapping.py +2 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/pipes/operations.py +5 -4
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/pipes/validation.py +3 -3
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/pipes/writers.py +2 -2
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/samples_sequence.py +22 -6
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/sources/from_callable.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/sources/raw.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/sources/readers.py +53 -2
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/sources/toy_dataset.py +7 -6
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/utils.py +7 -7
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/__init__.py +13 -10
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/augmentations.py +2 -2
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/base.py +1 -1
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/entities.py +9 -8
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/item_info.py +2 -2
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/item_replacement.py +3 -3
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/item_sources.py +3 -24
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/stages/key_transformations.py +1 -1
- pipelime_python-2.0.0/pipelime/utils/deprecated.py +51 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/utils/pydantic_types.py +10 -7
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pyproject.toml +14 -34
- pipelime_python-1.9.0/pipelime/remotes/__init__.py +0 -5
- pipelime_python-1.9.0/pipelime/remotes/base.py +0 -415
- pipelime_python-1.9.0/pipelime/remotes/s3_remote.py +0 -184
- pipelime_python-1.9.0/pipelime/remotes/shared_folder_remote.py +0 -144
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/.gitignore +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/LICENSE +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/ast/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/ast/parser.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/utils/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/utils/common.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/utils/imports.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/utils/rand.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/visitors/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/visitors/inspector.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/visitors/processor.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/visitors/processor_ui.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/visitors/unparser.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/visitors/walker.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/choixe/xconfig.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/parser.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/subcommands.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/cli/tui/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/binary_item.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/image_item.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/metadata_item.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/model3d_item.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/numpy_item.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/items/pickle_item.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/drawing/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/drawing/base.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/drawing/factory.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/drawing/graphviz.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/executors/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/executors/naive.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/graph.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/parsers/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/parsers/base.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/parsers/choixe_parser.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/parsers/factory.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/estimator/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/estimator/base.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/estimator/factory.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/estimator/naive.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/base.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/callbacks/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/callbacks/file.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/callbacks/rich_table.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/callbacks/tqdm_bars.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/factory.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/receiver/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/listener/receiver/zmq.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/tracker/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/tracker/base.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/tracker/direct.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/tracker/factory.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/tracker/loguru.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/piper/progress/tracker/zmq.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/direct_access.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/pipes/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/sample.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/sources/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/sequences/torch.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/utils/__init__.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/utils/context_managers.py +0 -0
- {pipelime_python-1.9.0 → pipelime_python-2.0.0}/pipelime/utils/inspection.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pipelime-python
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Data workflows, cli and dataflow automation.
|
|
5
5
|
Project-URL: Source, https://github.com/eyecan-ai/pipelime-python
|
|
6
6
|
Project-URL: Issues, https://github.com/eyecan-ai/pipelime-python/issues
|
|
@@ -16,23 +16,22 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
|
16
16
|
Classifier: Natural Language :: English
|
|
17
17
|
Classifier: Operating System :: OS Independent
|
|
18
18
|
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
21
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering
|
|
23
23
|
Classifier: Topic :: Software Development
|
|
24
|
-
Requires-Python:
|
|
24
|
+
Requires-Python: <3.13,>=3.10
|
|
25
25
|
Requires-Dist: albumentations>=1.0.0
|
|
26
26
|
Requires-Dist: astunparse
|
|
27
|
-
Requires-Dist: billiard
|
|
28
27
|
Requires-Dist: deepdiff
|
|
29
28
|
Requires-Dist: dictquery
|
|
30
29
|
Requires-Dist: filelock
|
|
31
|
-
Requires-Dist: imageio>=2.17.0
|
|
30
|
+
Requires-Dist: imageio[ffmpeg,pyav]>=2.17.0
|
|
32
31
|
Requires-Dist: loguru
|
|
33
|
-
Requires-Dist:
|
|
32
|
+
Requires-Dist: networkx
|
|
34
33
|
Requires-Dist: numpy
|
|
35
|
-
Requires-Dist: pydantic<
|
|
34
|
+
Requires-Dist: pydantic<3,>=1.10.17
|
|
36
35
|
Requires-Dist: pydash
|
|
37
36
|
Requires-Dist: python-box
|
|
38
37
|
Requires-Dist: pyyaml
|
|
@@ -64,6 +63,7 @@ Provides-Extra: tests
|
|
|
64
63
|
Requires-Dist: pytest; extra == 'tests'
|
|
65
64
|
Requires-Dist: pytest-asyncio; extra == 'tests'
|
|
66
65
|
Requires-Dist: pytest-cov; extra == 'tests'
|
|
66
|
+
Requires-Dist: tox; extra == 'tests'
|
|
67
67
|
Description-Content-Type: text/markdown
|
|
68
68
|
|
|
69
69
|
|
|
@@ -79,7 +79,7 @@ Description-Content-Type: text/markdown
|
|
|
79
79
|
Welcome to **pipelime**, a swiss army knife for data processing!
|
|
80
80
|
|
|
81
81
|
`pipelime` is a full-fledge **framework** for **data science**: read your datasets,
|
|
82
|
-
manipulate them
|
|
82
|
+
manipulate them and write back to disk.
|
|
83
83
|
Then build up your **dataflow** with Piper and manage the configuration with Choixe.
|
|
84
84
|
Finally, **embed** your custom commands into the `pipelime` workspace, to act both as dataflow nodes and advanced command line interface.
|
|
85
85
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
Welcome to **pipelime**, a swiss army knife for data processing!
|
|
12
12
|
|
|
13
13
|
`pipelime` is a full-fledge **framework** for **data science**: read your datasets,
|
|
14
|
-
manipulate them
|
|
14
|
+
manipulate them and write back to disk.
|
|
15
15
|
Then build up your **dataflow** with Piper and manage the configuration with Choixe.
|
|
16
16
|
Finally, **embed** your custom commands into the `pipelime` workspace, to act both as dataflow nodes and advanced command line interface.
|
|
17
17
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
|
+
from dataclasses import field
|
|
4
5
|
from typing import Any, Dict, Optional, Sequence, Tuple, Union
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
from pydantic.dataclasses import dataclass
|
|
7
|
+
from pydantic.v1.dataclasses import dataclass
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class NodeVisitor: # pragma: no cover
|
|
@@ -336,7 +336,7 @@ class RandNode(Node):
|
|
|
336
336
|
|
|
337
337
|
args: Sequence[HashNode] = tuple()
|
|
338
338
|
n: Optional[Node] = None
|
|
339
|
-
pdf: Optional[Node] = None
|
|
339
|
+
pdf: Optional[Node] = field(default=None, compare=False)
|
|
340
340
|
|
|
341
341
|
def __init__(self, *args: HashNode, **data) -> None:
|
|
342
342
|
super().__init__()
|
|
@@ -111,9 +111,9 @@ class PipelimeTmp:
|
|
|
111
111
|
|
|
112
112
|
user_dirs: Dict[str, List[str]] = {}
|
|
113
113
|
for d in iglob(str(PipelimeTmp.base_dir() / (PipelimeTmp.prefix() + "*"))):
|
|
114
|
-
if os.path.isdir(d):
|
|
114
|
+
if os.path.isdir(d): # pragma: no branch
|
|
115
115
|
names = os.path.basename(d).split("-")
|
|
116
|
-
if len(names) >= 3:
|
|
116
|
+
if len(names) >= 3: # pragma: no branch
|
|
117
117
|
user_dirs.setdefault(names[2], []).append(d)
|
|
118
118
|
return user_dirs
|
|
119
119
|
|
|
@@ -135,7 +135,8 @@ class PipelimeTemporaryDirectory:
|
|
|
135
135
|
import shutil
|
|
136
136
|
|
|
137
137
|
def onerror(func, path, exc_info):
|
|
138
|
-
|
|
138
|
+
# this code comes from TemporaryDirectory
|
|
139
|
+
if issubclass(exc_info[0], PermissionError): # pragma: no cover
|
|
139
140
|
|
|
140
141
|
def resetperms(path):
|
|
141
142
|
try:
|
|
@@ -6,7 +6,7 @@ import typing as t
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
|
-
from pydantic import BaseModel
|
|
9
|
+
from pydantic.v1 import BaseModel
|
|
10
10
|
|
|
11
11
|
from pipelime.choixe import XConfig
|
|
12
12
|
from pipelime.choixe.visitors.processor_ui import ProcessorUi
|
|
@@ -35,6 +35,7 @@ class PlCliOptions(BaseModel):
|
|
|
35
35
|
output_ctx: t.Optional[Path]
|
|
36
36
|
command_outputs: t.Optional[Path]
|
|
37
37
|
verbose: int
|
|
38
|
+
data_cache: t.Optional[str]
|
|
38
39
|
dry_run: bool
|
|
39
40
|
no_ui: bool
|
|
40
41
|
command: str
|
|
@@ -57,7 +58,57 @@ class PlCliOptions(BaseModel):
|
|
|
57
58
|
return data
|
|
58
59
|
|
|
59
60
|
|
|
60
|
-
def
|
|
61
|
+
def _set_logger_level(verbose: int):
|
|
62
|
+
"""Set the logger level if not forced by the user."""
|
|
63
|
+
import os
|
|
64
|
+
import sys
|
|
65
|
+
|
|
66
|
+
from loguru import logger
|
|
67
|
+
|
|
68
|
+
if "LOGURU_LEVEL" not in os.environ:
|
|
69
|
+
if verbose == 0:
|
|
70
|
+
level = "WARNING"
|
|
71
|
+
elif verbose == 1:
|
|
72
|
+
level = "INFO"
|
|
73
|
+
elif verbose == 2:
|
|
74
|
+
level = "DEBUG"
|
|
75
|
+
else:
|
|
76
|
+
level = "TRACE"
|
|
77
|
+
logger.remove()
|
|
78
|
+
logger.add(sys.stderr, level=level)
|
|
79
|
+
|
|
80
|
+
# set the level in the environment so that it is inherited by subprocesses
|
|
81
|
+
os.environ["LOGURU_LEVEL"] = level
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _set_item_data_cache(data_cache: t.Optional[str]):
|
|
85
|
+
from loguru import logger
|
|
86
|
+
|
|
87
|
+
from pipelime.items import enable_item_data_cache
|
|
88
|
+
from pipelime.utils.pydantic_types import ItemType
|
|
89
|
+
|
|
90
|
+
item_list = (data_cache or "").replace(" ", "").split(",")
|
|
91
|
+
item_list = [i for i in item_list if i]
|
|
92
|
+
|
|
93
|
+
if not item_list:
|
|
94
|
+
return
|
|
95
|
+
|
|
96
|
+
if "*" in item_list:
|
|
97
|
+
logger.debug("Enabling data cache for all items.")
|
|
98
|
+
enable_item_data_cache()
|
|
99
|
+
else:
|
|
100
|
+
item_cls_list = []
|
|
101
|
+
for name in item_list:
|
|
102
|
+
try:
|
|
103
|
+
item_cls_list.append(ItemType.create(name).value)
|
|
104
|
+
except Exception:
|
|
105
|
+
logger.error(f"Item `{name}` not found.")
|
|
106
|
+
logger.debug(f"Enabling data cache for items: {item_cls_list}")
|
|
107
|
+
if item_cls_list:
|
|
108
|
+
enable_item_data_cache(*item_cls_list)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _complete_yaml(incomplete: str): # pragma: no cover
|
|
61
112
|
for v in Path(".").glob(f"{incomplete}*.yaml"):
|
|
62
113
|
yield str(v)
|
|
63
114
|
|
|
@@ -399,6 +450,13 @@ def pl_main(
|
|
|
399
450
|
resolve_path=True,
|
|
400
451
|
help="The checkpoint folder. If it already exists, it must be empty.",
|
|
401
452
|
),
|
|
453
|
+
data_cache: t.Optional[str] = typer.Option(
|
|
454
|
+
None,
|
|
455
|
+
help=(
|
|
456
|
+
"Comma-separated list of pipelime items for which to enable data cache. "
|
|
457
|
+
"Use the special `*` value to enable data cache for any item."
|
|
458
|
+
),
|
|
459
|
+
),
|
|
402
460
|
verbose: int = typer.Option(
|
|
403
461
|
0,
|
|
404
462
|
"--verbose",
|
|
@@ -468,6 +526,8 @@ def pl_main(
|
|
|
468
526
|
TRUE boolean values. Use `false` or `true` to explicitly set a boolean
|
|
469
527
|
and `none`/`null`/`nul` to enforce `None`.
|
|
470
528
|
"""
|
|
529
|
+
_set_logger_level(verbose)
|
|
530
|
+
|
|
471
531
|
PipelimeSymbolsHelper.set_extra_modules(extra_modules)
|
|
472
532
|
|
|
473
533
|
if command_args is None:
|
|
@@ -549,6 +609,7 @@ def pl_main(
|
|
|
549
609
|
output_ctx=output_ctx,
|
|
550
610
|
command_outputs=command_outputs,
|
|
551
611
|
verbose=verbose,
|
|
612
|
+
data_cache=data_cache,
|
|
552
613
|
dry_run=dry_run,
|
|
553
614
|
no_ui=no_ui,
|
|
554
615
|
command=command,
|
|
@@ -593,6 +654,7 @@ def run_with_checkpoint(
|
|
|
593
654
|
from pipelime.choixe import XConfig
|
|
594
655
|
from pipelime.cli.pretty_print import print_error, print_info, print_warning
|
|
595
656
|
|
|
657
|
+
_set_item_data_cache(cli_opts.data_cache)
|
|
596
658
|
PipelimeSymbolsHelper.set_extra_modules(cli_opts.extra_modules)
|
|
597
659
|
|
|
598
660
|
if cli_opts.pipelime_tmp:
|
|
@@ -780,7 +842,9 @@ def run_with_checkpoint(
|
|
|
780
842
|
|
|
781
843
|
cfg_size = len(effective_configs)
|
|
782
844
|
pls = "s" if cfg_size != 1 else ""
|
|
783
|
-
print_info(
|
|
845
|
+
print_info(
|
|
846
|
+
f"🎉 Configuration successfully processed ({cfg_size} variant{pls})."
|
|
847
|
+
)
|
|
784
848
|
|
|
785
849
|
if cli_opts.verbose > 2:
|
|
786
850
|
print_info("\nFinal effective configurations:")
|
|
@@ -854,7 +918,7 @@ def run_command(
|
|
|
854
918
|
|
|
855
919
|
import time
|
|
856
920
|
|
|
857
|
-
from pydantic.error_wrappers import ValidationError
|
|
921
|
+
from pydantic.v1.error_wrappers import ValidationError
|
|
858
922
|
|
|
859
923
|
from pipelime.choixe.utils.io import PipelimeTmp, dump
|
|
860
924
|
from pipelime.cli.pretty_print import print_command_outputs, print_info
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
import typing as t
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel
|
|
5
|
-
from rich import box
|
|
6
|
-
from rich.markup import escape
|
|
7
|
-
from rich import get_console
|
|
4
|
+
from pydantic.v1 import BaseModel
|
|
5
|
+
from rich import box, get_console
|
|
8
6
|
from rich import print as rprint
|
|
9
|
-
from rich.
|
|
10
|
-
from rich.table import Table, Column
|
|
7
|
+
from rich.markup import escape
|
|
11
8
|
from rich.panel import Panel
|
|
9
|
+
from rich.pretty import Pretty
|
|
10
|
+
from rich.table import Column, Table
|
|
12
11
|
|
|
13
12
|
if t.TYPE_CHECKING:
|
|
14
13
|
from pipelime.cli.utils import ActionInfo
|
|
@@ -421,12 +420,13 @@ def _is_model(type_):
|
|
|
421
420
|
|
|
422
421
|
def _human_readable_type(field_outer_type):
|
|
423
422
|
from enum import Enum
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
|
|
424
|
+
from pydantic.v1.typing import (
|
|
426
425
|
WithArgsTypes,
|
|
427
|
-
is_union,
|
|
428
|
-
get_origin,
|
|
429
426
|
get_args,
|
|
427
|
+
get_origin,
|
|
428
|
+
is_union,
|
|
429
|
+
typing_base, # noqa: F401 # type: ignore
|
|
430
430
|
)
|
|
431
431
|
|
|
432
432
|
v = field_outer_type
|
|
@@ -30,18 +30,16 @@ class Constants:
|
|
|
30
30
|
SUB_FIELD_MARGIN = (0, 0, 0, 4)
|
|
31
31
|
TUI_KEY_CONFIRM = Keys.ControlN
|
|
32
32
|
TUI_KEY_SAVE = Keys.ControlS
|
|
33
|
-
TUI_KEY_ABORT = Keys.
|
|
33
|
+
TUI_KEY_ABORT = Keys.ControlT
|
|
34
34
|
TUI_KEY_TOGGLE_DESCRIPTIONS = Keys.ControlJ
|
|
35
35
|
SAVE_KEY_CONFIRM = Keys.ControlS
|
|
36
36
|
SAVE_KEY_CANCEL = Keys.Escape
|
|
37
|
-
SAVE_KEY_ABORT = Keys.ControlC
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
class SaveScreen(ModalScreen):
|
|
41
40
|
BINDINGS = [
|
|
42
41
|
(Constants.SAVE_KEY_CONFIRM, "confirm", "Confirm"),
|
|
43
42
|
(Constants.SAVE_KEY_CANCEL, "cancel", "Cancel"),
|
|
44
|
-
(Constants.SAVE_KEY_ABORT, "ctrl_c", "Abort"),
|
|
45
43
|
]
|
|
46
44
|
HELP = "CTRL+S to confirm, ESC to cancel"
|
|
47
45
|
|
|
@@ -55,11 +53,14 @@ class SaveScreen(ModalScreen):
|
|
|
55
53
|
self.config = config
|
|
56
54
|
|
|
57
55
|
def compose(self) -> ComposeResult:
|
|
56
|
+
"""Compose the save screen."""
|
|
57
|
+
error_label = Label("", classes="error-label")
|
|
58
|
+
error_label.display = False
|
|
58
59
|
yield Container(
|
|
59
60
|
Label("Save path", classes="field-label"),
|
|
60
61
|
Input(""),
|
|
61
|
-
Label(SaveScreen.HELP),
|
|
62
|
-
|
|
62
|
+
Label(str(SaveScreen.HELP)),
|
|
63
|
+
error_label,
|
|
63
64
|
id="dialog",
|
|
64
65
|
)
|
|
65
66
|
|
|
@@ -85,17 +86,16 @@ class SaveScreen(ModalScreen):
|
|
|
85
86
|
except Exception as e:
|
|
86
87
|
error_label = self.query_one(".error-label")
|
|
87
88
|
error_label = cast(Label, error_label)
|
|
88
|
-
error_label.
|
|
89
|
-
|
|
89
|
+
error_label.display = True
|
|
90
|
+
error = str(e)
|
|
91
|
+
# escape the square brackets to avoid rich syntax
|
|
92
|
+
error = error.replace("[", r"\[") # noqa: W605
|
|
93
|
+
error_label.update(error)
|
|
90
94
|
|
|
91
95
|
def action_cancel(self) -> None:
|
|
92
96
|
"""Cancel the save."""
|
|
93
97
|
self.app.pop_screen()
|
|
94
98
|
|
|
95
|
-
def action_ctrl_c(self) -> None:
|
|
96
|
-
"""Propagate the KeyboardInterrupt exception."""
|
|
97
|
-
raise KeyboardInterrupt
|
|
98
|
-
|
|
99
99
|
|
|
100
100
|
class TuiApp(App[Mapping]):
|
|
101
101
|
"""A Textual app to handle Pipelime configurations."""
|
|
@@ -104,7 +104,7 @@ class TuiApp(App[Mapping]):
|
|
|
104
104
|
BINDINGS = [
|
|
105
105
|
(Constants.TUI_KEY_CONFIRM, "confirm", "Confirm"),
|
|
106
106
|
(Constants.TUI_KEY_SAVE, "save", "Save to file"),
|
|
107
|
-
(Constants.TUI_KEY_ABORT, "
|
|
107
|
+
(Constants.TUI_KEY_ABORT, "abort", "Abort"),
|
|
108
108
|
(
|
|
109
109
|
Constants.TUI_KEY_TOGGLE_DESCRIPTIONS,
|
|
110
110
|
"toggle_descriptions",
|
|
@@ -165,7 +165,9 @@ class TuiApp(App[Mapping]):
|
|
|
165
165
|
labels.append(Label(title, classes="title-label"))
|
|
166
166
|
if description:
|
|
167
167
|
description = TuiApp.preprocess_string(description)
|
|
168
|
-
|
|
168
|
+
label = Label(description, classes="title-label description")
|
|
169
|
+
label.display = True if self.show_descriptions else False
|
|
170
|
+
labels.append(label)
|
|
169
171
|
return labels
|
|
170
172
|
|
|
171
173
|
def create_simple_field(self, field: TuiField) -> List[Widget]:
|
|
@@ -186,7 +188,9 @@ class TuiApp(App[Mapping]):
|
|
|
186
188
|
description = field.description
|
|
187
189
|
descr = f"({field.type_}) {description}" if description else f"({field.type_})"
|
|
188
190
|
description = TuiApp.preprocess_string(descr)
|
|
189
|
-
|
|
191
|
+
label = Label(description, classes="description")
|
|
192
|
+
label.display = True if self.show_descriptions else False
|
|
193
|
+
widgets.append(label)
|
|
190
194
|
|
|
191
195
|
inp = Input(value=field.value, placeholder=field.hint)
|
|
192
196
|
widgets.append(inp)
|
|
@@ -275,8 +279,8 @@ class TuiApp(App[Mapping]):
|
|
|
275
279
|
save_screen = SaveScreen(self.collect_cmd_args())
|
|
276
280
|
self.push_screen(save_screen)
|
|
277
281
|
|
|
278
|
-
def
|
|
279
|
-
"""
|
|
282
|
+
def action_abort(self) -> None:
|
|
283
|
+
"""Raise KeyboardInterrupt exception."""
|
|
280
284
|
raise KeyboardInterrupt
|
|
281
285
|
|
|
282
286
|
def action_toggle_descriptions(self) -> None:
|
|
@@ -284,7 +288,7 @@ class TuiApp(App[Mapping]):
|
|
|
284
288
|
self.show_descriptions = not self.show_descriptions
|
|
285
289
|
query = self.query(".description")
|
|
286
290
|
for widget in query:
|
|
287
|
-
widget.
|
|
291
|
+
widget.display = True if self.show_descriptions else False
|
|
288
292
|
|
|
289
293
|
query = self.query(Input)
|
|
290
294
|
for widget in query:
|
|
@@ -315,7 +319,7 @@ class TuiApp(App[Mapping]):
|
|
|
315
319
|
replace_whitespace=False,
|
|
316
320
|
tabsize=4,
|
|
317
321
|
)
|
|
318
|
-
sub = sub.replace("[", "\[") # noqa: W605
|
|
322
|
+
sub = sub.replace("[", r"\[") # noqa: W605
|
|
319
323
|
preprocessed += sub + "\n"
|
|
320
324
|
|
|
321
325
|
preprocessed = preprocessed[:-1]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
2
|
from typing import List, Mapping, Tuple, Type, cast
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel
|
|
5
|
-
from pydantic.fields import ModelField
|
|
4
|
+
from pydantic.v1 import BaseModel
|
|
5
|
+
from pydantic.v1.fields import ModelField
|
|
6
6
|
|
|
7
7
|
from pipelime.cli.utils import PipelimeSymbolsHelper
|
|
8
8
|
from pipelime.piper import PipelimeCommand
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import os
|
|
3
|
+
import shutil
|
|
2
4
|
import typing as t
|
|
3
5
|
from ast import literal_eval
|
|
4
6
|
from json import JSONDecodeError
|
|
5
7
|
from pathlib import Path
|
|
6
8
|
from types import ModuleType
|
|
7
|
-
import shutil
|
|
8
9
|
|
|
9
10
|
import yaml
|
|
10
11
|
from loguru import logger
|
|
11
|
-
from pydantic import BaseModel, ValidationError
|
|
12
|
+
from pydantic.v1 import BaseModel, ValidationError
|
|
12
13
|
from rich import get_console
|
|
13
14
|
from rich.prompt import Prompt
|
|
14
15
|
from yaml.error import YAMLError
|
|
15
|
-
import os
|
|
16
16
|
|
|
17
17
|
if t.TYPE_CHECKING:
|
|
18
18
|
from pipelime.piper import T_DAG_NODE, PipelimeCommand
|
|
19
19
|
from pipelime.piper.checkpoint import CheckpointNamespace
|
|
20
|
-
from pipelime.stages import SampleStage
|
|
21
20
|
from pipelime.sequences import SamplesSequence
|
|
21
|
+
from pipelime.stages import SampleStage
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class ActionInfo(BaseModel):
|
|
@@ -108,7 +108,7 @@ class PipelimeSymbolsHelper:
|
|
|
108
108
|
|
|
109
109
|
@classmethod
|
|
110
110
|
def _symbol_name(cls, symbol):
|
|
111
|
-
from pydantic import BaseModel
|
|
111
|
+
from pydantic.v1 import BaseModel
|
|
112
112
|
|
|
113
113
|
return (
|
|
114
114
|
symbol.__config__.title
|
|
@@ -175,9 +175,9 @@ class PipelimeSymbolsHelper:
|
|
|
175
175
|
def import_everything(cls):
|
|
176
176
|
import pipelime.choixe.utils.imports as pl_imports
|
|
177
177
|
import pipelime.sequences as pl_seq
|
|
178
|
+
from pipelime.commands.piper import DagBaseCommand
|
|
178
179
|
from pipelime.piper import PipelimeCommand
|
|
179
180
|
from pipelime.stages import SampleStage
|
|
180
|
-
from pipelime.commands.piper import DagBaseCommand
|
|
181
181
|
|
|
182
182
|
if not cls.is_cache_valid():
|
|
183
183
|
for module_name in cls.std_modules + cls.extra_modules:
|
|
@@ -631,7 +631,7 @@ def pl_print(
|
|
|
631
631
|
"""
|
|
632
632
|
import inspect
|
|
633
633
|
|
|
634
|
-
from pydantic import BaseModel
|
|
634
|
+
from pydantic.v1 import BaseModel
|
|
635
635
|
from rich import print as rprint
|
|
636
636
|
|
|
637
637
|
from pipelime.cli.pretty_print import print_model_info
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
from pipelime.commands.general import (
|
|
2
|
-
TimeItCommand,
|
|
3
|
-
StageTimingCommand,
|
|
4
|
-
PipeCommand,
|
|
5
2
|
CloneCommand,
|
|
6
3
|
ConcatCommand,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
ValidateCommand,
|
|
4
|
+
CopySharedItemsCommand,
|
|
5
|
+
FilterCommand,
|
|
6
|
+
FilterDuplicatesCommand,
|
|
11
7
|
MapCommand,
|
|
12
8
|
MapIfCommand,
|
|
13
|
-
|
|
14
|
-
FilterCommand,
|
|
15
|
-
SliceCommand,
|
|
9
|
+
PipeCommand,
|
|
16
10
|
SetMetadataCommand,
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
SliceCommand,
|
|
12
|
+
SortCommand,
|
|
13
|
+
StageTimingCommand,
|
|
14
|
+
TimeItCommand,
|
|
15
|
+
ValidateCommand,
|
|
16
|
+
ZipCommand,
|
|
19
17
|
)
|
|
18
|
+
from pipelime.commands.piper import DrawCommand, RunCommand, WatchCommand
|
|
19
|
+
from pipelime.commands.resume import ResumeCommand
|
|
20
20
|
from pipelime.commands.shell import ShellCommand
|
|
21
21
|
from pipelime.commands.split_ops import (
|
|
22
22
|
SplitByQueryCommand,
|
|
23
23
|
SplitByValueCommand,
|
|
24
24
|
SplitCommand,
|
|
25
25
|
)
|
|
26
|
-
from pipelime.commands.toy_dataset import ToyDatasetCommand
|
|
27
|
-
from pipelime.commands.piper import RunCommand, DrawCommand, WatchCommand
|
|
28
26
|
from pipelime.commands.tempman import TempCommand
|
|
29
|
-
from pipelime.commands.
|
|
27
|
+
from pipelime.commands.toy_dataset import ToyDatasetCommand
|