h-a-graham / Metashape_Auto_Workflow

An automated workflow for processing drone imagery in PhotoScan
3 stars 0 forks source link

Introduce compatability checking #21

Open AndrewCunliffe opened 3 years ago

AndrewCunliffe commented 3 years ago

Probably worth introducing a compatibility check at least to script 1, to head off issues with the script potentially working in different ways on different software versions.

Checks the version and kills the execution if the hardcoded version numbers aren't consistent. I think this would be a good idea to introduce to our script? (at least script 1)?

Checking compatibility

compatible_major_version = "1.7" found_major_version = ".".join(Metashape.app.version.split('.')[:2]) if found_major_version != compatible_major_version: raise Exception("Incompatible Metashape version: {} != {}".format(found_major_version, compatible_major_version))

Example from https://github.com/agisoft-llc/metashape-scripts/blob/master/src/samples/general_workflow.py

h-a-graham commented 3 years ago

Why do we think there is a compatibility issue? Is a warning not more appropriate here?

h-a-graham commented 3 years ago

@GlennSlade

AndrewCunliffe commented 3 years ago

Maybe warning is okay but how to warn effectively if running headless?

h-a-graham commented 3 years ago

What is incompatible, how wrong would you expect it to be or will the script fall over if run on an old version?

AndrewCunliffe commented 3 years ago

Should fall over if run on too old a version, object names have changed over time and some functionality won't exist on older versions

h-a-graham commented 3 years ago

In which case an error may be more appropriate.

AndrewCunliffe commented 3 years ago

Esp. for headless runs that might take 10 days to get wrong!