Skip to content

Inconsistent parameter name in RadarGridParameters.__init__() #272

@nemo794

Description

@nemo794

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions