TravelModellingGroup/TMGToolbox

Warning message from matrix statistics tool

malamillo opened this issue · 7 comments

Hi:

When running the mm.tool('tmg.analysis.matrix_statistics') in a python script I get a warning message:

C:/Users/ALAMIL~1/AppData/Local/Temp/matrix_statistics-5fbd66e1b33b11e7a6df463500000031.py:515: FutureWarning: comparison to None will result in an elementwise object comparison in the future.

The end results look okay but what is this message trying to address?

Thanks.

This particular error is super easy to fix, just change L515 to:

if weightedHistogram is not None: writer.write(",wFreq")

This is a legacy error on my part, from back before I learned the correct way of testing against None values (using is and is not rather than == and !=). There are a lot more of them and they ought to be fixed.

I'm going to take a crack at this using Find...Replace since it's my bad.

Oh and I should mention that this has no bearing on your results. It looks like NumPy is being forgiving in this case, but the warning you're seeing is letting me know that this might break in future versions of the package.

Thanks!
I'll apply a fix to on my end since I don't wish to replace my TMG toolbox for now.

Thank you Peter for your help. your merge request has been approved. I think this issue can now be closed

Fix included in merge #34 .

Just FYI this was pulled into dev not master so y'all can integrate this with your ongoing development work.