Results: Fix timestamps order.

This commit is contained in:
parouby committed 2025-09-26 10:23:55 +02:00
1 parent 4dc4dfdda0
commit 137489cc1f
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -164,7 +164,7 @@ class Results(SQLSubModel):
ts = struct.unpack(sf, timestamps_bytes) ts = struct.unpack(sf, timestamps_bytes)
new_results.set("timestamps", ts) new_results.set("timestamps", ts)
data["timestamps"] = ts data["timestamps"] = sorted(ts)
new_results._river = River._db_load(execute, data) new_results._river = River._db_load(execute, data)
new = new_results new = new_results
@@ -192,7 +192,7 @@ class Results(SQLSubModel):
solver_name = self._solver._name solver_name = self._solver._name
solver_type = self._solver._type solver_type = self._solver._type
ts = self.get("timestamps") ts = sorted(self.get("timestamps"))
sf = ">" + ''.join(itertools.repeat("d", len(ts))) sf = ">" + ''.join(itertools.repeat("d", len(ts)))
execute( execute(
+2 -1
View File
@@ -65,7 +65,8 @@ class Profile(SQLSubModel):
def get_key(self, key): def get_key(self, key):
res = list( res = list(
map(lambda ts: self._data[ts][key], self._data) map(lambda ts: self._data[ts][key],
sorted(self._data.keys()))
) )
return res return res