-
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gui(nviz): Type hinting to the nviz library wrapper and various relat…
…ed improvements (#4899) * gui.wxpython.nviz: numpy import can safely be below * gui.wxpython.nviz: Move ctypes and grass.lib imports below normal imports There is no reason (dependency of imports) apparent here that would prevent it from working. Works locally in a Ubuntu 22.04 WSL on Windows * gui.wxpython.nviz: Sort remaining imports grass.script was already below gui imports in 2023 * gui.wxpython.nviz: Set render flags dicts as a TypedDict This allows static analysis of self.render dict, that contains 4 keys and all boolean values * gui.wxpython.nviz.mapwindow: Light typing annotations * gui.wxpython.nviz.mapwindow: GetContentScaleFactor() typing annotations * gui.wxpython.nviz: Make GLWindow.ZoomToMap()'s layer argument optional * gui.wxpython.core.utils: PIL.Image and wx.Image type annotations * gui.wxpython.gui_core.wrap: wx.Image and wx.Bitmap type annotations * gui.wxpython.gui_core.wrap: wx.Rect and other type annotations * gui.wxpython.core.gcmd: Add typing and overloads for EncodeString and DecodeString * gui: isort mapswipe.mapwindow imports * gui.wxpython.mapswipe.mapwindow: Add type hints related to wx.Size * gui.wxpython.nviz.wxnviz: Add type hints for OGSF/Nviz wrappers Includes using different aliases for different type of ids, to be able to check for usage mismatches * gui.wxpython.nviz.wxnviz: Add type hints for QueryMap with TypedDict gui.wxpython.nviz.wxnviz: Add some type hints for Texture and ImageTexture * gui.wxpython.nviz.wxnviz: Add typing to functions that return empty vectors, considered tuples * gui.wxpython.nviz.wxnviz: Address type checking warnings in QueryMap When results of GetPointOnSurface() is None, ensure that we return None, and the other branch is assured to contain floats * gui.wxpython.nviz.wxnviz: Remove unused import * gui.wxpython.nviz.mapwindow: Sort imports with an isort split group * gui.wxpython.nviz.mapwindow: Add some type hints * gui.wxpython.mapdisp.frame: Sort imports with an isort split group * gui.wxpython.nviz.mapwindow: Handle some cases where self._display is None or other variables are missing
- Loading branch information
Showing
7 changed files
with
674 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.