cBLUE-dev-team / cBLUE.github.io

cBLUE is a tool to calculate the total propagated uncertainty of bathymetric lidar data.
https://noaa-rsd.github.io/cBLUE.github.io/
GNU Lesser General Public License v2.1
12 stars 1 forks source link

NV5G GUI Decouple with Command Line Interface #69

Closed AustinZAnderson closed 1 year ago

AustinZAnderson commented 1 year ago

Ready for review! Feel free to reach out any time.

The two main design goals were to (1) make a CLI available and (2) have the GUI use the CLI so there is a single code path to maintain and GUI users always get the same results as CLI users.

The CBlueAppGUI.py file contains all GUI related code and attempts to mirror the design of the GUI when it was contained in the CBlueApp.py file. The main change to the GUI is the addition of a "Water Surface" input field and there is now a single "Process" button instead of having one button for processing SBETs and another for processing TPU.

A command line interface was added to the CBlueApp.py file, which the GUI calls when "Process" is clicked. After removing the GUI code from CBlueApp.py I attempted to exactly mirror the behavior of the previous code, with the one exception that the SBET processing steps now flow directly into TPU processing.

The execution code is consolidated into a single CBlueApp function and all parameters are stored in a dictionary. The UserInput.py file was modified to make use of this dictionary. As discussed on our call, I ended up storing this info in the cblue_configuration.json file too, which now gets written to the output folder instead of the cBlue code folder. I don't have a strong preference about any of these implementation details.

Please feel free to modify or submit change requests. Thanks for meeting and looking forward to future collaboration :)

AustinZAnderson commented 1 year ago

Please note that one of my commits is called "Add alternative code path for CLI" - this was how I originally implemented the CLI (changing as little CBlueApp.py code as possible and adding a CBlueAppCmd.py file) but I scrapped that approach for the final design in favor of a single code path. The final design required significant changes to the CBlueApp.py file to decouple the GUI, but my thinking was that it would simplify code maintenance and ensure that the GUI and CLI were always in sync.