Skip to content
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

Update correct module dependecies #60

Closed
rainman110 opened this issue Nov 4, 2019 · 11 comments
Closed

Update correct module dependecies #60

rainman110 opened this issue Nov 4, 2019 · 11 comments

Comments

@rainman110
Copy link
Contributor

I used the whole day to figure out the correct dependencies. Please find attached the following file.
dependencies.txt

@tpaviot
Copy link
Owner

tpaviot commented Nov 4, 2019

Great work, very interesting. What do you exactly call a "correct dependency", i.e. how did you build this oriented graph ? Indeed, according to the definition, one can consider that Standard depends upon TCollection and TCollection depends on Standard as well, which is not the case in your document, and which create circular dependencies between python modules.

@rainman110
Copy link
Contributor Author

These are the minimum requirements how to make handles work correctly. I figured it out as written in some of the other issues. In practice, I simply added dependencies until I could compile everything.

So, if there occurs a Handle(geom...), the geom model is obviously required.

I did not look for circular dependencies though. Also did not try get to load modules. These are the minimum requirements to make everything compile.

@rainman110
Copy link
Contributor Author

So... There are definitely some circular dependencies making problems. The question is, how to untie them.

@rainman110
Copy link
Contributor Author

rainman110 commented Nov 4, 2019

The smallest cycles are (In opencascade, they all belong to the same toolkit/dll):

import Graphic3d
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/Graphic3d.py", line 156, in <module>
    import OCC.Core.Select3D
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/Select3D.py", line 158, in <module>
    import OCC.Core.SelectMgr
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/SelectMgr.py", line 161, in <module>
    import OCC.Core.PrsMgr
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/PrsMgr.py", line 162, in <module>
    import OCC.Core.Prs3d
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/Prs3d.py", line 163, in <module>
    import OCC.Core.V3d
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/V3d.py", line 357, in <module>
    class V3d_AmbientLight(OCC.Core.Graphic3d.Graphic3d_CLight):
AttributeError: module 'OCC.Core' has no attribute 'Graphic3d'

and

StepRepr
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/StepRepr.py", line 150, in <module>
    import OCC.Core.StepShape
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/StepShape.py", line 144, in <module>
    import OCC.Core.StepGeom
  File "/localdata1/sigg_ma/src/pythonocc-core/buildocct740/OCC/Core/StepGeom.py", line 1096, in <module>
    class StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx(OCC.Core.StepRepr.StepRepr_RepresentationContext):
AttributeError: module 'OCC.Core' has no attribute 'StepRepr'

@rainman110
Copy link
Contributor Author

rainman110 commented Nov 5, 2019

  • In the first case, the best way to resolve the cycle is to drop the dependency of graphic3d from select3d. there are just two functions involved.

cycle

  • Here's the second cycle. Here we should remove the dependency of StepShape from StepRepr:
    cycle2

@tpaviot
Copy link
Owner

tpaviot commented Nov 5, 2019

Yesterday, I tried something : removing all imports from Graphic3d (at the end of the interface file, all the import Something.i). Of course it works and break the circular references between all these packages. I will try your suggestion. If it's ok, then let's go that way.

On the midterm, if circular references become a stronger issue, it may become necessary to create a single GraphicStuff.i interface file including all of the Graphic3d, PrsMgr, Select3d etc. definitions.

@tpaviot
Copy link
Owner

tpaviot commented Nov 5, 2019

@rainman110 btw, what's the code to draw the graph ? I guess you've been using networkx but I didn't practice this package for a while

@rainman110
Copy link
Contributor Author

@tpaviot No, used used the dot tool. It's standard on linux/maxOS. You can directly throw in the dependencies.txt into the tool.

@rainman110
Copy link
Contributor Author

If we remove the class StepRepr_ReprItemAndMeasureWithUnitAndQRI we solve the circular dependency as well.

tpaviot added a commit that referenced this issue Nov 5, 2019
@tpaviot
Copy link
Owner

tpaviot commented Nov 5, 2019

Tested with Graphic3d. I pushed a change to the generator and updated interfaces files as well see

@rainman110
Copy link
Contributor Author

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants