Refactor and clean up codebase by removing unused functions and reorganizing imports

- Removed unused model keys and functions from properties.py.
- Deleted projection.py as its functions were no longer needed.
- Cleaned up model_catalog.py by removing unused model directory function.
- Updated imports in various test files to reflect new module structure.
- Removed deprecated test cases related to image editing tools.
- Added new tests for ONNX runtime provider selection logic.
This commit is contained in:
2026-09-09 10:31:56 +08:00
parent 4c902ed7db
commit f5aff50b13
47 changed files with 460 additions and 413 deletions

View File

@@ -7,7 +7,7 @@ import pytest
sys.path.insert(0, str(Path(__file__).parents[1] / "src"))
from anyimage.common.image import premultiplied_rgba
from anyimage.operators.image_edit_tool import frame
from anyimage.operators import frame_tool as frame
def source(rgba, *, bounds=(-1, 1, -1, 1), depth=1, slope=0, active=True):
@@ -39,7 +39,7 @@ def test_white_half_coverage_does_not_mix_canvas_black():
def test_uncovered_canvas_has_no_rgb_to_reveal_with_mask_add():
from anyimage.common.selection import SelectionMask
from anyimage.operators.image_edit_tool.mask import apply_alpha_mask
from anyimage.operators.mask_tool import apply_alpha_mask
result = render((source([[[1, 1, 1, 1]]], bounds=(-0.5, 0.5, -0.5, 0.5)),), (8, 8))
uncovered = result[..., 3] == 0
@@ -113,7 +113,7 @@ def test_packed_frame_mask_add_keeps_boundary_color(background):
from PIL import Image
from anyimage.common.image import create_image_edit_result, image_rgba
from anyimage.common.selection import SelectionMask
from anyimage.operators.image_edit_tool.mask import apply_alpha_mask
from anyimage.operators.mask_tool import apply_alpha_mask
bottom = source([[[background, background, background, 0]]], depth=2, active=False)
top = source([[[1, 0, 0, 1]]], bounds=(-1, 0, -1, 1))