Open petrasovaa opened 2 years ago
The same seems to be true for the temporal plot tool, g.gui.tplot doesn't display anything.
I wonder if not the patch to ctypesgen: https://github.com/OSGeo/grass/blob/c700a8a923cd8e7b0e49e5abab3a2ae313eccaef/python/libgrass_interface_generator/ctypesgen/libraryloader.py#L325-L329
which adds all PATH directories to dll loading, could cause this and other Windows issues like #2101 . I never felt good with that patch.
I never felt good with that patch.
What would to be changed to find out?
I never felt good with that patch.
What would to be changed to find out?
I'm not quite sure yet. I've been tinkering on a GRASS installation on a win can I have at my disposal, so far with no success.
Is this still an issue? Since the 8.0.2 milestone is due now - to which milestone may this report be bumped?
Is this still an issue?
As far as I can see, yes, it is. Same for the other gui's in the temporal toolbox.
Since the 8.0.2 milestone is due now - to which milestone may this report be bumped?
Not sure how difficult this is to fix, but it is one of those features that you want to work when introducing the grass temporal framework to (new) Window users. Just as a plea to not bump it up to far into the future ;-)
Hey, I solved this problem on Windows by commenting line 59 (user32 = ctypes.WinDLL('user32')) in the file win.py and I changed the line by:
user32 = ctypes.WinDLL(r'C:\Windows\SysWOW64\user32')
I hope this help!
testing here with
System Info
GRASS version: 8.3.2
Code revision: exported
Build date: 2024-05-20
Build platform: x86_64-w64-mingw32
GDAL: 3.9.0
PROJ: 9.4.0
GEOS: 3.12.1
SQLite: 3.45.1
Python: 3.12.4
wxPython: 4.2.1
Platform: Windows-11-10.0.22631-SP0 (OSGeo4W)
t.register -i input=test maps=basins@PERMANENT,landuse@PERMANENT start=2000-01-01 increment=1 month
g.gui.timeline test
Traceback (most recent call last):
File
"C:\OSGeo4W\apps\grass\grass83/scripts/g.gui.timeline.py",
line 73, in <module>
main()
File
"C:\OSGeo4W\apps\grass\grass83/scripts/g.gui.timeline.py",
line 66, in main
frame.SetDatasets(datasets)
File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\timeline\
frame.py", line 576, in SetDatasets
self._redraw()
File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\timeline\
frame.py", line 462, in _redraw
self._draw2dFigure()
File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\timeline\
frame.py", line 393, in _draw2dFigure
self.fig.autofmt_xdate()
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\figure.py", line 264, in autofmt_xdate
for label in self.axes[0].get_xticklabels(which=which):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\axes\_base.py", line 73, in wrapper
return get_method(self)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\axis.py", line 1460, in get_ticklabels
return self.get_majorticklabels()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\axis.py", line 1424, in
get_majorticklabels
self._update_ticks()
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\axis.py", line 1275, in _update_ticks
major_locs = self.get_majorticklocs()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\axis.py", line 1495, in
get_majorticklocs
return self.major.locator()
^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\dates.py", line 1373, in __call__
dmin, dmax = self.viewlim_to_dt()
^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\dates.py", line 1158, in viewlim_to_dt
return num2date(vmin, self.tz), num2date(vmax, self.tz)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\dates.py", line 543, in num2date
return _from_ordinalf_np_vectorized(x, tz).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\numpy\lib\function_base.py", line 2372, in __call__
return self._call_as_normal(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\numpy\lib\function_base.py", line 2365, in
_call_as_normal
return self._vectorize_call(func=func, args=vargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\numpy\lib\function_base.py", line 2455, in
_vectorize_call
outputs = ufunc(*inputs)
^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\matplotlib\dates.py", line 369, in _from_ordinalf
dt = dt.replace(tzinfo=dateutil.tz.gettz('UTC'))
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\dateutil\tz\tz.py", line 1557, in __call__
rv = self.nocache(name=name)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\dateutil\tz\tz.py", line 1648, in nocache
tz = tzwin(name)
^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\dateutil\tz\win.py", line 221, in __init__
keydict = valuestodict(tzkey)
^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\dateutil\tz\win.py", line 364, in valuestodict
value = tz_res.name_from_string(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\dateutil\tz\win.py", line 122, in name_from_string
return self.load_name(offset)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\OSGeo4W\apps\Python312\Lib\site-
packages\dateutil\tz\win.py", line 91, in load_name
nchar = self.LoadStringW(self._tzres._handle, offset,
lpBuffer, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ctypes.ArgumentError: argument 1: OverflowError: int too
long to convert
still failing
random internet search
ctypes silently truncates ints larger than C int: A Python int larger than a C int but smaller than a C long is silently truncated to int when passed to a ctypes function without C type information attached.
Hey, I solved this problem on Windows by commenting line 59 (user32 = ctypes.WinDLL('user32')) in the file win.py and I changed the line by:
user32 = ctypes.WinDLL(r'C:\Windows\SysWOW64\user32')
I hope this help!
changing this line in C:\OSGeo4W\apps\Python312\Lib\site-packages\dateutil\tz\win.py
g.gui.timeline works.
anyone any idea to solve?
changing this line in C:\OSGeo4W\apps\Python312\Lib\site-packages\dateutil\tz\win.py
So that would be here in the upstream `dateutil'package:
Describe the bug g.gui.timeline doesn't display anything, originally reported by @chaedri
To Reproduce t.create output=test semantictype=mean title=title description=desc t.register -i input=test maps=elev_lid792_1m@PERMANENT,elev_state_500m@PERMANENT start=2000-01-01 increment="1 month" g.gui.timeline test
Also can be simply reproduced with example from dateutil/tz/win.py tzres.load_name method:
System description (please complete the following information):
Additional context This is not a problem of g.gui.timeline rather perhaps some packaging issue?