Commit d680e52d authored by Jorn Baayen's avatar Jorn Baayen

Fixed incosistencies between naming of private methods.

parent 656feb55
......@@ -344,14 +344,14 @@ class CSVMixin(OptimizationProblem):
else:
write_output(0, self.__output_folder)
def _datetime_to_sec(self, d):
def __datetime_to_sec(self, d):
# Return the date/timestamps in seconds since t0.
if hasattr(d, '__iter__'):
return np.array([(t - self.__timeseries_times[0]).total_seconds() for t in d])
else:
return (d - self.__timeseries_times[0]).total_seconds()
def _sec_to_datetime(self, s):
def __sec_to_datetime(self, s):
# Return the date/timestamps in seconds since t0 as datetime objects.
if hasattr(s, '__iter__'):
return [self.__timeseries_times[0] + timedelta(seconds=t) for t in s]
......
......@@ -350,14 +350,14 @@ class PIMixin(OptimizationProblem):
# Write output file to disk
self.__timeseries_export.write()
def _datetime_to_sec(self, d):
def __datetime_to_sec(self, d):
# Return the date/timestamps in seconds since t0.
if hasattr(d, '__iter__'):
return np.array([(t - self.__timeseries_import.forecast_datetime).total_seconds() for t in d])
else:
return (d - self.__timeseries_import.forecast_datetime).total_seconds()
def _sec_to_datetime(self, s):
def __sec_to_datetime(self, s):
# Return the date/timestamps in seconds since t0 as datetime objects.
if hasattr(s, '__iter__'):
return [self.__timeseries_import.forecast_datetime + timedelta(seconds=t) for t in s]
......
......@@ -191,14 +191,14 @@ class CSVMixin(SimulationProblem):
fname = os.path.join(self.__output_folder, 'timeseries_export.csv')
csv.save(fname, data, delimiter=self.csv_delimiter, with_time=True)
def _datetime_to_sec(self, d):
def __datetime_to_sec(self, d):
# Return the date/timestamps in seconds since t0.
if hasattr(d, '__iter__'):
return np.array([(t - self.__timeseries_times[0]).total_seconds() for t in d])
else:
return (d - self.__timeseries_times[0]).total_seconds()
def _sec_to_datetime(self, s):
def __sec_to_datetime(self, s):
# Return the date/timestamps in seconds since t0 as datetime objects.
if hasattr(s, '__iter__'):
return [self.__timeseries_times[0] + timedelta(seconds=t) for t in s]
......
......@@ -213,14 +213,14 @@ class PIMixin(SimulationProblem):
# Write output file to disk
self.__timeseries_export.write()
def _datetime_to_sec(self, d):
def __datetime_to_sec(self, d):
# Return the date/timestamps in seconds since t0.
if hasattr(d, '__iter__'):
return np.array([(t - self.__timeseries_import.forecast_datetime).total_seconds() for t in d])
else:
return (d - self.__timeseries_import.forecast_datetime).total_seconds()
def _sec_to_datetime(self, s):
def __sec_to_datetime(self, s):
# Return the date/timestamps in seconds since t0 as datetime objects.
if hasattr(s, '__iter__'):
return [self.__timeseries_import.forecast_datetime + timedelta(seconds=t) for t in s]
......
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