Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Common Changelog](https://common-changelog.org/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed

- update regex for filename pattern to recognize optional NRT label in TEMPO NRT collections ([#187](https://github.com/nasa/batchee/pull/187))([**@ank1m**](https://github.com/ank1m))

## [1.4.0] - 2025-08-20

### Changed
Expand Down
1 change: 1 addition & 0 deletions batchee/tempo_filename_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
r"(?P<product_type>[1-9A-Z]+)"
r"(?P<proxy>(?:-PROXY)*)_"
r"(?P<processing_level>L[0-9])_"
r"(?P<nrt>NRT_)?"
r"(?P<version_id>V[0-9]+)_"
r"(?P<day_in_granule>[0-9]{8})T"
r"(?P<time_in_granule>[0-9]{6})Z_"
Expand Down
18 changes: 18 additions & 0 deletions tests/test_filename_grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
"TEMPO_NO2_L2_V03_20240801T234630Z_S016G03.nc",
]

example_nrt_filenames = [
"TEMPO_NO2_L2_NRT_V02_20250711T183227Z_S010G04.nc",
"TEMPO_NO2_L2_NRT_V02_20250711T183904Z_S010G05.nc",
"TEMPO_NO2_L2_NRT_V02_20250711T184541Z_S010G06.nc",
"TEMPO_NO2_L2_NRT_V02_20250711T185856Z_S010G08.nc",
"TEMPO_NO2_L2_NRT_V02_20250712T000606Z_S016G03.nc",
"TEMPO_NO2_L2_NRT_V02_20250712T001927Z_S016G05.nc",
"TEMPO_NO2_L2_NRT_V02_20250712T161248Z_S008G01.nc",
"TEMPO_NO2_L2_NRT_V02_20250712T162608Z_S008G03.nc",
"TEMPO_NO2_L2_NRT_V02_20250712T170552Z_S008G09.nc",
]


def test_timezone_conversion():
utcdates = [filename.split("_")[4] for filename in example_filenames]
Expand All @@ -39,6 +51,12 @@ def test_grouping():
assert results == [0, 0, 0, 1, 1, 1, 2, 2, 2]


def test_nrt_grouping():
results = get_batch_indices(example_nrt_filenames)

assert results == [0, 0, 0, 0, 1, 1, 2, 2, 2]


def test_main_cli():
test_args = [batchee.tempo_filename_parser.__file__, "-v"]
test_args.extend(example_filenames)
Expand Down
Loading