Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cwmscli/load/timeseries/timeseries.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from datetime import datetime, timedelta
from typing import Optional

Expand Down Expand Up @@ -70,7 +71,7 @@ def load_timeseries_ids_all(
"ts_id",
default=None,
type=str,
help="Timeseries ID to copy, or a comma-delimited list of IDs.",
help="Timeseries ID to copy, or a comma/newline-delimited list of IDs.",
)
@click.option(
"--ts-group",
Expand Down Expand Up @@ -125,7 +126,7 @@ def load_timeseries_data(
):
ts_ids = None
if ts_id:
ts_ids = [item.strip() for item in ts_id.split(",") if item.strip()]
ts_ids = [item.strip() for item in re.split(r"[,\r\n]+", ts_id) if item.strip()]

@krowvin krowvin Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making a one-off comment here that carriage return is typically windows. But I suspect these would always be pasted from windows?

And noting it would probably be this logic?

, or \r or \n

@msweier msweier Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but just trying to cover the bases. And yes that is the correct logic. It will split any combination of commas, /r, or /n. The + will treat any consecutive delimiters (like \r\n) as one.

Tested , and /r locally.

if not ts_ids:
raise click.UsageError(
"--ts-id must contain at least one non-empty timeseries ID."
Expand Down
Loading