Does VP Python instant reverse support FROM and IMPORT statements for resolving modules?

Hello,

I am currently running profesionnal version of VP and using instant reverse of Python code to produce a class diagram. However, it seems VP does not look to resolve module names specified by FROM and IMPORT statements.

My particular case (inheritance) involves resolving the base class :

Class “X” inherits from class "BASE.Y"
Another class also named “Y” exists in the same directory of class “X”

When using instant reverse, my class diagram always shows class “X” with a link to the wrong base class “Y” and NOT the “BASE.Y” class.

Does VP interprets IMPORT and FROM statements or am I doing something from to have the base class resolved using the module specified ?

Regards,

Hello,

I had looked into this a while ago and noticed that VP-UML’s reverse-engineering of Python code doesn’t create namespaces (for example UML packages) for modules. This means that even if the import statements are parsed correctly, there’s no way to have two or more classes with the same name from different modules in the generated model (in the same way two classes X in the same module will leave only the second definition).

I had mentioned this observation in a VP-UML ticket, together with other things I had noticed about the Python reverse-engineering. Some of the problems I’ve run into over time have been fixed, while others haven’t been.

On a related note, I guess the same scope problem as for Python modules applies to C++ namespaces, so that could be a motivation for the VP team to fix this if they haven’t yet. :slight_smile:

Stefan

sschwarzer :

Thanks for the information. Would you be kind enough to give me the ticket # so I can foward to the VP team ?

Regards,
Christian

Hi Christian,

[quote=Epsilon-Ti]sschwarzer :
Thanks for the information. Would you be kind enough to give me the ticket # so I can foward to the VP team ?
[/quote]

Sorry, I haven’t read the forums for some time now, so I didn’t see your message earlier.

The ticket was #DRT-954610 - “Reverse engineering multiple Python files containing a class with same name”.

Best regards,
Stefan