From 1a9793f5f118921dd26960e645452f27802abdc3 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 3 Apr 2024 19:37:37 -0700 Subject: [PATCH] updated test scripts --- examples/example_1.py | 4 ++-- test/test_1.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/example_1.py b/examples/example_1.py index 5ef095d..f5e7c4d 100644 --- a/examples/example_1.py +++ b/examples/example_1.py @@ -2,6 +2,7 @@ AFC example1 test module. """ +import io import os import sys import time @@ -58,8 +59,7 @@ def example1(): # 'opt_duration','outputs_duration','duration'])) #print('Optimization:') #pprint.pprint(ctrl.get_output(keys=['opt_objective','opt_duration','opt_termination','duration'])) - df = pd.DataFrame(ctrl.get_output(keys=['output-data'])['output-data']) - df.index = pd.to_datetime(pd.to_numeric(df.index), unit='ms') + df = pd.read_json(io.StringIO(ctrl.get_output(keys=['output-data'])['output-data'])) print('Facade actuation during the day (when DNI > 0).') print('Facade 0 = bottom zone, Facade 1 = middle zone, Facade 2 = top zone') print('State 0.0 = fully tinted, State 1.0 and 2.0 = intermediate tint, state 3.0 = clear (double low-e)\n') diff --git a/test/test_1.py b/test/test_1.py index 294a1c0..e86e142 100644 --- a/test/test_1.py +++ b/test/test_1.py @@ -2,6 +2,7 @@ AFC example1 test module. """ +import io import os import sys import time @@ -46,8 +47,7 @@ def test1(): # Query controller ctrl.do_step(inputs=inputs) - df = pd.DataFrame(ctrl.get_output(keys=['output-data'])['output-data']) - df.index = pd.to_datetime(df.index, unit='ms') + df = pd.read_json(io.StringIO(ctrl.get_output(keys=['output-data'])['output-data'])) # check res = ctrl.get_output(keys=['opt-stats', 'duration'])