Order demand, pattern and curve
This commit is contained in:
@@ -7,7 +7,7 @@ def get_pattern_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
|
||||
|
||||
def get_pattern(name: str, id: str) -> dict[str, Any]:
|
||||
pas = read_all(name, f"select * from patterns where id = '{id}'")
|
||||
pas = read_all(name, f"select * from patterns where id = '{id}' order by _order")
|
||||
ps = []
|
||||
for r in pas:
|
||||
ps.append(float(r['factor']))
|
||||
|
||||
@@ -9,7 +9,7 @@ def get_curve_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
|
||||
|
||||
def get_curve(name: str, id: str) -> dict[str, Any]:
|
||||
cus = read_all(name, f"select * from curves where id = '{id}'")
|
||||
cus = read_all(name, f"select * from curves where id = '{id}' order by _order")
|
||||
cs = []
|
||||
for r in cus:
|
||||
cs.append({ 'x': float(r['x']), 'y': float(r['y']) })
|
||||
|
||||
@@ -10,7 +10,7 @@ def get_demand_schema(name: str) -> dict[str, dict[str, Any]]:
|
||||
|
||||
|
||||
def get_demand(name: str, junction: str) -> dict[str, Any]:
|
||||
des = read_all(name, f"select * from demands where junction = '{junction}'")
|
||||
des = read_all(name, f"select * from demands where junction = '{junction}' order by _order")
|
||||
ds = []
|
||||
for r in des:
|
||||
d = {}
|
||||
|
||||
Reference in New Issue
Block a user