ob-metaflow-stubs 6.0.3.104__py2.py3-none-any.whl → 6.0.3.105__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- metaflow-stubs/__init__.pyi +888 -550
- metaflow-stubs/cards.pyi +210 -4
- metaflow-stubs/cli.pyi +22 -2
- metaflow-stubs/client/__init__.pyi +128 -3
- metaflow-stubs/client/core.pyi +226 -6
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +5 -2
- metaflow-stubs/events.pyi +21 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +71 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +158 -5
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata/metadata.pyi +9 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +69 -66
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +69 -3
- metaflow-stubs/plugins/__init__.pyi +14 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +80 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +6 -3
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +46 -4
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +46 -4
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +16 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +17 -4
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +97 -6
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +35 -7
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +50 -5
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +103 -3
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +15 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +21 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +49 -4
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +21 -3
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +62 -4
- metaflow-stubs/plugins/cards/card_client.pyi +34 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +5 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +8 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +53 -3
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +28 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +42 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +28 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +183 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +5 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +36 -3
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +56 -3
- metaflow-stubs/plugins/cards/exception.pyi +8 -2
- metaflow-stubs/plugins/catch_decorator.pyi +20 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +64 -4
- metaflow-stubs/plugins/datatools/local.pyi +16 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +73 -4
- metaflow-stubs/plugins/datatools/s3/s3.pyi +82 -5
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +10 -2
- metaflow-stubs/plugins/events_decorator.pyi +107 -3
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +25 -4
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +15 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +11 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +67 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +100 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +5 -2
- metaflow-stubs/plugins/logs_cli.pyi +3 -3
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +30 -3
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +60 -3
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +45 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +33 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +33 -2
- metaflow-stubs/plugins/retry_decorator.pyi +21 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +11 -2
- metaflow-stubs/plugins/storage_executor.pyi +6 -2
- metaflow-stubs/plugins/tag_cli.pyi +35 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +10 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +24 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +70 -131
- metaflow-stubs/runner/metaflow_runner.pyi +117 -9
- metaflow-stubs/runner/nbdeploy.pyi +66 -2
- metaflow-stubs/runner/nbrun.pyi +79 -2
- metaflow-stubs/runner/subprocess_manager.pyi +16 -4
- metaflow-stubs/runner/utils.pyi +32 -2
- metaflow-stubs/system/__init__.pyi +3 -3
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- {ob_metaflow_stubs-6.0.3.104.dist-info → ob_metaflow_stubs-6.0.3.105.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.105.dist-info/RECORD +140 -0
- ob_metaflow_stubs-6.0.3.104.dist-info/RECORD +0 -140
- {ob_metaflow_stubs-6.0.3.104.dist-info → ob_metaflow_stubs-6.0.3.105.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.104.dist-info → ob_metaflow_stubs-6.0.3.105.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.712557 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.712890 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.666268 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.667675 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,20 +1,69 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.689214 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.client.core
|
12
|
-
import datetime
|
13
11
|
import typing
|
12
|
+
import datetime
|
14
13
|
import metaflow.parameters
|
14
|
+
import metaflow.client.core
|
15
15
|
import metaflow.exception
|
16
16
|
|
17
17
|
class Task(metaflow.client.core.MetaflowObject, metaclass=type):
|
18
|
+
"""
|
19
|
+
A `Task` represents an execution of a `Step`.
|
20
|
+
|
21
|
+
It contains all `DataArtifact` objects produced by the task as
|
22
|
+
well as metadata related to execution.
|
23
|
+
|
24
|
+
Note that the `@retry` decorator may cause multiple attempts of
|
25
|
+
the task to be present. Usually you want the latest attempt, which
|
26
|
+
is what instantiating a `Task` object returns by default. If
|
27
|
+
you need to e.g. retrieve logs from a failed attempt, you can
|
28
|
+
explicitly get information about a specific attempt by using the
|
29
|
+
following syntax when creating a task:
|
30
|
+
|
31
|
+
`Task('flow/run/step/task', attempt=<attempt>)`
|
32
|
+
|
33
|
+
where `attempt=0` corresponds to the first attempt etc.
|
34
|
+
|
35
|
+
Attributes
|
36
|
+
----------
|
37
|
+
metadata : List[Metadata]
|
38
|
+
List of all metadata events associated with the task.
|
39
|
+
metadata_dict : Dict[str, str]
|
40
|
+
A condensed version of `metadata`: A dictionary where keys
|
41
|
+
are names of metadata events and values the latest corresponding event.
|
42
|
+
data : MetaflowData
|
43
|
+
Container of all data artifacts produced by this task. Note that this
|
44
|
+
call downloads all data locally, so it can be slower than accessing
|
45
|
+
artifacts individually. See `MetaflowData` for more information.
|
46
|
+
artifacts : MetaflowArtifacts
|
47
|
+
Container of `DataArtifact` objects produced by this task.
|
48
|
+
successful : bool
|
49
|
+
True if the task completed successfully.
|
50
|
+
finished : bool
|
51
|
+
True if the task completed.
|
52
|
+
exception : object
|
53
|
+
Exception raised by this task if there was one.
|
54
|
+
finished_at : datetime
|
55
|
+
Time this task finished.
|
56
|
+
runtime_name : str
|
57
|
+
Runtime this task was executed on.
|
58
|
+
stdout : str
|
59
|
+
Standard output for the task execution.
|
60
|
+
stderr : str
|
61
|
+
Standard error output for the task execution.
|
62
|
+
code : MetaflowCode
|
63
|
+
Code package for this task (if present). See `MetaflowCode`.
|
64
|
+
environment_info : Dict[str, str]
|
65
|
+
Information about the execution environment.
|
66
|
+
"""
|
18
67
|
def __init__(self, *args, **kwargs):
|
19
68
|
...
|
20
69
|
@property
|
@@ -409,6 +458,9 @@ class CardDatastore(object, metaclass=type):
|
|
409
458
|
NUM_SHORT_HASH_CHARS: int
|
410
459
|
|
411
460
|
class CardClassFoundException(metaflow.exception.MetaflowException, metaclass=type):
|
461
|
+
"""
|
462
|
+
This exception is raised with MetaflowCard class is not present for a particular card type.
|
463
|
+
"""
|
412
464
|
def __init__(self, card_name):
|
413
465
|
...
|
414
466
|
...
|
@@ -424,6 +476,9 @@ class UnrenderableCardException(metaflow.exception.MetaflowException, metaclass=
|
|
424
476
|
...
|
425
477
|
|
426
478
|
class CardNotPresentException(metaflow.exception.MetaflowException, metaclass=type):
|
479
|
+
"""
|
480
|
+
This exception is raised with a card is not present in the datastore.
|
481
|
+
"""
|
427
482
|
def __init__(self, pathspec, card_type = None, card_hash = None, card_id = None):
|
428
483
|
...
|
429
484
|
...
|
@@ -440,6 +495,9 @@ def resumed_info(task):
|
|
440
495
|
...
|
441
496
|
|
442
497
|
class CardRenderInfo(tuple, metaclass=type):
|
498
|
+
"""
|
499
|
+
CardRenderInfo(mode, is_implemented, data, timed_out, timeout_stack_trace)
|
500
|
+
"""
|
443
501
|
@staticmethod
|
444
502
|
def __new__(_cls, mode, is_implemented, data, timed_out, timeout_stack_trace):
|
445
503
|
"""
|
@@ -1,15 +1,15 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.656061 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.exception
|
12
11
|
import metaflow.plugins.cards.card_client
|
12
|
+
import metaflow.exception
|
13
13
|
import metaflow
|
14
14
|
|
15
15
|
TYPE_CHECKING: bool
|
@@ -86,6 +86,14 @@ class IncorrectPathspecException(metaflow.exception.MetaflowException, metaclass
|
|
86
86
|
...
|
87
87
|
|
88
88
|
class Card(object, metaclass=type):
|
89
|
+
"""
|
90
|
+
`Card` represents an individual Metaflow Card, a single HTML file, produced by
|
91
|
+
the card `@card` decorator. `Card`s are contained by `CardContainer`, returned by
|
92
|
+
`get_cards`.
|
93
|
+
|
94
|
+
Note that the contents of the card, an HTML file, is retrieved lazily when you call
|
95
|
+
`Card.get` for the first time or when the card is rendered in a notebook.
|
96
|
+
"""
|
89
97
|
def __init__(self, card_ds, type, path, hash, id = None, html = None, created_on = None, from_resumed = False, origin_pathspec = None):
|
90
98
|
...
|
91
99
|
def get_data(self) -> typing.Optional[dict]:
|
@@ -137,6 +145,29 @@ class Card(object, metaclass=type):
|
|
137
145
|
...
|
138
146
|
|
139
147
|
class CardContainer(object, metaclass=type):
|
148
|
+
"""
|
149
|
+
`CardContainer` is an immutable list-like object, returned by `get_cards`,
|
150
|
+
which contains individual `Card`s.
|
151
|
+
|
152
|
+
Notably, `CardContainer` contains a special
|
153
|
+
`_repr_html_` function which renders cards automatically in an output
|
154
|
+
cell of a notebook.
|
155
|
+
|
156
|
+
The following operations are supported:
|
157
|
+
```
|
158
|
+
cards = get_cards(MyTask)
|
159
|
+
|
160
|
+
# retrieve by index
|
161
|
+
first_card = cards[0]
|
162
|
+
|
163
|
+
# check length
|
164
|
+
if len(cards) > 1:
|
165
|
+
print('many cards present!')
|
166
|
+
|
167
|
+
# iteration
|
168
|
+
list_of_cards = list(cards)
|
169
|
+
```
|
170
|
+
"""
|
140
171
|
def __init__(self, card_paths, card_ds, origin_pathspec = None):
|
141
172
|
...
|
142
173
|
def __len__(self):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.686204 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -15,6 +15,9 @@ current: metaflow.metaflow_current.Current
|
|
15
15
|
ASYNC_TIMEOUT: int
|
16
16
|
|
17
17
|
class CardProcessManager(object, metaclass=type):
|
18
|
+
"""
|
19
|
+
This class is responsible for managing the card creation processes.
|
20
|
+
"""
|
18
21
|
...
|
19
22
|
|
20
23
|
class CardCreator(object, metaclass=type):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.680210 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -25,6 +25,9 @@ CARD_GSROOT: None
|
|
25
25
|
SKIP_CARD_DUALWRITE: bool
|
26
26
|
|
27
27
|
class CardNotPresentException(metaflow.exception.MetaflowException, metaclass=type):
|
28
|
+
"""
|
29
|
+
This exception is raised with a card is not present in the datastore.
|
30
|
+
"""
|
28
31
|
def __init__(self, pathspec, card_type = None, card_hash = None, card_id = None):
|
29
32
|
...
|
30
33
|
...
|
@@ -34,6 +37,9 @@ TEMP_DIR_NAME: str
|
|
34
37
|
NUM_SHORT_HASH_CHARS: int
|
35
38
|
|
36
39
|
class CardInfo(tuple, metaclass=type):
|
40
|
+
"""
|
41
|
+
CardInfo(type, hash, id, filename)
|
42
|
+
"""
|
37
43
|
@staticmethod
|
38
44
|
def __new__(_cls, type, hash, id, filename):
|
39
45
|
"""
|
@@ -1,19 +1,38 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.686948 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.decorators
|
12
11
|
import metaflow.metaflow_current
|
12
|
+
import metaflow.decorators
|
13
13
|
|
14
14
|
current: metaflow.metaflow_current.Current
|
15
15
|
|
16
16
|
class CardComponentCollector(object, metaclass=type):
|
17
|
+
"""
|
18
|
+
This class helps collect `MetaflowCardComponent`s during runtime execution
|
19
|
+
|
20
|
+
### Usage with `current`
|
21
|
+
`current.card` is of type `CardComponentCollector`
|
22
|
+
|
23
|
+
### Main Usage TLDR
|
24
|
+
- [x] `current.card.append` customizes the default editable card.
|
25
|
+
- [x] Only one card can be default editable in a step.
|
26
|
+
- [x] The card class must have `ALLOW_USER_COMPONENTS=True` to be considered default editable.
|
27
|
+
- [x] Classes with `ALLOW_USER_COMPONENTS=False` are never default editable.
|
28
|
+
- [x] The user can specify an `id` argument to a card, in which case the card is editable through `current.card[id].append`.
|
29
|
+
- [x] A card with an id can be also default editable, if there are no other cards that are eligible to be default editable.
|
30
|
+
- [x] If multiple default-editable cards exist but only one card doesn't have an id, the card without an id is considered to be default editable.
|
31
|
+
- [x] If we can't resolve a single default editable card through the above rules, `current.card`.append calls show a warning but the call doesn't fail.
|
32
|
+
- [x] A card that is not default editable can be still edited through:
|
33
|
+
- [x] its `current.card['myid']`
|
34
|
+
- [x] by looking it up by its type, e.g. `current.card.get(type='pytorch')`.
|
35
|
+
"""
|
17
36
|
def __init__(self, logger = None, card_creator = None):
|
18
37
|
...
|
19
38
|
@staticmethod
|
@@ -121,6 +140,37 @@ def warning_message(message, logger = None, ts = False):
|
|
121
140
|
...
|
122
141
|
|
123
142
|
class CardDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
143
|
+
"""
|
144
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
145
|
+
|
146
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
147
|
+
|
148
|
+
Parameters
|
149
|
+
----------
|
150
|
+
type : str, default 'default'
|
151
|
+
Card type.
|
152
|
+
id : str, optional, default None
|
153
|
+
If multiple cards are present, use this id to identify this card.
|
154
|
+
options : Dict[str, Any], default {}
|
155
|
+
Options passed to the card. The contents depend on the card type.
|
156
|
+
timeout : int, default 45
|
157
|
+
Interrupt reporting if it takes more than this many seconds.
|
158
|
+
|
159
|
+
MF Add To Current
|
160
|
+
-----------------
|
161
|
+
card -> metaflow.plugins.cards.component_serializer.CardComponentCollector
|
162
|
+
The `@card` decorator makes the cards available through the `current.card`
|
163
|
+
object. If multiple `@card` decorators are present, you can add an `ID` to
|
164
|
+
distinguish between them using `@card(id=ID)` as the decorator. You will then
|
165
|
+
be able to access that specific card using `current.card[ID].
|
166
|
+
|
167
|
+
Methods available are `append` and `extend`
|
168
|
+
|
169
|
+
@@ Returns
|
170
|
+
-------
|
171
|
+
CardComponentCollector
|
172
|
+
The or one of the cards attached to this step.
|
173
|
+
"""
|
124
174
|
def __init__(self, *args, **kwargs):
|
125
175
|
...
|
126
176
|
def step_init(self, flow, graph, step_name, decorators, environment, flow_datastore, logger):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.684589 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -11,6 +11,32 @@ if typing.TYPE_CHECKING:
|
|
11
11
|
import metaflow
|
12
12
|
|
13
13
|
class MetaflowCard(object, metaclass=type):
|
14
|
+
"""
|
15
|
+
Metaflow cards derive from this base class.
|
16
|
+
|
17
|
+
Subclasses of this class are called *card types*. The desired card
|
18
|
+
type `T` is defined in the `@card` decorator as `@card(type=T)`.
|
19
|
+
|
20
|
+
After a task with `@card(type=T, options=S)` finishes executing, Metaflow instantiates
|
21
|
+
a subclass `C` of `MetaflowCard` that has its `type` attribute set to `T`, i.e. `C.type=T`.
|
22
|
+
The constructor is given the options dictionary `S` that contains arbitrary
|
23
|
+
JSON-encodable data that is passed to the instance, parametrizing the card. The subclass
|
24
|
+
may override the constructor to capture and process the options.
|
25
|
+
|
26
|
+
The subclass needs to implement a `render(task)` method that produces the card
|
27
|
+
contents in HTML, given the finished task that is represented by a `Task` object.
|
28
|
+
|
29
|
+
Attributes
|
30
|
+
----------
|
31
|
+
type : str
|
32
|
+
Card type string. Note that this should be a globally unique name, similar to a
|
33
|
+
Python package name, to avoid name clashes between different custom cards.
|
34
|
+
|
35
|
+
Parameters
|
36
|
+
----------
|
37
|
+
options : Dict
|
38
|
+
JSON-encodable dictionary containing user-definable options for the class.
|
39
|
+
"""
|
14
40
|
def __init__(self, options = {}, components = [], graph = None):
|
15
41
|
...
|
16
42
|
def render(self, task: "metaflow.Task") -> str:
|
@@ -1,18 +1,44 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.660568 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.plugins.cards.card_modules.card
|
12
11
|
import metaflow.plugins.cards.card_modules.basic
|
13
12
|
import metaflow
|
13
|
+
import metaflow.plugins.cards.card_modules.card
|
14
14
|
|
15
15
|
class MetaflowCard(object, metaclass=type):
|
16
|
+
"""
|
17
|
+
Metaflow cards derive from this base class.
|
18
|
+
|
19
|
+
Subclasses of this class are called *card types*. The desired card
|
20
|
+
type `T` is defined in the `@card` decorator as `@card(type=T)`.
|
21
|
+
|
22
|
+
After a task with `@card(type=T, options=S)` finishes executing, Metaflow instantiates
|
23
|
+
a subclass `C` of `MetaflowCard` that has its `type` attribute set to `T`, i.e. `C.type=T`.
|
24
|
+
The constructor is given the options dictionary `S` that contains arbitrary
|
25
|
+
JSON-encodable data that is passed to the instance, parametrizing the card. The subclass
|
26
|
+
may override the constructor to capture and process the options.
|
27
|
+
|
28
|
+
The subclass needs to implement a `render(task)` method that produces the card
|
29
|
+
contents in HTML, given the finished task that is represented by a `Task` object.
|
30
|
+
|
31
|
+
Attributes
|
32
|
+
----------
|
33
|
+
type : str
|
34
|
+
Card type string. Note that this should be a globally unique name, similar to a
|
35
|
+
Python package name, to avoid name clashes between different custom cards.
|
36
|
+
|
37
|
+
Parameters
|
38
|
+
----------
|
39
|
+
options : Dict
|
40
|
+
JSON-encodable dictionary containing user-definable options for the class.
|
41
|
+
"""
|
16
42
|
def __init__(self, options = {}, components = [], graph = None):
|
17
43
|
...
|
18
44
|
def render(self, task: "metaflow.Task") -> str:
|
@@ -88,6 +114,14 @@ def read_file(path):
|
|
88
114
|
...
|
89
115
|
|
90
116
|
class DefaultComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
|
117
|
+
"""
|
118
|
+
The `DefaultCard` and the `BlankCard` use a JS framework that build the HTML dynamically from JSON.
|
119
|
+
The `DefaultComponent` is the base component that helps build the JSON when `render` is called.
|
120
|
+
|
121
|
+
The underlying JS framework consists of various types of objects.
|
122
|
+
These can be found in: "metaflow/plugins/cards/ui/types.ts".
|
123
|
+
The `type` attribute in a `DefaultComponent` corresponds to the type of component in the Javascript framework.
|
124
|
+
"""
|
91
125
|
def __init__(self, title = None, subtitle = None):
|
92
126
|
...
|
93
127
|
def render(self):
|
@@ -197,6 +231,11 @@ class MarkdownComponent(DefaultComponent, metaclass=type):
|
|
197
231
|
...
|
198
232
|
|
199
233
|
class TaskInfoComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
|
234
|
+
"""
|
235
|
+
Properties
|
236
|
+
page_content : a list of MetaflowCardComponents going as task info
|
237
|
+
final_component: the dictionary returned by the `render` function of this class.
|
238
|
+
"""
|
200
239
|
def __init__(self, task, page_title = "Task Info", only_repr = True, graph = None, components = [], runtime = False):
|
201
240
|
...
|
202
241
|
def render(self):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.656503 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -13,6 +13,32 @@ if typing.TYPE_CHECKING:
|
|
13
13
|
TYPE_CHECKING: bool
|
14
14
|
|
15
15
|
class MetaflowCard(object, metaclass=type):
|
16
|
+
"""
|
17
|
+
Metaflow cards derive from this base class.
|
18
|
+
|
19
|
+
Subclasses of this class are called *card types*. The desired card
|
20
|
+
type `T` is defined in the `@card` decorator as `@card(type=T)`.
|
21
|
+
|
22
|
+
After a task with `@card(type=T, options=S)` finishes executing, Metaflow instantiates
|
23
|
+
a subclass `C` of `MetaflowCard` that has its `type` attribute set to `T`, i.e. `C.type=T`.
|
24
|
+
The constructor is given the options dictionary `S` that contains arbitrary
|
25
|
+
JSON-encodable data that is passed to the instance, parametrizing the card. The subclass
|
26
|
+
may override the constructor to capture and process the options.
|
27
|
+
|
28
|
+
The subclass needs to implement a `render(task)` method that produces the card
|
29
|
+
contents in HTML, given the finished task that is represented by a `Task` object.
|
30
|
+
|
31
|
+
Attributes
|
32
|
+
----------
|
33
|
+
type : str
|
34
|
+
Card type string. Note that this should be a globally unique name, similar to a
|
35
|
+
Python package name, to avoid name clashes between different custom cards.
|
36
|
+
|
37
|
+
Parameters
|
38
|
+
----------
|
39
|
+
options : Dict
|
40
|
+
JSON-encodable dictionary containing user-definable options for the class.
|
41
|
+
"""
|
16
42
|
def __init__(self, options = {}, components = [], graph = None):
|
17
43
|
...
|
18
44
|
def render(self, task: "metaflow.Task") -> str:
|