vMeijin / pySmithPlot

Matplotlib extension for creating Smith charts with Python
127 stars 73 forks source link

Make it compatible with numpy > 1.16 #28

Open jfosorio opened 4 years ago

jfosorio commented 4 years ago

In version of numpy higher than 1.16 the third argument of linspace is not be interpreted as integer and would produce and error.

https://docs.scipy.org/doc/numpy/release.html?highlight=histogram

Then matrix d_mat need to be initialized as a integer type.

alexpacini commented 4 years ago

Is it like #27 ?

jfosorio commented 4 years ago

Yes, I think is the same but the solution is slightly different. Here I do it while creating the matrix: d_mat = np.ones((len_x, len_y, 2), dtype=np.int)

27 do it just before the information is used in:

for xs in np.linspace(x0, x1, int(x_div + 1))[1:]:

afiskon commented 4 years ago

I can confirm that this patch fixes the compatibility issue with numpy > 1.16. Hope to see it in the upstream!

DocEpsilon commented 3 years ago

This one-line fix is an open issue for a year now. Maybe add some contributors? :-) A lot of people forked obviously because of this.

afiskon commented 2 years ago

@vMeijin this is a major issue since numpy==1.6 can't be compiled on some modern systems anymore with recent Python versions (I'm using MacOS). Could you please just press the "Merge" button? :)

SaladePengouin commented 2 years ago

@rpcope1 maybe could merge it? Thanks.

rpcope1 commented 2 years ago

@SaladePengouin I wish I could, I don't have the ability to merge. I haven't thought about library for almost a decade now, but this sounds like a real challenge. I don't know if there's a preferred fork or something, otherwise I might be able to take a stab at it.