Skip to content

FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated.

IN glance/data.py, around line 371 is this:

            # if we're looking at float or complex data, use a nan
            if (np.issubdtype(type_to_return, np.float) or
                np.issubdtype(type_to_return, np.complex)) :
                fill_value_to_return = np.nan
                LOG.info("float or complex: using "+str(fill_value_to_return))

np.float in that test is treated as np.floating.

As of NumPy 1.18.5, this is deprecated:

[...]glance/data.py:371: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  if (np.issubdtype(type_to_return, np.float) or

As of NumPy 1.19.1, this silently fails; float32 is not considered a subtype of np.float, fill_value_to_return is left None, and later on glance complains that it doesn't know what the fill value is:

Traceback (most recent call last):
  File "/home/adesmet/src/glance/anaconda/bin/glance", line 11, in <module>
    load_entry_point('uwglance', 'console_scripts', 'glance')()
  File "/home/adesmet/src/glance/pyglance/glance/compare.py", line 1613, in main
    rc = lower_locals[args[0].lower()](*args[1:])
  File "/home/adesmet/src/glance/pyglance/glance/compare.py", line 1394, in reportGen
    return reportGen_library_call(a_path, b_path, args[2:], tempOptions)
  File "/home/adesmet/src/glance/pyglance/glance/compare.py", line 843, in reportGen_library_call
    variable_stats = statistics.StatisticalAnalysis.withSimpleData(aData, bData,
  File "/home/adesmet/src/glance/pyglance/glance/stats.py", line 880, in withSimpleData
    diffInfo    = dataobj.DiffInfoObject(aDataObject, bDataObject,
  File "/home/adesmet/src/glance/pyglance/glance/data.py", line 326, in __init__
    self.diff_data_object = DiffInfoObject.analyze(aDataObject, bDataObject,
  File "/home/adesmet/src/glance/pyglance/glance/data.py", line 425, in analyze
    assert(fill_data_value is not None)
AssertionError

Changing np.float to np.floating solves the problem.