Note 1: this Issue is a copy of https://github-fn.jpl.nasa.gov/isce-3/isce/issues/2094 (internal repo), submitted Dec 11, 2024 by @gmgunter . Links below have been updated for public GitHub.
Note 2: this issue was rediscovered while implementing a PR for nisarqa: isce-framework/nisarqa#161 . nisarqa is currently implemented to use the lookside spelling (no underscore) and always pass an isce3.core.LookSide object. In other words, if the final decision to resolve this issue changes the interface to always use look_side (with an underscore), then one downstream impact is that nisarqa will also need to be updated.
In the pybind11 bindings for isce3.product.RadarGridParameters, two constructors are exposed (well, technically there's a third constructor as well, but it's silly and not relevant here).
One constructor allows passing the look direction as an isce3.core.LookSide object:
|
.def(py::init<double, double, double, double, double, LookSide, |
|
size_t, size_t, DateTime>(), |
The other constructor allows passing the look direction as a string (like "Left" or "Right"):
|
.def(py::init([](double sensing_start, |
|
double wavelength, |
|
double prf, |
|
double starting_range, |
|
double range_pixel_spacing, |
|
const std::string& look_side, |
|
size_t length, |
|
size_t width, |
|
const DateTime& ref_epoch) { |
Unfortunately, the parameter names for the look side arguments in the two constructors are different. The first constructor names it "lookside":
The second constructor names it "look_side" (with an underscore):
This is very inconvenient for writing generic code that can construct a RadarGridParameters object from either an isce3.core.LookSide or a string. Ideally, we should make the two parameter names consistent.
The first constructor's name is consistent with the name of the RadarGridParameters.lookside attribute, so it should probably be preferred. However, a lot of code in isce3 will be broken by renaming the "look_side" parameter of the second constructor to "lookside".
Note 1: this Issue is a copy of https://github-fn.jpl.nasa.gov/isce-3/isce/issues/2094 (internal repo), submitted Dec 11, 2024 by @gmgunter . Links below have been updated for public GitHub.
Note 2: this issue was rediscovered while implementing a PR for
nisarqa: isce-framework/nisarqa#161 .nisarqais currently implemented to use thelooksidespelling (no underscore) and always pass anisce3.core.LookSideobject. In other words, if the final decision to resolve this issue changes the interface to always uselook_side(with an underscore), then one downstream impact is thatnisarqawill also need to be updated.In the pybind11 bindings for
isce3.product.RadarGridParameters, two constructors are exposed (well, technically there's a third constructor as well, but it's silly and not relevant here).One constructor allows passing the look direction as an
isce3.core.LookSideobject:isce3/python/extensions/pybind_isce3/product/RadarGridParameters.cpp
Lines 32 to 33 in 2919e1c
The other constructor allows passing the look direction as a string (like "Left" or "Right"):
isce3/python/extensions/pybind_isce3/product/RadarGridParameters.cpp
Lines 43 to 51 in 2919e1c
Unfortunately, the parameter names for the look side arguments in the two constructors are different. The first constructor names it "lookside":
isce3/python/extensions/pybind_isce3/product/RadarGridParameters.cpp
Line 39 in 2919e1c
The second constructor names it "look_side" (with an underscore):
isce3/python/extensions/pybind_isce3/product/RadarGridParameters.cpp
Line 64 in 2919e1c
This is very inconvenient for writing generic code that can construct a
RadarGridParametersobject from either anisce3.core.LookSideor a string. Ideally, we should make the two parameter names consistent.The first constructor's name is consistent with the name of the
RadarGridParameters.looksideattribute, so it should probably be preferred. However, a lot of code in isce3 will be broken by renaming the "look_side" parameter of the second constructor to "lookside".