Remove STRTransform main#2466
Conversation
Why this file has a main function? It is not meant to be run independently, right? Shouldn't it be removed?
|
Looks like the That said, read-the-docs CI is failing on build and looks like it was complaining about a circular import; so I would suggest unwinding some of your changes. EDIT: I see you closed the PR now; going to leave the comment just in case. Thanks for the submission! |
|
@j9ac9k oh so it is completely pointless? I have seen the test failing due to the imports, but I thought that the main function could have something to do with that 🤓 Then shall I remove it and try to fix it? |
These files have main entry points that are pointless, therefore they should be removed
| #def __div__(self, t): | ||
| #"""A / B == B^-1 * A""" | ||
| #dt = t.inverted()[0] * self | ||
| #return SRTTransform(dt) | ||
| #return SRTTransform.SRTTransform(dt) | ||
|
|
||
| #def __mul__(self, t): | ||
| #return SRTTransform(QtGui.QTransform.__mul__(self, t)) | ||
| #return SRTTransform.SRTTransform(QtGui.QTransform.__mul__(self, t)) |
Check notice
Code scanning / CodeQL
Commented-out code
|
Looking at the diff more closely, you have indeed introduced a circular import. SRTTransform.py does imports SRTTransform3d, and SRTTransform3d now imports SRTTransform.py, which causes a circular import. |
Yeah but I fixed that in the lastest patch. I used regular |
|
Hey @j9ac9k can you check this again please? |
|
I wouldn't say I like importing just the module instead of the class itself, I suppose I prefer to import the class at the bottom of the file, which feels like a rubbish way to go about handling the circular import. Both these classes should likely reside in the same module, but that's well outside the scope of this PR. Thanks for the PR @Jaime02 Merging. |
Why this file has a main function? It is not meant to be run independently, right? Shouldn't it be removed?