metaflow-stubs 2.12.28__py2.py3-none-any.whl → 2.12.30__py2.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.
Files changed (159) hide show
  1. metaflow-stubs/__init__.pyi +279 -2983
  2. metaflow-stubs/cards.pyi +19 -473
  3. metaflow-stubs/cli.pyi +17 -81
  4. metaflow-stubs/client/__init__.pyi +19 -1113
  5. metaflow-stubs/client/core.pyi +19 -159
  6. metaflow-stubs/client/filecache.pyi +7 -11
  7. metaflow-stubs/clone_util.pyi +6 -26
  8. metaflow-stubs/events.pyi +7 -6
  9. metaflow-stubs/exception.pyi +8 -6
  10. metaflow-stubs/flowspec.pyi +21 -105
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +17 -565
  13. metaflow-stubs/info_file.pyi +6 -5
  14. metaflow-stubs/metadata_provider/__init__.pyi +16 -0
  15. metaflow-stubs/metadata_provider/heartbeat.pyi +34 -0
  16. metaflow-stubs/{metadata → metadata_provider}/metadata.pyi +10 -22
  17. metaflow-stubs/metadata_provider/util.pyi +19 -0
  18. metaflow-stubs/metaflow_config.pyi +8 -11
  19. metaflow-stubs/metaflow_current.pyi +32 -31
  20. metaflow-stubs/mflog/__init__.pyi +6 -0
  21. metaflow-stubs/mflog/mflog.pyi +52 -5
  22. metaflow-stubs/multicore_utils.pyi +6 -5
  23. metaflow-stubs/parameters.pyi +12 -22
  24. metaflow-stubs/plugins/__init__.pyi +51 -163
  25. metaflow-stubs/plugins/airflow/__init__.pyi +12 -5
  26. metaflow-stubs/plugins/airflow/airflow.pyi +19 -130
  27. metaflow-stubs/plugins/airflow/airflow_cli.pyi +17 -136
  28. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +7 -26
  29. metaflow-stubs/plugins/airflow/airflow_utils.pyi +7 -6
  30. metaflow-stubs/plugins/airflow/exception.pyi +7 -11
  31. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +10 -97
  32. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +9 -30
  33. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +9 -40
  34. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +9 -40
  35. metaflow-stubs/plugins/argo/__init__.pyi +12 -5
  36. metaflow-stubs/plugins/argo/argo_client.pyi +8 -26
  37. metaflow-stubs/plugins/argo/argo_events.pyi +7 -11
  38. metaflow-stubs/plugins/argo/argo_workflows.pyi +17 -121
  39. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +22 -460
  40. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +12 -404
  41. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +65 -322
  42. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +165 -0
  43. metaflow-stubs/plugins/aws/__init__.pyi +11 -5
  44. metaflow-stubs/plugins/aws/aws_client.pyi +6 -5
  45. metaflow-stubs/plugins/aws/aws_utils.pyi +6 -11
  46. metaflow-stubs/plugins/aws/batch/__init__.pyi +10 -5
  47. metaflow-stubs/plugins/aws/batch/batch.pyi +10 -55
  48. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +10 -31
  49. metaflow-stubs/plugins/aws/batch/batch_client.pyi +7 -11
  50. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +15 -140
  51. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +7 -5
  52. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +10 -21
  53. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +15 -5
  54. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +6 -5
  55. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +6 -5
  56. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +6 -5
  57. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +7 -5
  58. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +11 -65
  59. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +19 -175
  60. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +6 -5
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +8 -37
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +53 -290
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +127 -0
  64. metaflow-stubs/plugins/azure/__init__.pyi +12 -7
  65. metaflow-stubs/plugins/azure/azure_credential.pyi +6 -5
  66. metaflow-stubs/plugins/azure/azure_exceptions.pyi +7 -11
  67. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +11 -24
  68. metaflow-stubs/plugins/azure/azure_utils.pyi +11 -29
  69. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +8 -23
  70. metaflow-stubs/plugins/azure/includefile_support.pyi +7 -17
  71. metaflow-stubs/plugins/cards/__init__.pyi +15 -5
  72. metaflow-stubs/plugins/cards/card_cli.pyi +22 -491
  73. metaflow-stubs/plugins/cards/card_client.pyi +14 -76
  74. metaflow-stubs/plugins/cards/card_creator.pyi +7 -10
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +10 -18
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +10 -126
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +14 -81
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +13 -96
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +6 -5
  80. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +12 -73
  81. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +6 -61
  82. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +6 -5
  83. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +8 -45
  84. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +7 -6
  85. metaflow-stubs/plugins/cards/card_modules/components.pyi +24 -107
  86. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +6 -5
  87. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +6 -12
  88. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +11 -88
  89. metaflow-stubs/plugins/cards/card_resolver.pyi +6 -49
  90. metaflow-stubs/plugins/cards/component_serializer.pyi +13 -63
  91. metaflow-stubs/plugins/cards/exception.pyi +7 -11
  92. metaflow-stubs/plugins/catch_decorator.pyi +9 -29
  93. metaflow-stubs/plugins/datatools/__init__.pyi +13 -392
  94. metaflow-stubs/plugins/datatools/local.pyi +7 -11
  95. metaflow-stubs/plugins/datatools/s3/__init__.pyi +19 -653
  96. metaflow-stubs/plugins/datatools/s3/s3.pyi +15 -263
  97. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +7 -10
  98. metaflow-stubs/plugins/datatools/s3/s3util.pyi +6 -11
  99. metaflow-stubs/plugins/debug_logger.pyi +7 -5
  100. metaflow-stubs/plugins/debug_monitor.pyi +7 -5
  101. metaflow-stubs/plugins/environment_decorator.pyi +7 -5
  102. metaflow-stubs/plugins/events_decorator.pyi +8 -14
  103. metaflow-stubs/plugins/frameworks/__init__.pyi +7 -5
  104. metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -45
  105. metaflow-stubs/plugins/gcp/__init__.pyi +11 -7
  106. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +11 -24
  107. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +7 -11
  108. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +6 -5
  109. metaflow-stubs/plugins/gcp/gs_utils.pyi +8 -20
  110. metaflow-stubs/plugins/gcp/includefile_support.pyi +7 -17
  111. metaflow-stubs/plugins/kubernetes/__init__.pyi +13 -5
  112. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +6 -10
  113. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +9 -29
  114. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +16 -155
  115. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +9 -72
  116. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +19 -142
  117. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +8 -41
  118. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +7 -11
  119. metaflow-stubs/plugins/logs_cli.pyi +10 -9
  120. metaflow-stubs/plugins/package_cli.pyi +7 -5
  121. metaflow-stubs/plugins/parallel_decorator.pyi +11 -59
  122. metaflow-stubs/plugins/project_decorator.pyi +8 -14
  123. metaflow-stubs/plugins/pypi/__init__.pyi +12 -11
  124. metaflow-stubs/plugins/pypi/conda_decorator.pyi +8 -27
  125. metaflow-stubs/plugins/pypi/conda_environment.pyi +13 -19
  126. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +7 -5
  127. metaflow-stubs/plugins/pypi/pypi_environment.pyi +7 -39
  128. metaflow-stubs/plugins/pypi/utils.pyi +7 -11
  129. metaflow-stubs/plugins/resources_decorator.pyi +7 -5
  130. metaflow-stubs/plugins/retry_decorator.pyi +7 -11
  131. metaflow-stubs/plugins/secrets/__init__.pyi +9 -5
  132. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +9 -14
  133. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +7 -11
  134. metaflow-stubs/plugins/storage_executor.pyi +6 -11
  135. metaflow-stubs/plugins/tag_cli.pyi +14 -396
  136. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +9 -34
  137. metaflow-stubs/plugins/timeout_decorator.pyi +7 -11
  138. metaflow-stubs/procpoll.pyi +7 -5
  139. metaflow-stubs/pylint_wrapper.pyi +7 -11
  140. metaflow-stubs/runner/__init__.pyi +13 -5
  141. metaflow-stubs/runner/deployer.pyi +102 -210
  142. metaflow-stubs/runner/deployer_impl.pyi +87 -0
  143. metaflow-stubs/runner/metaflow_runner.pyi +23 -507
  144. metaflow-stubs/runner/nbdeploy.pyi +16 -60
  145. metaflow-stubs/runner/nbrun.pyi +11 -148
  146. metaflow-stubs/runner/subprocess_manager.pyi +9 -10
  147. metaflow-stubs/runner/utils.pyi +44 -9
  148. metaflow-stubs/system/__init__.pyi +9 -87
  149. metaflow-stubs/system/system_logger.pyi +7 -6
  150. metaflow-stubs/system/system_monitor.pyi +6 -5
  151. metaflow-stubs/tagging_util.pyi +6 -10
  152. metaflow-stubs/tuple_util.pyi +6 -5
  153. metaflow-stubs/version.pyi +6 -5
  154. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.30.dist-info}/METADATA +2 -2
  155. metaflow_stubs-2.12.30.dist-info/RECORD +158 -0
  156. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.30.dist-info}/WHEEL +1 -1
  157. metaflow-stubs/metadata/util.pyi +0 -18
  158. metaflow_stubs-2.12.28.dist-info/RECORD +0 -152
  159. {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.30.dist-info}/top_level.txt +0 -0
@@ -1,14 +1,14 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.516555 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.333699 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import typing
10
- if typing.TYPE_CHECKING:
11
- import metaflow.exception
9
+
10
+ from ... import metaflow_config as metaflow_config
11
+ from .exception import CardNotPresentException as CardNotPresentException
12
12
 
13
13
  CARD_S3ROOT: None
14
14
 
@@ -24,14 +24,6 @@ CARD_GSROOT: None
24
24
 
25
25
  SKIP_CARD_DUALWRITE: bool
26
26
 
27
- class CardNotPresentException(metaflow.exception.MetaflowException, metaclass=type):
28
- """
29
- This exception is raised with a card is not present in the datastore.
30
- """
31
- def __init__(self, pathspec, card_type = None, card_hash = None, card_id = None):
32
- ...
33
- ...
34
-
35
27
  TEMP_DIR_NAME: str
36
28
 
37
29
  NUM_SHORT_HASH_CHARS: int
@@ -77,10 +69,10 @@ class CardDatastore(object, metaclass=type):
77
69
  def __init__(self, flow_datastore, pathspec = None):
78
70
  ...
79
71
  @classmethod
80
- def get_card_location(cls, base_path, card_name, uuid, card_id = None, suffix = "html"):
72
+ def get_card_location(cls, base_path, card_name, uuid, card_id = None, suffix = 'html'):
81
73
  ...
82
74
  @staticmethod
83
- def info_from_path(path, suffix = "html"):
75
+ def info_from_path(path, suffix = 'html'):
84
76
  """
85
77
  Args:
86
78
  path (str): The path to the card
@@ -1,136 +1,20 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.515655 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.332696 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ import metaflow
9
10
  import typing
10
11
  if typing.TYPE_CHECKING:
11
12
  import metaflow.decorators
12
- import metaflow.metaflow_current
13
13
 
14
- current: metaflow.metaflow_current.Current
15
-
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
- """
36
- def __init__(self, logger = None, card_creator = None):
37
- ...
38
- @staticmethod
39
- def create_uuid():
40
- ...
41
- def get(self, type = None):
42
- """
43
- `get`
44
- gets all the components arrays for a card `type`.
45
- Since one `@step` can have many `@card` decorators, many decorators can have the same type. That is why this function returns a list of lists.
46
-
47
- Args:
48
- type ([str], optional): `type` of MetaflowCard. Defaults to None.
49
-
50
- Returns: will return empty `list` if `type` is None or not found
51
- List[List[MetaflowCardComponent]]
52
- """
53
- ...
54
- def __getitem__(self, key):
55
- """
56
- Choose a specific card for manipulation.
57
-
58
- When multiple @card decorators are present, you can add an
59
- `ID` to distinguish between them, `@card(id=ID)`. This allows you
60
- to add components to a specific card like this:
61
- ```
62
- current.card[ID].append(component)
63
- ```
64
-
65
- Parameters
66
- ----------
67
- key : str
68
- Card ID.
69
-
70
- Returns
71
- -------
72
- CardComponentManager
73
- An object with `append` and `extend` calls which allow you to
74
- add components to the chosen card.
75
- """
76
- ...
77
- def __setitem__(self, key, value):
78
- """
79
- Specify components of the chosen card.
80
-
81
- Instead of adding components to a card individually with `current.card[ID].append(component)`,
82
- use this method to assign a list of components to a card, replacing the existing components:
83
- ```
84
- current.card[ID] = [FirstComponent, SecondComponent]
85
- ```
86
-
87
- Parameters
88
- ----------
89
- key: str
90
- Card ID.
91
-
92
- value: List[MetaflowCardComponent]
93
- List of card components to assign to this card.
94
- """
95
- ...
96
- def append(self, component, id = None):
97
- """
98
- Appends a component to the current card.
99
-
100
- Parameters
101
- ----------
102
- component : MetaflowCardComponent
103
- Card component to add to this card.
104
- """
105
- ...
106
- def extend(self, components):
107
- """
108
- Appends many components to the current card.
109
-
110
- Parameters
111
- ----------
112
- component : Iterator[MetaflowCardComponent]
113
- Card components to add to this card.
114
- """
115
- ...
116
- @property
117
- def components(self):
118
- ...
119
- def clear(self):
120
- ...
121
- def refresh(self, *args, **kwargs):
122
- ...
123
- ...
124
-
125
- def get_card_class(card_type):
126
- ...
127
-
128
- class CardCreator(object, metaclass=type):
129
- def __init__(self, top_level_options):
130
- ...
131
- def create(self, card_uuid = None, user_set_card_id = None, runtime_card = False, decorator_attributes = None, card_options = None, logger = None, mode = "render", final = False, sync = False):
132
- ...
133
- ...
14
+ from ...metaflow_current import current as current
15
+ from .component_serializer import CardComponentCollector as CardComponentCollector
16
+ from .component_serializer import get_card_class as get_card_class
17
+ from .card_creator import CardCreator as CardCreator
134
18
 
135
19
  TYPE_CHECK_REGEX: str
136
20
 
@@ -1,88 +1,21 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.512139 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.329854 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import typing
10
- if typing.TYPE_CHECKING:
11
- import metaflow
12
9
 
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
- """
40
- def __init__(self, options = {}, components = [], graph = None):
41
- ...
42
- def render(self, task: "metaflow.Task") -> str:
43
- """
44
- Produce custom card contents in HTML.
45
-
46
- Subclasses override this method to customize the card contents.
47
-
48
- Parameters
49
- ----------
50
- task : Task
51
- A `Task` object that allows you to access data from the finished task and tasks
52
- preceding it.
53
-
54
- Returns
55
- -------
56
- str
57
- Card contents as an HTML string.
58
- """
59
- ...
60
- def render_runtime(self, task, data):
61
- ...
62
- def refresh(self, task, data):
63
- ...
64
- def reload_content_token(self, task, data):
65
- ...
66
- ...
67
-
68
- class MetaflowCardComponent(object, metaclass=type):
69
- @property
70
- def component_id(self):
71
- ...
72
- @component_id.setter
73
- def component_id(self, value):
74
- ...
75
- def update(self, *args, **kwargs):
76
- """
77
- #FIXME document
78
- """
79
- ...
80
- def render(self):
81
- """
82
- `render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
83
- """
84
- ...
85
- ...
10
+ from . import card as card
11
+ from .card import MetaflowCard as MetaflowCard
12
+ from .card import MetaflowCardComponent as MetaflowCardComponent
13
+ from . import convert_to_native_type as convert_to_native_type
14
+ from . import basic as basic
15
+ from . import renderer_tools as renderer_tools
16
+ from . import components as components
17
+ from . import test_cards as test_cards
18
+ from . import chevron as chevron
86
19
 
87
20
  EXT_PKG: str
88
21
 
@@ -1,103 +1,20 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.487562 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.321317 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
+ import metaflow
9
10
  import typing
10
11
  if typing.TYPE_CHECKING:
11
12
  import metaflow.plugins.cards.card_modules.basic
12
- import metaflow
13
13
  import metaflow.plugins.cards.card_modules.card
14
14
 
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
- """
42
- def __init__(self, options = {}, components = [], graph = None):
43
- ...
44
- def render(self, task: "metaflow.Task") -> str:
45
- """
46
- Produce custom card contents in HTML.
47
-
48
- Subclasses override this method to customize the card contents.
49
-
50
- Parameters
51
- ----------
52
- task : Task
53
- A `Task` object that allows you to access data from the finished task and tasks
54
- preceding it.
55
-
56
- Returns
57
- -------
58
- str
59
- Card contents as an HTML string.
60
- """
61
- ...
62
- def render_runtime(self, task, data):
63
- ...
64
- def refresh(self, task, data):
65
- ...
66
- def reload_content_token(self, task, data):
67
- ...
68
- ...
69
-
70
- class MetaflowCardComponent(object, metaclass=type):
71
- @property
72
- def component_id(self):
73
- ...
74
- @component_id.setter
75
- def component_id(self, value):
76
- ...
77
- def update(self, *args, **kwargs):
78
- """
79
- #FIXME document
80
- """
81
- ...
82
- def render(self):
83
- """
84
- `render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
85
- """
86
- ...
87
- ...
88
-
89
- class TaskToDict(object, metaclass=type):
90
- def __init__(self, only_repr = False, runtime = False):
91
- ...
92
- def __call__(self, task, graph = None):
93
- ...
94
- def object_type(self, object):
95
- ...
96
- def parse_image(self, data_object):
97
- ...
98
- def infer_object(self, artifact_object):
99
- ...
100
- ...
15
+ from .card import MetaflowCard as MetaflowCard
16
+ from .card import MetaflowCardComponent as MetaflowCardComponent
17
+ from .convert_to_native_type import TaskToDict as TaskToDict
101
18
 
102
19
  ABS_DIR_PATH: str
103
20
 
@@ -236,7 +153,7 @@ class TaskInfoComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardCom
236
153
  page_content : a list of MetaflowCardComponents going as task info
237
154
  final_component: the dictionary returned by the `render` function of this class.
238
155
  """
239
- def __init__(self, task, page_title = "Task Info", only_repr = True, graph = None, components = [], runtime = False):
156
+ def __init__(self, task, page_title = 'Task Info', only_repr = True, graph = None, components = [], runtime = False):
240
157
  ...
241
158
  def render(self):
242
159
  """
@@ -261,14 +178,14 @@ class ErrorCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass
261
178
  ...
262
179
 
263
180
  class DefaultCardJSON(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
264
- def __init__(self, options = {"only_repr": True}, components = [], graph = None):
181
+ def __init__(self, options = {'only_repr': True}, components = [], graph = None):
265
182
  ...
266
183
  def render(self, task):
267
184
  ...
268
185
  ...
269
186
 
270
187
  class DefaultCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
271
- def __init__(self, options = {"only_repr": True}, components = [], graph = None):
188
+ def __init__(self, options = {'only_repr': True}, components = [], graph = None):
272
189
  ...
273
190
  def render(self, task, runtime = False):
274
191
  ...
@@ -285,7 +202,7 @@ class DefaultCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metacla
285
202
  ...
286
203
 
287
204
  class BlankCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
288
- def __init__(self, options = {"title": ""}, components = [], graph = None):
205
+ def __init__(self, options = {'title': ''}, components = [], graph = None):
289
206
  ...
290
207
  def render(self, task, components = [], runtime = False):
291
208
  ...
@@ -1,8 +1,8 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.493556 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.325213 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
@@ -10,6 +10,7 @@ import typing
10
10
  if typing.TYPE_CHECKING:
11
11
  import metaflow
12
12
 
13
+
13
14
  TYPE_CHECKING: bool
14
15
 
15
16
  class MetaflowCard(object, metaclass=type):
@@ -1,78 +1,17 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.560325 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.363408 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
- def main(template, data = None, **kwargs):
11
- ...
12
-
13
- def cli_main():
14
- """
15
- Render mustache templates using json files
16
- """
17
- ...
18
-
19
- def render(template = "", data = {}, partials_path = ".", partials_ext = "mustache", partials_dict = {}, padding = "", def_ldel = "{{", def_rdel = "}}", scopes = None, warn = False, keep = False):
20
- """
21
- Render a mustache template.
22
-
23
- Renders a mustache template with a data scope and partial capability.
24
- Given the file structure...
25
-
26
- ├─╼ main.py
27
- ├─╼ main.ms
28
- └─┮ partials
29
- └── part.ms
30
-
31
- then main.py would make the following call:
32
-
33
- render(open('main.ms', 'r'), {...}, 'partials', 'ms')
34
-
35
-
36
- Arguments:
37
-
38
- template -- A file-like object or a string containing the template
39
-
40
- data -- A python dictionary with your data scope
41
-
42
- partials_path -- The path to where your partials are stored
43
- If set to None, then partials won't be loaded from the file system
44
- (defaults to '.')
45
-
46
- partials_ext -- The extension that you want the parser to look for
47
- (defaults to 'mustache')
48
-
49
- partials_dict -- A python dictionary which will be search for partials
50
- before the filesystem is. {'include': 'foo'} is the same
51
- as a file called include.mustache
52
- (defaults to {})
53
-
54
- padding -- This is for padding partials, and shouldn't be used
55
- (but can be if you really want to)
56
-
57
- def_ldel -- The default left delimiter
58
- ("{{" by default, as in spec compliant mustache)
59
-
60
- def_rdel -- The default right delimiter
61
- ("}}" by default, as in spec compliant mustache)
62
-
63
- scopes -- The list of scopes that get_key will look through
64
-
65
- warn -- Issue a warning to stderr when a template substitution isn't found in the data
66
-
67
- keep -- Keep unreplaced tags when a template substitution isn't found in the data
68
-
69
-
70
- Returns:
71
-
72
- A string containing the rendered template.
73
- """
74
- ...
75
-
76
- class ChevronError(SyntaxError, metaclass=type):
77
- ...
10
+ from . import tokenizer as tokenizer
11
+ from . import renderer as renderer
12
+ from . import metadata as metadata
13
+ from .main import main as main
14
+ from .main import cli_main as cli_main
15
+ from .renderer import render as render
16
+ from .tokenizer import ChevronError as ChevronError
78
17
 
@@ -1,68 +1,13 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.562447 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.375553 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
- def render(template = "", data = {}, partials_path = ".", partials_ext = "mustache", partials_dict = {}, padding = "", def_ldel = "{{", def_rdel = "}}", scopes = None, warn = False, keep = False):
11
- """
12
- Render a mustache template.
13
-
14
- Renders a mustache template with a data scope and partial capability.
15
- Given the file structure...
16
-
17
- ├─╼ main.py
18
- ├─╼ main.ms
19
- └─┮ partials
20
- └── part.ms
21
-
22
- then main.py would make the following call:
23
-
24
- render(open('main.ms', 'r'), {...}, 'partials', 'ms')
25
-
26
-
27
- Arguments:
28
-
29
- template -- A file-like object or a string containing the template
30
-
31
- data -- A python dictionary with your data scope
32
-
33
- partials_path -- The path to where your partials are stored
34
- If set to None, then partials won't be loaded from the file system
35
- (defaults to '.')
36
-
37
- partials_ext -- The extension that you want the parser to look for
38
- (defaults to 'mustache')
39
-
40
- partials_dict -- A python dictionary which will be search for partials
41
- before the filesystem is. {'include': 'foo'} is the same
42
- as a file called include.mustache
43
- (defaults to {})
44
-
45
- padding -- This is for padding partials, and shouldn't be used
46
- (but can be if you really want to)
47
-
48
- def_ldel -- The default left delimiter
49
- ("{{" by default, as in spec compliant mustache)
50
-
51
- def_rdel -- The default right delimiter
52
- ("}}" by default, as in spec compliant mustache)
53
-
54
- scopes -- The list of scopes that get_key will look through
55
-
56
- warn -- Issue a warning to stderr when a template substitution isn't found in the data
57
-
58
- keep -- Keep unreplaced tags when a template substitution isn't found in the data
59
-
60
-
61
- Returns:
62
-
63
- A string containing the rendered template.
64
- """
65
- ...
10
+ from .renderer import render as render
66
11
 
67
12
  version: str
68
13
 
@@ -1,11 +1,12 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.28 #
4
- # Generated on 2024-11-01T10:21:04.562125 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.30 #
4
+ # Generated on 2024-11-13T13:50:31.375322 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
 
10
+
10
11
  version: str
11
12