mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:30:53 +01:00
[PR #949] swizzle_search, tex_mode_probe: say numpy is missing in one line, as tile_probe does #987
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#987
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/949
Author: @barkodr
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/numpy-missing-message📝 Commits (1)
e61aaddswizzle_search, tex_mode_probe: say numpy is missing in one line, as tile_probe does📊 Changes
4 files changed (+79 additions, -4 deletions)
View changed files
📝
tests/test_swizzle_search.py(+30 -0)📝
tests/test_tex_mode_probe.py(+32 -0)📝
tools/swizzle_search.py(+7 -1)📝
tools/tex_mode_probe.py(+10 -3)📄 Description
Claimed in the coordination issue as: claiming: tools/bc_feature.py, calibrated_texture.py, tex_mode_probe.py and swizzle_search.py import numpy unconditionally and never say they need it; give them the one-line "numpy is missing" message tools/tile_probe.py uses. Tools only. AI-assisted.
What and why
Without numpy,
tools/swizzle_search.pyandtools/tex_mode_probe.pystopped with a traceback. They now check their arguments first and then print oneERROR: ... needs numpy (python -m pip install numpy)line and exit 2, astools/tile_probe.pydoes.tools/bc_feature.pyandtools/calibrated_texture.pyare left as they are: they are modules with no command line of their own.tex_mode_probe.pynow importsbc_featureonly when numpy is present, andttpf_mips.pyandttpf_assets.pyalready catch theImportErrorfromcalibrated_textureand say what is missing.Tested
On macOS 26.6.2 with Python 3.12.16 (no numpy installed) and on Ubuntu 26.04 (WSL2) with Python 3.14.4, from the checkout root with
python -I:tests/test_swizzle_search.py,tests/test_tex_mode_probe.py,tests/test_text_write_line_endings.pyandtests/test_docs_python_deps.pypass on both. On macOS both tools print the one line and exit 2. With numpy 2.5.5 installed, the four new tests (which hide numpy from a child process) pass, and they fail against the tools onmain. Without numpy,tests/test_tex_mode_probe.pyskips the whole module insetUpModule, so its two new tests only run where numpy is installed.GPUs tested: none (no GPU code changed)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.