Repository navigation
Merge util file into utils folder - #92
Conversation
|
Alternatively, |
There was a problem hiding this comment.
Pull request overview
This PR consolidates the former scenex.util helpers into the scenex.utils package, splitting app-related utilities into scenex.utils._app and tree/debug helpers into scenex.utils._tree, and updates internal imports/tests accordingly.
Changes:
- Added
scenex.utils._treewithtree_repr/tree_dictand removed the same logic from the app utilities module. - Updated exports so
scenex.utilsexposes app-level helpers (show,run, etc.) andscenextop-level imports those fromscenex.utils._app. - Updated tests and
Node.tree_repr()to use the new locations.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_basic_scene.py | Updates tests to call tree helpers from the new location (currently needs an explicit import of the _tree submodule). |
| src/scenex/utils/_tree.py | New module containing tree debugging utilities (contains a leaf-detection bug for generator-like children). |
| src/scenex/utils/_app.py | Removes tree utilities and focuses on application/canvas helpers; updates a backend registry import. |
| src/scenex/utils/init.py | Re-exports app helpers from _app as the scenex.utils public surface. |
| src/scenex/model/_nodes/node.py | Updates Node.tree_repr() to import tree_repr from scenex.utils._tree. |
| src/scenex/init.py | Updates top-level exports to import app helpers from scenex.utils._app (breaking change for import scenex.util consumers unless shimmed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (82.50%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
=======================================
Coverage 88.86% 88.86%
=======================================
Files 64 65 +1
Lines 3349 3350 +1
=======================================
+ Hits 2976 2977 +1
Misses 373 373 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
More precisely, it was split into two new private modules.
These imports were new anyways, so it doesn't hurt to remove them and just keep them importable from the base package (where they already were)
Closes #91.
The functions that previously existed in
scenex.utilhave been moved to eitherscenex.util._apporscenex.util._tree. The way things got partitioned out, all of the functions moved toscenex.util._appare still exported by the toplevelscenexmodule. We could also makescenex.util._apppublic at some point if there's reason to do so.@tlambert03 note that as a part of this, I've made your
tree_reprandtree_dictfunctions private. I think that's fine, they're more debugging tools than API that should be depended on - let me know if you disagree