basemap icon indicating copy to clipboard operation
basemap copied to clipboard

Error in indentation?

Open cmeeren opened this issue 10 years ago • 5 comments
trafficstars

Is the indentation wrong here? The current indentation causes polygons and polygon_types to have different number of elements under some circumstances.

https://github.com/matplotlib/basemap/blob/master/lib/mpl_toolkits/basemap/init.py#L1419

cmeeren avatar Oct 27 '15 09:10 cmeeren

I may be wrong. Currently testing some stuff.

cmeeren avatar Oct 27 '15 10:10 cmeeren

Good question. Most of the time in this method, the two appends are together, but this segment of code seems a bit different. It might be right, but I really don't know for certain. Attn: @jswhit

WeatherGod avatar Oct 27 '15 13:10 WeatherGod

Actually it might be a couple of lines above that one: https://github.com/matplotlib/basemap/blob/master/lib/mpl_toolkits/basemap/init.py#L1415

I tried indenting the line I originally referred to and it didn't change anything.

cmeeren avatar Oct 27 '15 14:10 cmeeren

Looks like you want to indent the append(typ) in line 1419 and add another append(typ) line after 1415.

rwogburn avatar Oct 30 '15 21:10 rwogburn

It would be good to first have unit tests that demonstrates a problem. It is entirely feasible that that for-loop around L1415 only ever adds a single element to the list. I just haven't groked the logic here enough to know that for certain.

WeatherGod avatar Oct 30 '15 21:10 WeatherGod