sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
216 stars 112 forks source link

Inconsistent Types for Parameter Values #109

Closed aarande closed 5 years ago

aarande commented 7 years ago

Hello All,

I just updated SHARPpy to the latest on master. An issue I am now running into is it appears the types of data for parameter values are inconsistent.

For example when I try to access different parameters in a parcel such as bplus, bminus, etc I have seen them returned as three different types (float, float64, and MaskedArray). The type that returns varies from profile to profile it appears so I am forced to check the type and grab the actual value accordingly. The most troublesome part is the MaskedArray as now I have to check if I get a float or a MaskedArray back and if it is an array I need to call item() on it to get the actual value. This is an unnecessary step and we should ensure the values are set consistently in the Profile.

I have not had a chance to test other values yet...just ones from parcel objects

Thanks, Aaron

wblumberg commented 7 years ago

Hi Aaron,

That's a good point about having consistent data types in the program. We're working on trying to get it to go to Python 3, and we're finding that trying to keep consistent data types may be problematic because Numpy often returns different data types from their functions than the type you put into them. This also possibly varies based upon the version of Numpy you also use. Have you been able to test the code with different versions of Numpy to see if this is a problem in only one version or many? If you can provide information about this, it may help us out in the long run towards rectifying this problem.

Thanks!

Greg