Skip to content

Commit 090e349

Browse files
authored
Merge pull request #277 from nsidc/issue-259
Issue-259
2 parents 7bc6e4d + 00c2e17 commit 090e349

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## UNRELEASED
2+
3+
* Issue-259: Fix white space bug in handling of `.premet` contents.
4+
15
## v1.11.0rc2 (2025-08-21)
26

37
* Issue-250: Use the current date/time to populate `ProductionDateTime` in UMM-G

src/nsidc/metgen/readers/utilities.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ def check_premet_keys(entry_type, parsed, expected):
134134

135135

136136
def parse_premet_entry(pline: str):
137-
return re.sub(r"\s+", "", pline).split("=")
137+
"""
138+
Break up a "key = value" pair, removing any beginning/trailing whitespace from the string parts.
139+
"""
140+
parts = pline.split("=")
141+
return [p.strip() for p in parts]
138142

139143

140144
def ensure_iso_datetime(datetime_str):

tests/test_utilities.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def premet_platform():
7676
"input,expected",
7777
[
7878
("akey = somevalue", ["akey", "somevalue"]),
79+
("akey = some longer value ", ["akey", "some longer value"]),
80+
(" a longer key = somevalue", ["a longer key", "somevalue"]),
7981
("adate = 2020-01-01", ["adate", "2020-01-01"]),
8082
("alat=74.5", ["alat", "74.5"]),
8183
("alon =100", ["alon", "100"]),

0 commit comments

Comments
 (0)