Skip to content

fix: exit status of grs and exe/launcher.py (#13) - #28

Merged
Tristanovsk merged 1 commit into
feature/v3.xfrom
bugfix/exit-codes
Nov 13, 2026
Merged

Tristanovsk merged 1 commit into
feature/v3.xfrom
bugfix/exit-codes

Conversation

@Tristanovsk

Copy link
Copy Markdown
Collaborator

Fixes the exit status of the grs command and of exe/launcher.py reported in #13: a processing error ended with status 0, so the production chain went on to the Level-2B module with no Level-2A product.

Targets feature/v3.x so that the fix is part of #27.

Exit status

status meaning next steps (L2B)
0 L2A product written (or, with --no_clobber, already there) yes
1 processing error (traceback in log_file.log / error.log) no
2 invalid arguments, missing or unreadable input: Level-1, CAMS, SURFWATER, LUT (was -1, i.e. 255) no
3 image skipped on purpose, no product: cloud cover above the maximum, or not enough water (marker <name>_no_water.txt) (was 0) no

Changes

  • grs/run.py: main(argv=None) returns the status (constants EXIT_OK, EXIT_ERROR, EXIT_INPUT, EXIT_SKIPPED, listed in grs -h); input, CAMS, SURFWATER and DEM files checked before the processing; GRS_IO_Exception → 2; the log files are closed at the end of the run.
  • exe/launcher.py: same statuses; its noclobber check also finds the Zarr products (default output) and the no-water marker; log files closed on every path.
  • grs/tests/unit/test_exit_codes.py: every status for both entry points (fake processing), including the error of [Exception] GRS return an exit code 0 while output is not produced #13 (ValueError: arange: cannot compute length) → 1.
  • README (exit status table) and CHANGELOG.

The crash of #13 itself (np.arange on the solar angles, GRS 2.1.9) no longer exists in 3.x: the LUT preparation was rewritten and images without water stop early with the marker file.

On the L2B side (GRSl2bgen), the launcher should also check that its input exists before opening it.

Unit tests: 508 passed locally.

… 1 processing error, 2 invalid or missing input, 3 skipped on purpose (cloud cover, no water)
@Tristanovsk
Tristanovsk merged commit 7933b1c into feature/v3.x Nov 13, 2026
4 checks passed
@Tristanovsk
Tristanovsk deleted the bugfix/exit-codes branch November 13, 2026 14:54
Tristanovsk added a commit that referenced this pull request Nov 16, 2026
… fixed for Sentinel-2 (reference band, 0d76249) and Landsat (divided twice by sunglint_eps, edb2eaa), diffuse light interpolated in AOT, opt-in hybrid AOT under sunglint, log-log LUT interpolation in wavelength, stop when no clear-sky water is left; brings feature/v3.x (S3 inputs/outputs #29, exit codes #28) and the AERONET-OC match-up validation tooling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant