vrodgom / statmorph

Python code for calculating non-parametric morphological diagnostics of galaxy images.
BSD 3-Clause "New" or "Revised" License
42 stars 15 forks source link

Safer version test for photutils dev versions #5

Closed gbrammer closed 5 years ago

gbrammer commented 5 years ago

This is a quick fix to the check on the photutils module version, which can be a string that doesn't convert to a float. String tests with >, <, etc. work for well-formed version numbers, for example:

>>> import photutils             
>>> msg = 'Version {0} is > 0.5 .... {1}'                                           
>>> print(msg.format(photutils.__version__, photutils.__version__ > '0.5'))
Version 0.7.dev3423 is > 0.5 .... True
vrodgom commented 5 years ago

Looks good. Thanks!