I have a script which utilizes the Py-ART package to read in airborne weather radar data and then perform quality control on said data. I'll note that I suspect this is not an issue with that package, otherwise I'd just post an issue to that repo...
The confusing aspect of this issue is that the code runs flawlessly on my machine, in both Python 2.x and 3.x, though it fails with the following error on a colleague's machine in Python 2.x:
TypeError: cannot concatenate 'str' and 'int' objects
The error is triggered upon trying to execute the final line of this block of code:
az_raw = radar.azimuth['data'].data
roll = radar.roll['data'].data
azmth = az_raw + roll
azmth[azmth < 0] += 360
Some potential clues I've deduced from investigating the issue:
On my machine, where the code runs properly, the
az_raw
androll
variables are read in as arrays of typefloat32
, whereas on my colleague's machine, these variables have aBuffer
type. Upon adding the contents ofroll
toaz_raw
(element-by-element),azmth
remains as an array offloat32
on my machine, and becomes an array ofstr
on the other machine.Py-ART uses the netCDF4 package to read in the data from the netCDF input files - perhaps there is a machine and/or version related issue here?
The issue persists regardless of the input file (i.e., we've tried several, and from different data collection periods/projects with the same results.
So ultimately, my question comes down to what would cause a TypeError
like this on one machine but not another when all else appears to be the same? I suppose there could be a dependency version difference (of Py-ART, netCDF4, etc.) between the two machines, but it's not clear to me how that would cause such an issue. Has anyone seen anything similar to this before?