Skip to content

Commit

Permalink
Linter fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
calina-c committed Apr 3, 2024
1 parent da5f70d commit 3b9d564
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pdr_backend/sim/sim_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import pickle
import time
from datetime import datetime
from typing import Optional

import altair as alt
import numpy as np
import pandas as pd
from enforce_typing import enforce_types
from typing import Optional

from pdr_backend.aimodel.aimodel_plotdata import AimodelPlotdata

Expand Down
12 changes: 5 additions & 7 deletions sim_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
sim_plotter = SimPlotter()


def load_canvas_on_state(sim_plotter, new_ts):
titletext = (
f"Iter #{st.iter_number} ({new_ts})" if new_ts != "final" else "Final sim state"
)
def load_canvas_on_state(ts):
titletext = f"Iter #{st.iter_number} ({ts})" if ts != "final" else "Final sim state"
title.title(titletext)

canvas["pdr_profit_vs_time"].altair_chart(
Expand Down Expand Up @@ -105,12 +103,12 @@ def load_canvas_on_state(sim_plotter, new_ts):
time.sleep(1)
continue

load_canvas_on_state(sim_plotter, new_ts)
load_canvas_on_state(new_ts)
last_ts = new_ts

if last_ts == "final":
snapshots = SimPlotter.available_snapshots()
timestamp = inputs.select_slider("Go to snapshot", snapshots)
timestamp = inputs.select_slider("Go to snapshot", snapshots, value="final")
st, new_ts = sim_plotter.load_state(timestamp)
load_canvas_on_state(sim_plotter, timestamp)
load_canvas_on_state(timestamp)
break

0 comments on commit 3b9d564

Please sign in to comment.