MAINT-28: test_maint28 reads the replay clock directly (main_files.live parsed every app file per cycle): 269 s -> 28 s, same numbers
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
29a8a05f30
commit
7edf8484d1
@@ -33,10 +33,9 @@ sys.path.insert(0, HERE)
|
||||
sys.path.insert(0, os.path.join(HERE, "tools"))
|
||||
logging.disable(logging.WARNING)
|
||||
|
||||
import main_files # noqa: E402
|
||||
import opt11p3_replay as rp # noqa: E402
|
||||
import opt20_scen as sc # noqa: E402
|
||||
from app import peakguard, tariff # noqa: E402
|
||||
from app import ctl_cycle, peakguard, tariff # noqa: E402
|
||||
from app.maintenance import DRAIN, IDLE, MaintResult # noqa: E402
|
||||
|
||||
fails = []
|
||||
@@ -100,7 +99,9 @@ def scen(*, a=None, tick=None, soc=(49.0, 30.0), house=None, house_w=3000.0,
|
||||
if fc == "grid":
|
||||
c.peak_fc = g
|
||||
else:
|
||||
now = main_files.live.datetime.now()
|
||||
# the replay's clock; not main_files.live (it parses
|
||||
# every app file per access: ~0.1 s a cycle).
|
||||
now = ctl_cycle.datetime.now()
|
||||
qi = int(now.timestamp() // 900)
|
||||
if q["q"] != qi:
|
||||
q.update(q=qi, s=0.0, last=now, start=now)
|
||||
|
||||
Reference in New Issue
Block a user