diff --git a/core b/core index 9a080a3..5f1aaa7 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 9a080a34054c21a67236f761e8843005c07ff0ba +Subproject commit 5f1aaa704ac36252027b9da0064bdf1de063df0d diff --git a/plugins/python_providers/resources/amda.py b/plugins/python_providers/resources/amda.py index 399f8f0..e2a5741 100644 --- a/plugins/python_providers/resources/amda.py +++ b/plugins/python_providers/resources/amda.py @@ -15,6 +15,7 @@ amda = AMDA() def get_sample(metadata,start,stop): ts_type = pysciqlopcore.ScalarTimeSerie + default_ctor_args = 1 try: param_id = None for key,value in metadata: @@ -25,18 +26,18 @@ def get_sample(metadata,start,stop): ts_type = pysciqlopcore.VectorTimeSerie elif value == 'multicomponent': ts_type = pysciqlopcore.MultiComponentTimeSerie + default_ctor_args = (0,2) tstart=datetime.datetime.fromtimestamp(start, tz=timezone.utc) tend=datetime.datetime.fromtimestamp(stop, tz=timezone.utc) - df = amda.get_parameter(start_time=tstart, stop_time=tend, parameter_id=param_id) + df = amda.get_parameter(start_time=tstart, stop_time=tend, parameter_id=param_id, method="REST") #t = np.array([d.timestamp()-7200 for d in df.index]) t = np.array([d.timestamp() for d in df.index]) values = df.values return ts_type(t,values.transpose()) - return ts_type(1) except Exception as e: print(traceback.format_exc()) print("Error in amda.py ",str(e)) - return ts_type(1) + return ts_type(default_ctor_args) if len(amda.component) is 0: diff --git a/plugins/python_providers/resources/test.py b/plugins/python_providers/resources/test.py index 2e0f27e..3f895b7 100644 --- a/plugins/python_providers/resources/test.py +++ b/plugins/python_providers/resources/test.py @@ -3,6 +3,7 @@ sys.path.append("/home/jeandet/Documents/prog/build-SciQLop-Desktop-Debug/core") import PythonProviders import pysciqlopcore import numpy as np +import math someglobal = 1 @@ -25,7 +26,7 @@ def make_multicomponent(x): def get_data(metadata,start,stop): - x = np.arange(start, stop) + x = np.arange(math.ceil(start), math.floor(stop)) for key,value in metadata: if key == 'xml:id': param_id = value