Skip to content

Commit 2ea2598

Browse files
committed
More renames, removing inappropriate refs to wgpu
1 parent f817810 commit 2ea2598

File tree

14 files changed

+45
-45
lines changed

14 files changed

+45
-45
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
intersphinx_mapping = {
4848
"python": ("https://docs.python.org/3", None),
4949
"numpy": ("https://numpy.org/doc/stable", None),
50-
"wgpu": ("https://wgpu-py.readthedocs.io/en/latest", None),
50+
"wgpu": ("https://wgpu-py.readthedocs.io/en/stable", None),
5151
}
5252

5353
# Add any paths that contain templates here, relative to this directory.

docs/start.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ GUI libraries
2525
Multiple GUI backends are supported, see :doc:`the GUI API <gui>` for details:
2626

2727
* `glfw <https://github.com/FlorianRhiem/pyGLFW>`_: a lightweight GUI for the desktop
28-
* `jupyter_rfb <https://jupyter-rfb.readthedocs.io>`_: only needed if you plan on using wgpu in Jupyter
28+
* `jupyter_rfb <https://jupyter-rfb.readthedocs.io>`_: only needed if you plan on using Jupyter
2929
* qt (PySide6, PyQt6, PySide2, PyQt5)
3030
* wx

examples/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from rendercanvas.auto import RenderCanvas, run
66

77

8-
canvas = RenderCanvas(size=(640, 480), title="wgpu events")
8+
canvas = RenderCanvas(size=(640, 480), title="RenderCanvas events")
99

1010

1111
@canvas.add_event_handler("*")

rendercanvas/_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class EventType(BaseEnum):
1010
1111
This includes the events from the jupyter_rfb event spec (see
1212
https://jupyter-rfb.readthedocs.io/en/stable/events.html) plus some
13-
wgpu-specific events.
13+
rendercanvas-specific events.
1414
"""
1515

1616
# Jupter_rfb spec
@@ -207,7 +207,7 @@ def emit(self, event):
207207
with log_exception(f"Error during handling {event_type} event"):
208208
callback(event)
209209

210-
def _wgpu_close(self):
210+
def _rc_close(self):
211211
"""Wrap up when the scheduler detects the canvas is closed/dead."""
212212
# This is a little feature because detecting a widget from closing can be tricky.
213213
if not self._closed:

rendercanvas/_loop.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __init__(self):
135135
# loop usually stops when the last window is closed, so the close event may
136136
# not be fired.
137137
# * Keep the GUI going even when the canvas loop is on pause e.g. because its
138-
# minimized (applies to backends that implement _wgpu_gui_poll).
138+
# minimized (applies to backends that implement _rc_gui_poll).
139139
self._gui_timer = self._TimerClass(self, self._tick, one_shot=False)
140140

141141
def _register_scheduler(self, scheduler):
@@ -145,7 +145,7 @@ def _register_scheduler(self, scheduler):
145145

146146
def _tick(self):
147147
# Keep the GUI alive on every tick
148-
self._wgpu_gui_poll()
148+
self._rc_gui_poll()
149149

150150
# Check all schedulers
151151
schedulers_to_close = []
@@ -235,7 +235,7 @@ def _call_soon(self, callback, *args):
235235
"""
236236
self.call_later(0, callback, *args)
237237

238-
def _wgpu_gui_poll(self):
238+
def _rc_gui_poll(self):
239239
"""For the subclass to implement:
240240
241241
Some event loops (e.g. asyncio) are just that and dont have a GUI to update.
@@ -343,7 +343,7 @@ def _get_canvas(self):
343343
canvas = self._canvas_ref()
344344
if canvas is None or canvas.is_closed():
345345
# Pretty nice, we can send a close event, even if the canvas no longer exists
346-
self._events._wgpu_close()
346+
self._events._rc_close()
347347
return None
348348
else:
349349
return canvas

rendercanvas/asyncio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class AsyncioTimer(BaseTimer):
13-
"""Wgpu timer based on asyncio."""
13+
"""Timer based on asyncio."""
1414

1515
_handle = None
1616

rendercanvas/auto.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
# Note that wx is not in here, because it does not (yet) fully implement base.BaseRenderCanvas
17-
WGPU_GUI_BACKEND_NAMES = ["glfw", "qt", "jupyter", "offscreen"]
17+
BACKEND_NAMES = ["glfw", "qt", "jupyter", "offscreen"]
1818

1919

2020
def _load_backend(backend_name):
@@ -30,7 +30,7 @@ def _load_backend(backend_name):
3030
elif backend_name == "offscreen":
3131
from . import offscreen as module
3232
else: # no-cover
33-
raise ImportError("Unknown wgpu gui backend: '{backend_name}'")
33+
raise ImportError("Unknown rendercanvas backend: '{backend_name}'")
3434
return module
3535

3636

@@ -53,18 +53,18 @@ def select_backend():
5353

5454
# Always report failed backends, because we only try them when it looks like we can.
5555
if failed_backends:
56-
msg = "WGPU could not load some backends:"
56+
msg = "rendercanvas could not load some backends:"
5757
for key, val in failed_backends.items():
5858
msg += f"\n{key}: {val}"
5959
logger.warning(msg)
6060

6161
# Return or raise
6262
if module is not None:
6363
log = logger.warning if failed_backends else logger.info
64-
log(f"WGPU selected {backend_name} gui because {reason}.")
64+
log(f"Rendercanvas selected {backend_name} backend because {reason}.")
6565
return module
6666
else:
67-
msg = "WGPU Could not load any of the supported GUI backends."
67+
msg = "Rendercanvas could not load any of the supported backends."
6868
if "jupyter" in failed_backends:
6969
msg += "\n You may need to ``pip install -U jupyter_rfb``."
7070
else:
@@ -94,9 +94,9 @@ def backends_by_env_vars():
9494
# Env var to force a backend for general use
9595
backend_name = os.getenv("WGPU_GUI_BACKEND", "").lower().strip() or None
9696
if backend_name:
97-
if backend_name not in WGPU_GUI_BACKEND_NAMES:
97+
if backend_name not in BACKEND_NAMES:
9898
logger.warning(
99-
f"Ignoring invalid WGPU_GUI_BACKEND '{backend_name}', must be one of {WGPU_GUI_BACKEND_NAMES}"
99+
f"Ignoring invalid WGPU_GUI_BACKEND '{backend_name}', must be one of {BACKEND_NAMES}"
100100
)
101101
backend_name = None
102102
if backend_name:

rendercanvas/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def _process_events(self):
173173
# Get events from the GUI into our event mechanism.
174174
loop = self._get_loop()
175175
if loop:
176-
loop._wgpu_gui_poll()
176+
loop._rc_gui_poll()
177177

178178
# Flush our events, so downstream code can update stuff.
179179
# Maybe that downstream code request a new draw.
@@ -245,7 +245,7 @@ def force_draw(self):
245245
def _draw_frame_and_present(self):
246246
"""Draw the frame and present the result.
247247
248-
Errors are logged to the "wgpu" logger. Should be called by the
248+
Errors are logged to the "rendercanvas" logger. Should be called by the
249249
subclass at its draw event.
250250
"""
251251

rendercanvas/glfw.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
# Make sure that glfw is new enough
2323
glfw_version_info = tuple(int(i) for i in glfw.__version__.split(".")[:2])
2424
if glfw_version_info < (1, 9):
25-
raise ImportError("wgpu-py requires glfw 1.9 or higher.")
25+
raise ImportError("rendercanvas requires glfw 1.9 or higher.")
2626

2727
# Do checks to prevent pitfalls on hybrid Xorg/Wayland systems
2828
is_wayland = False
2929
if sys.platform.startswith("linux") and SYSTEM_IS_WAYLAND:
3030
if not hasattr(glfw, "get_x11_window"):
31-
# Probably glfw was imported before we wgpu was, so we missed our chance
31+
# Probably glfw was imported before this module, so we missed our chance
3232
# to set the env var to make glfw use x11.
3333
is_wayland = True
3434
logger.warning("Using GLFW with Wayland, which is experimental.")
@@ -142,7 +142,7 @@ def get_physical_size(window):
142142

143143

144144
class GlfwRenderCanvas(BaseRenderCanvas):
145-
"""A glfw window providing a wgpu canvas."""
145+
"""A glfw window providing a render canvas."""
146146

147147
# See https://www.glfw.org/docs/latest/group__window.html
148148

@@ -201,7 +201,7 @@ def __init__(self, *, size=None, title=None, **kwargs):
201201
self.set_logical_size(*size)
202202
self.set_title(title)
203203

204-
# Callbacks to provide a minimal working canvas for wgpu
204+
# Callbacks to provide a minimal working canvas
205205

206206
def _on_pixelratio_change(self, *args):
207207
if self._changing_pixel_ratio:
@@ -539,7 +539,7 @@ def init_glfw(self):
539539
self._glfw_initialized = True
540540
atexit.register(glfw.terminate)
541541

542-
def _wgpu_gui_poll(self):
542+
def _rc_gui_poll(self):
543543
glfw.post_empty_event() # Awake the event loop, if it's in wait-mode
544544
glfw.poll_events()
545545
if self.stop_if_no_more_canvases and not tuple(self.all_glfw_canvases):

rendercanvas/jupyter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class JupyterRenderCanvas(BaseRenderCanvas, RemoteFrameBuffer):
18-
"""An ipywidgets widget providing a wgpu canvas. Needs the jupyter_rfb library."""
18+
"""An ipywidgets widget providing a render canvas. Needs the jupyter_rfb library."""
1919

2020
def __init__(self, *, size=None, title=None, **kwargs):
2121
super().__init__(**kwargs)
@@ -131,7 +131,7 @@ def __init__(self):
131131
super().__init__()
132132
self._pending_jupyter_canvases = []
133133

134-
def _wgpu_gui_poll(self):
134+
def _rc_gui_poll(self):
135135
pass # Jupyter is running in a separate process :)
136136

137137
def run(self):

0 commit comments

Comments
 (0)