-
Notifications
You must be signed in to change notification settings - Fork 272
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
Move container definition into image module #1264
Conversation
with this cause (or solve) any circular imports? |
@kosack solves, see new description. |
Ok, though now |
This is the chain:
|
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.
It may be that we should have a separate module just for Container defs to avoid too many dependencies.
Probably is fine for a stop-gap solution though.
@kosack I like the fact that they are defined where they are used / emitted |
Ah dam, I introduced another circular import. |
I do too, but often you don't need the algorithm to use the data, so if they are grouped, you entangle them |
You can check with something like: pydeps --show-cycles --max-bacon=2 --cluster --keep-target-cluster -T png ctapipe see #1205 |
@kosack that does not really seem to work, as I back import the containers in io but it does not show a dependency from io to image |
I think with those options, it only shows cycles. If you show everything it's huge. But the cycles seem much improved. remove "--show-cycles" to get the full thing, I believe (the bacon option limits the distance to show as well - it's the "Bacon number", as in Kevin Bacon) |
The errors in the log now seem to be different, they don't show anymore a circular import: there seems to be a problem with notebooks and the stub file from |
Ok, so I now moved all image related containers into the image submodule and removed them from io. The only reason to remove them from io is that the docs create a warning, which is treated as error on travis. This is not good I think. Also, does this create problems with the table reader? If the containers are not all in io/containers anymore? Maybe better to just move the container definions into their own submodule? |
Codecov Report
@@ Coverage Diff @@
## master #1264 +/- ##
==========================================
+ Coverage 86.78% 87.01% +0.22%
==========================================
Files 192 194 +2
Lines 11967 12198 +231
==========================================
+ Hits 10386 10614 +228
- Misses 1581 1584 +3
Continue to review full report at Codecov.
|
I would do this, it seems a cleaner approach |
This solves the circular import Problem @HealthyPear is facing in #1215 .
As image imported these containers from io, it imported the whole simetelevent source which imports the calibration stack which imports something from image.