Applied-GeoSolutions / gips

Geospatial Image Processing System
GNU General Public License v3.0
17 stars 5 forks source link

kick `--rectify` out of `gips_inventory` script #419

Open ircwaves opened 7 years ago

ircwaves commented 7 years ago

gips.parsers.GIPSParser.add_inventory_parser changed (since some drivers need to controll parallelism and chunk size during fetch), and hence guard condition here regressed: https://github.com/Applied-GeoSolutions/gips/blob/fa059ff237e79fb96ab169b485f8e942db3ce15b/gips/scripts/inventory.py#L78-L81

I have modified it to emit a warning informing the user that other options don't effect rectify, but I think this highlights that rectify is different enough from a gips_inventory option to be considered its own script, or part of a different script (gips_admin --rectify [driver] or all drivers in the absence of [driver] maybe?).

ra-tolson commented 7 years ago

Separating functionality into different command-line tools, so each does fewer things, seems like a sensible choice generally. If we can find enough uses for gips_admin then that sounds good to me, though I wonder what gips_admin would do in the absense of options . . . maybe some kind of status report?

I kinda think we have to change something else too, sooner or later. It's pretty much standard for frontends (CLI and otherwise) to have validation functions for input arguments, but gips doesn't have them. So there's no established place to look for code that might break if you change options around. Moreover, if they were functions, it'd be easy to write unit tests, which probably would've caught this.