Add tools and tests for AnyImage model management and documentation
- Implement sync_models.py for preparing and uploading ONNX artifacts. - Create build_node.py for building and validating Blender scripts. - Add docs.py for building and previewing documentation with Mike or MkDocs. - Introduce model_exports.py for exporting PyTorch models to ONNX format. - Develop pack.py for packaging the project with dependencies for different platforms. - Add test_sync_models.py to validate sync_models functionality. - Add test_tool_commands.py to ensure repository tools have correct command scripts. - Initialize tools package with __init__.py.
This commit is contained in:
@@ -6,7 +6,7 @@ PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
SOURCE_ROOT = PROJECT_ROOT / "src" / "anyimage"
|
||||
|
||||
|
||||
class NodeAssetTest(unittest.TestCase):
|
||||
class NodeAssetsTest(unittest.TestCase):
|
||||
def test_production_code_does_not_create_node_groups(self):
|
||||
offenders = []
|
||||
for path in SOURCE_ROOT.rglob("*.py"):
|
||||
@@ -15,16 +15,26 @@ class NodeAssetTest(unittest.TestCase):
|
||||
self.assertEqual(offenders, [])
|
||||
|
||||
def test_runtime_node_group_entries_load_assets(self):
|
||||
material_source = (
|
||||
SOURCE_ROOT / "operators" / "common" / "mesh_result.py"
|
||||
object_source = (
|
||||
SOURCE_ROOT / "common" / "object.py"
|
||||
).read_text(encoding="utf-8")
|
||||
plane_source = (
|
||||
SOURCE_ROOT / "operators" / "convert_to_plane" / "nodes.py"
|
||||
mesh_plane_source = (
|
||||
SOURCE_ROOT / "operators" / "convert_to_plane" / "mesh_plane.py"
|
||||
).read_text(encoding="utf-8")
|
||||
self.assertIn("return load_asset_node_group(group_name)", material_source)
|
||||
depth_plane_source = (
|
||||
SOURCE_ROOT / "operators" / "convert_to_plane" / "object.py"
|
||||
).read_text(encoding="utf-8")
|
||||
self.assertIn("return load_node_group(group_name)", object_source)
|
||||
self.assertIn(
|
||||
"return load_asset_node_group(DEPTH_PLANE_NODE_GROUP_NAME)",
|
||||
plane_source,
|
||||
"load_node_group(MESH_PLANE_NODE_GROUP_NAME)",
|
||||
mesh_plane_source,
|
||||
)
|
||||
self.assertIn(
|
||||
"load_node_group(DEPTH_PLANE_NODE_GROUP_NAME)",
|
||||
depth_plane_source,
|
||||
)
|
||||
self.assertFalse(
|
||||
(SOURCE_ROOT / "operators" / "convert_to_plane" / "nodes.py").exists()
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user