You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create a "dashboard-style" card that summarizes information from multiple steps. For instance, when running parallel processes via a foreach step, I would like to update a common progress bar, rather than having one card for each step as in the example below. Is this currently possible?
from metaflow import FlowSpec, step, card, current, resources
from metaflow.cards import ProgressBar
import time
class ForeachFlow(FlowSpec):
@step
def start(self):
self.values = [list(range(100)) for _ in range(3)]
self.next(self.a, foreach='values')
@resources(cpu=10)
@card(type="blank")
@step
def a(self):
pb = ProgressBar(max=len(self.input), label=current.step_name)
current.card.append(pb)
for n, val in enumerate(self.input, 1):
pb.update(n)
current.card.refresh()
time.sleep(0.1)
self.next(self.join)
@step
def join(self, inputs):
self.merge_artifacts(inputs)
self.next(self.end)
@step
def end(self):
pass
if __name__ == '__main__':
ForeachFlow()
The text was updated successfully, but these errors were encountered:
pacidic
changed the title
Share card between multiple steps
Sharing cards across multiple steps
Feb 7, 2025
I would like to create a "dashboard-style" card that summarizes information from multiple steps. For instance, when running parallel processes via a foreach step, I would like to update a common progress bar, rather than having one card for each step as in the example below. Is this currently possible?
The text was updated successfully, but these errors were encountered: