cwms-cli 0.7.1__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/PKG-INFO +1 -1
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/shef/import_infile.py +18 -8
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/pyproject.toml +1 -1
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/LICENSE +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/README.md +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/__main__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/_generated/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/_generated/ownership_data.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/callbacks/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/blob.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/clob.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/commands_cwms.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/.gitignore +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/README.md +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/__main__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/config.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/doclinks.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/examples/complete_config.json +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/parser.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/data/.gitignore +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/data/expected_brok_output.json +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/data/sample_brok.csv +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/data/sample_config.json +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/skip_test_integration_pipeline.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/test_dateutils.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/test_expressions.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/test_fileio.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/test_main.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/transform.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/utils/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/utils/dateutils.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/utils/expression.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/utils/fileio.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/utils/logging.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/writer.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/shef/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/shef/import_critfile.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/shef/shef_parameters.csv +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/users.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/README.md +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/__main__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/location/location.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/location/location_ids.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/location/location_ids_bygroup.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/root.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/timeseries/timeseries.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/timeseries/timeseries_data.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/load/timeseries/timeseries_ids.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/ownership.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/requirements.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/usgs/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/usgs/__main__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/usgs/getUSGS_ratings_cda.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/usgs/getusgs_cda.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/usgs/getusgs_measurements_cda.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/usgs/rating_ini_file_import.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/auth.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/callback_success.html +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/click_help.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/colors.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/deps.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/friendly_errors.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/intervals.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/io.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/links.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/logging/__init__.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/logging/formatters.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/ssl_errors.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/update.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/version.py +0 -0
- {cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/utils/version_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cwms-cli
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: Command line utilities for Corps Water Management Systems (CWMS) python scripts. This is a collection of shared scripts across the enterprise Water Management Enterprise System (WMES) teams.
|
|
5
5
|
License: LICENSE
|
|
6
6
|
License-File: LICENSE
|
|
@@ -388,17 +388,23 @@ def _contextual_parse(
|
|
|
388
388
|
current_send_code = "ZZZ"
|
|
389
389
|
current_shef_loc: Optional[str] = None
|
|
390
390
|
location_map: dict[str, str] = {} # cwms_location_name -> shef_id
|
|
391
|
+
version_send_codes: dict[str, str] = {} # cwms_version -> send_code
|
|
391
392
|
|
|
392
393
|
for raw in text.splitlines():
|
|
393
394
|
s = raw.strip()
|
|
394
395
|
if not s or s.startswith("#"):
|
|
395
396
|
continue
|
|
396
397
|
|
|
397
|
-
# TS * = SEND_CODE
|
|
398
|
-
m = re.match(r"^TS\s
|
|
398
|
+
# TS * = SEND_CODE or TS VersionName = SEND_CODE
|
|
399
|
+
m = re.match(r"^TS\s+(\S+)\s*=\s*(\S+)\s*$", s, re.IGNORECASE)
|
|
399
400
|
if m:
|
|
400
|
-
|
|
401
|
-
|
|
401
|
+
ts_key, ts_val = m.group(1), m.group(2)
|
|
402
|
+
if ts_key == "*":
|
|
403
|
+
current_send_code = ts_val
|
|
404
|
+
log.debug("Send code → %s", ts_val)
|
|
405
|
+
else:
|
|
406
|
+
version_send_codes[ts_key] = ts_val
|
|
407
|
+
log.debug("Version send code: %s → %s", ts_key, ts_val)
|
|
402
408
|
continue
|
|
403
409
|
|
|
404
410
|
# PE pattern = CODE[;units=UNIT] (positional — update mappings in place)
|
|
@@ -458,6 +464,7 @@ def _contextual_parse(
|
|
|
458
464
|
cwms_location = cwms_parts[0]
|
|
459
465
|
cwms_parameter = cwms_parts[1]
|
|
460
466
|
cwms_duration = cwms_parts[4]
|
|
467
|
+
cwms_version = cwms_parts[5]
|
|
461
468
|
|
|
462
469
|
# Resolve SHEF location
|
|
463
470
|
# 1. Exact match in location_map
|
|
@@ -491,10 +498,12 @@ def _contextual_parse(
|
|
|
491
498
|
shef_loc = mapped_value
|
|
492
499
|
if not shef_loc:
|
|
493
500
|
shef_loc = current_shef_loc
|
|
494
|
-
|
|
495
501
|
if not shef_loc:
|
|
496
|
-
|
|
497
|
-
|
|
502
|
+
shef_loc = cwms_location
|
|
503
|
+
log.debug(
|
|
504
|
+
"No LOCATION mapping for %s — using CWMS location as SHEF ID",
|
|
505
|
+
cwms_location,
|
|
506
|
+
)
|
|
498
507
|
|
|
499
508
|
# Resolve PE code (first matching rule wins)
|
|
500
509
|
pe_code = _resolve_pe_code(cwms_parameter, pe_mappings)
|
|
@@ -511,12 +520,13 @@ def _contextual_parse(
|
|
|
511
520
|
if not units and pe_code in pe_units:
|
|
512
521
|
units = pe_units[pe_code]
|
|
513
522
|
|
|
523
|
+
send_code = version_send_codes.get(cwms_version, current_send_code)
|
|
514
524
|
entry = {
|
|
515
525
|
"tsid": tsid_str,
|
|
516
526
|
"shef_loc": shef_loc,
|
|
517
527
|
"pe_code": pe_code,
|
|
518
528
|
"duration": str(duration_value),
|
|
519
|
-
"send_code":
|
|
529
|
+
"send_code": send_code,
|
|
520
530
|
}
|
|
521
531
|
if units:
|
|
522
532
|
entry["units"] = units
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/data/expected_brok_output.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cwms_cli-0.7.1 → cwms_cli-0.7.2}/cwmscli/commands/csv2cwms/tests/skip_test_integration_pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|