Skip to content

Commit

Permalink
Rename AnimationScenario.steps to AnimationScenario.sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Nov 18, 2021
1 parent 1b21bdc commit 3c3c425
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ sequences.
AnimationScenario(
grafana_url="https://play.grafana.org/",
dashboard_uid="000000012",
steps=[
sequences=[
AnimationSequence(
dtstart="2021-11-15T02:12:05Z",
dtuntil="2021-11-15T02:37:36Z",
Expand Down
2 changes: 1 addition & 1 deletion grafanimate/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def run():
# Define output filename pattern.
output = Path(output_path) / "{scenario}--{title}--{uid}.mp4"

# Run rendering steps, produce composite media artifacts.
# Run rendering sequences, produce composite media artifacts.
scenario.dashboard_title = grafana.get_dashboard_title()
results = produce_artifacts(input=storage.workdir, output=output, scenario=scenario, options=render_options)
log.info("Produced %s results\n%s", len(results), json.dumps(results, indent=2))
4 changes: 2 additions & 2 deletions grafanimate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def resolve_reference(module, symbol):
if isinstance(reference, AnimationScenario):
pass
elif isinstance(reference, (AnimationSequence, list)):
reference = AnimationScenario(steps=as_list(reference))
reference = AnimationScenario(sequences=as_list(reference))
return reference


Expand Down Expand Up @@ -105,7 +105,7 @@ def run_animation_scenario(scenario: AnimationScenario, grafana: GrafanaWrapper,
animation.start()

# Run animation scenario.
for step in scenario.steps:
for step in scenario.sequences:
results = animation.run(step)
storage.save_items(results)

Expand Down
2 changes: 1 addition & 1 deletion grafanimate/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def convert_timestamp(self, value: Union[datetime, str]) -> datetime:

@dataclasses.dataclass
class AnimationScenario:
steps: List[AnimationSequence]
sequences: List[AnimationSequence]
grafana_url: Optional[str] = None
dashboard_uid: Optional[str] = None
dashboard_title: Optional[str] = None
Expand Down
4 changes: 2 additions & 2 deletions grafanimate/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def playdemo():
return AnimationScenario(
grafana_url="https://play.grafana.org/",
dashboard_uid="000000012",
steps=[
sequences=[
AnimationSequence(
dtstart=datetime(2021, 11, 14, 2, 0, 0),
# Produce video with reasonable duration to explore different rendering options.
Expand All @@ -71,7 +71,7 @@ def playdemo_advanced():
return AnimationScenario(
grafana_url="https://play.grafana.org/",
dashboard_uid="000000012",
steps=[
sequences=[
AnimationSequence(
dtstart=datetime(2021, 11, 14, 2, 0, 0),
dtuntil=datetime(2021, 11, 14, 2, 16, 36),
Expand Down

0 comments on commit 3c3c425

Please sign in to comment.