pytzwhere icon indicating copy to clipboard operation
pytzwhere copied to clipboard

ValueError due to shapely update

Open ytreister opened this issue 3 years ago • 5 comments

shapely recently updated with a breaking change. I think this occured with version 2.0.0 of shapely

tz = tzwhere.tzwhere()
File "/usr/local/lib/python3.10/site-packages/tzwhere/tzwhere.py", line 62, in __init__
self.timezoneNamesToPolygons[tzname] = WRAP(polys)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (1, 2) + inhomogeneous part.

ytreister avatar Jan 13 '23 15:01 ytreister

So I am actually not sure the issue is due to shapely, I was able to fix this by setting in my requirements.txt: numpy==1.23.5 When it ran with version 1.24.0 it gave that error.

ytreister avatar Jan 13 '23 15:01 ytreister

After downgrade numpy to v1.23.5 show warning:

.../lib/python3.10/site-packages/tzwhere/tzwhere.py:62: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
  self.timezoneNamesToPolygons[tzname] = WRAP(polys)

tonal avatar Feb 11 '23 08:02 tonal

Is there any update on this? This bug is breaking our production.

riyadparvez avatar May 19 '23 17:05 riyadparvez

I haven't been maintaining this package for many years, but I'd be happy to review and merge pull requests.

pegler avatar May 19 '23 17:05 pegler

What about #62?

romanwerpachowski avatar Jun 13 '23 07:06 romanwerpachowski