pegler / pytzwhere

python library to look up timezone from lat lng offline
Other
145 stars 54 forks source link

ValueError due to shapely update #60

Open ytreister opened 1 year ago

ytreister commented 1 year ago

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 commented 1 year ago

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.

tonal commented 1 year ago

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)
riyadparvez commented 1 year ago

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

pegler commented 1 year ago

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

romanwerpachowski commented 1 year ago

What about #62?