Edit and delete ranges
Rename a range, change its times or stage, and delete it.
Rename a range, change its times or its stage, or delete it. To change labels and metadata, see metadata and labels.
Rename a range
Console
Python
TypeScript
Right-click the range in the ranges toolbar or the range explorer and select Rename. You can also click the name on the range overview.
client.ranges.rename(my_range.key, "My Updated Range")await client.ranges.rename(myRange.key, "My Updated Range");Change the times or the stage
Console
Python
TypeScript
Arc
On the range overview, click the start or end time on the timeline and change it. To start, complete, or reopen the range, click its stage. Each stage change sets the start or end time. See stages.
The Console cannot change the color or the parent of a range.
Call client.ranges.set_time_range to change the start and end, or
client.ranges.set_end to change only the end. Call client.ranges.set_color and
client.ranges.set_parent to change the color and the parent. Pass None to clear the
color or to make the range top-level:
from datetime import datetime
import synnax as sy
my_range = client.ranges.retrieve(name="My Range")
client.ranges.set_time_range(
my_range.key,
sy.TimeRange(
start=sy.TimeStamp(datetime(2023, 2, 12, 13, 0)),
end=sy.TimeStamp(datetime(2023, 2, 12, 15, 0)),
),
)
client.ranges.set_color(my_range.key, "#00FF00")
client.ranges.set_parent(my_range.key, None)Call client.ranges.dispatch with a ranger.set action for each field to change. You
can change timeRange, color, and parent. Set color to null to clear it.
dispatch applies only to a range that the client holds in its cache. It returns
false and sends nothing when the range is not in the cache, so retrieve the range
first:
import { ranger, TimeRange, TimeStamp } from "@synnaxlabs/client";
const myRange = await client.ranges.retrieve("My Range");
const sent = await client.ranges.dispatch(myRange.key, [
ranger.set({
path: ["timeRange"],
value: new TimeRange(
new TimeStamp("2023-02-12 13:00:00"),
new TimeStamp("2023-02-12 15:00:00"),
),
}),
ranger.set({ path: ["color"], value: "#00FF00" }),
]);
if (!sent) throw new Error("My Range is not in the client cache");An automation can only end a range that it created. ranges.end sets the end to the
current time. Give it the key that ranges.create output:
import ranges
sequence test {
run_key str $= ""
stage idle {
start_cmd == 1 => run
}
stage run {
ranges.create(name="Hotfire", color="#3bc454") -> run_key
stop_cmd == 1 => done
}
stage done {
ranges.end(key=run_key)
start_cmd == 1 => run
}
}
true => testSee create ranges in Arc.
Do not call create with the key of a range to change it. The create fails because a
range already has the key.
Delete a range
Deleting a range also deletes its child ranges, its snapshots, its metadata, its aliases, and the schematics, line plots, logs, tables, and panels that it owns. It does not delete the data of the channels in the range.
Console
Python
TypeScript
Right-click the range in the ranges toolbar or the range explorer and select Delete, then confirm.

client.ranges.delete(my_range.key)
client.ranges.delete([my_range.key, my_other_range.key])A key that matches no range is ignored.
await client.ranges.delete(myRange.key);
await client.ranges.delete([myRange.key, myOtherRange.key]);