-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/restructure #173
Fix/restructure #173
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #173 +/- ##
==========================================
+ Coverage 38.42% 38.63% +0.21%
==========================================
Files 78 75 -3
Lines 4305 4253 -52
==========================================
- Hits 1654 1643 -11
+ Misses 2651 2610 -41 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on re-structuring the depthai_nodes
package. The agreed upon user facing structure is there.
I try to avoid utils
packages as much as possible, I think the top-level one, where the constants.py
and logging.py
are, should be removed. I would move the scripts to the top level.
The node.parsers.utils
is a collection of many different things and again applies that the utils
package is not a good solution, it doesn't say much about its contains. It's a collections of things we did not know where to put them. But we probably don't have the resources to do something about this atm.
What is the motivation behind creating the creators
package in the messages
? To me, it just looks like what should be part of the class constructors has been moved to separate functions for some reason. I don't see why this is needed. Things that belong together should be together. Object construction usually happens in the constructor of a class, so why not use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. As was suggested by Petr in the future it would be nice to get rid of the utils
and alike folders in the repo. Also using the constructor instead of the functional creators would be nice in the future.
For now it's good that both these things that we would like to change in the future are quite internal to the library. Thus no big breaking changes affecting users will be introduced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM. However, I'm wondering what’s the reasoning behind having the node
directory at the top level of depthai_nodes
? It feels a bit odd. Would it make sense to move parsers
to the top level and rename node
to helpers
instead? That way, the imports would be more intuitive:
- depthai_nodes.message
- depthai_nodes.parsers
- depthai_nodes.helpers
Additionally, I’d recommend using plural forms for module names (e.g., message → messages, node → nodes) since the modules contain multiple related classes or functions.
@jkbmrz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One note: inside node
folder we have parsers
folder where parsers are but other "host nodes" like DepthMerger are left in the node
folder. In the future we should probably move them to separate subfolder when there will be a lot of such nodes?
@kkeroo |
Purpose
Restructures project structure so that the classes are accessable in similar pattern as with DepthAI.
Specification
Moved all messages and message creators under
message
. Nodes are now undernode
(for now only parsers are in their own folder).Dependencies & Potential Impact
Previously:
Now:
Deployment Plan
This is a breaking change so when merged in all scripts (e.g. depthai-experiments) relying on unreleased, main branch of dai-nodes will faill because of import errors. So before merge we should have PRs on other relevant projects that depend on this one already made.
Testing & Validation
Tests were adjusted for the new structure.