Aufgrund einer Wartung wird GitLab am 18.05. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 18.05. between 8:00 and 9:00 am.

Commit c288e0fa authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

consistently show column names for all simulations tools

parent 5cc4d322
...@@ -28,6 +28,10 @@ def read_timeseries_Modelica(filename, timeseries_names=None, is_regex=False): ...@@ -28,6 +28,10 @@ def read_timeseries_Modelica(filename, timeseries_names=None, is_regex=False):
timeseries = [] timeseries = []
for name in timeseries_names: for name in timeseries_names:
timeseries.append(TimeSeries(name, sim(name).times(), sim(name).values())) timeseries.append(TimeSeries(name, sim(name).times(), sim(name).values()))
print('Modelica results column names: ' + str(timeseries_names))
print('Modelica results number: ' + str(len(timeseries_list)))
return timeseries return timeseries
...@@ -44,6 +48,10 @@ def read_timeseries_PLECS(filename, timeseries_names=None): ...@@ -44,6 +48,10 @@ def read_timeseries_PLECS(filename, timeseries_names=None):
# Read in specified time series # Read in specified time series
for name in timeseries_names: for name in timeseries_names:
timeseries_list.append(TimeSeries(name, pd_df['Time'].values, pd_df[name].values)) timeseries_list.append(TimeSeries(name, pd_df['Time'].values, pd_df[name].values))
print('PLECS results column names: ' + str(timeseries_names))
print('PLECS results number: ' + str(len(timeseries_list)))
return timeseries_list return timeseries_list
def read_timeseries_dpsim_real(filename, timeseries_names=None): def read_timeseries_dpsim_real(filename, timeseries_names=None):
...@@ -61,9 +69,6 @@ def read_timeseries_dpsim_real(filename, timeseries_names=None): ...@@ -61,9 +69,6 @@ def read_timeseries_dpsim_real(filename, timeseries_names=None):
pd_df.rename(columns=lambda x: x.strip(), inplace=True) pd_df.rename(columns=lambda x: x.strip(), inplace=True)
column_names = list(pd_df.columns.values) column_names = list(pd_df.columns.values)
print('DPsim results column names: ' + str(column_names))
print('DPsim results number: ' + str(len(timeseries_list)))
# Remove timestamps column name and store separately # Remove timestamps column name and store separately
column_names.remove('time') column_names.remove('time')
timestamps = pd_df.iloc[:,0] timestamps = pd_df.iloc[:,0]
...@@ -75,6 +80,9 @@ def read_timeseries_dpsim_real(filename, timeseries_names=None): ...@@ -75,6 +80,9 @@ def read_timeseries_dpsim_real(filename, timeseries_names=None):
# Read in specified time series # Read in specified time series
print('no column names specified yet') print('no column names specified yet')
print('DPsim results column names: ' + str(column_names))
print('DPsim results number: ' + str(len(timeseries_list)))
return timeseries_list return timeseries_list
def read_timeseries_dpsim_cmpl(filename, timeseries_names=None): def read_timeseries_dpsim_cmpl(filename, timeseries_names=None):
...@@ -92,9 +100,6 @@ def read_timeseries_dpsim_cmpl(filename, timeseries_names=None): ...@@ -92,9 +100,6 @@ def read_timeseries_dpsim_cmpl(filename, timeseries_names=None):
pd_df.rename(columns=lambda x: x.strip(), inplace=True) pd_df.rename(columns=lambda x: x.strip(), inplace=True)
column_names = list(pd_df.columns.values) column_names = list(pd_df.columns.values)
print('DPsim results column names: ' + str(column_names))
print('DPsim results number: ' + str(len(timeseries_list)))
# Remove timestamps column name and store separately # Remove timestamps column name and store separately
column_names.remove('time') column_names.remove('time')
timestamps = pd_df.iloc[:,0] timestamps = pd_df.iloc[:,0]
...@@ -113,6 +118,9 @@ def read_timeseries_dpsim_cmpl(filename, timeseries_names=None): ...@@ -113,6 +118,9 @@ def read_timeseries_dpsim_cmpl(filename, timeseries_names=None):
# Read in specified time series # Read in specified time series
print('cannot read specified columns yet') print('cannot read specified columns yet')
print('DPsim results column names: ' + str(column_names))
print('DPsim results number: ' + str(len(timeseries_list)))
return timeseries_list return timeseries_list
def read_timeseries_dpsim_cmpl_separate(filename, timeseries_names=None): def read_timeseries_dpsim_cmpl_separate(filename, timeseries_names=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment