added range specicification

This commit is contained in:
Benoît Sierro
2024-01-12 11:35:49 +01:00
parent 9b2907b1cb
commit db77bef2af

View File

@@ -316,6 +316,12 @@ def sequence_from_specs(
return np.arange(start, stop + step, step)
if kind == "linear":
return np.linspace(start, stop, num)
elif kind == "range": # stop -> step
try:
return np.arange(start, start + num * stop, stop)
except Exception as e:
e.add_note(f"Trying to build range sequence from {start=}, step={stop}, {num=}")
raise
elif kind == "geometric":
return np.geomspace(start, stop, num)
elif kind == "geometric0":