GeoscienceAustralia / ga_sar_workflow

InSAR processing workflow used by Geoscience Australia
Apache License 2.0
3 stars 0 forks source link

Fix PathParameter issues around no value being provided / "None" #369

Closed mwheeler closed 2 years ago

mwheeler commented 2 years ago

This issue is to resolve a bug with PathParameter, where tasks which are given a None value (eg: no file/path provided) end up with a "None" string (which code tries to interpret as a file path), instead of an actual None value.

One example of this causing issues is IFG land center: https://github.com/GeoscienceAustralia/gamma_insar/blob/pygamma_workflow/insar/workflow/luigi/interferogram.py#L66-L71

self.shape_file is "None" thus a file called "None" is attempted to be read (and fails).

The issue stems somewhere within Luigi maybe? but an easy fix is probably just to add a work-around in PathParameter in the short term.

https://github.com/GeoscienceAustralia/gamma_insar/blob/pygamma_workflow/insar/workflow/luigi/utils.py#L114

None if (not arguments or arguments == "None") else Path(arguments) could probably work around this issue.