Closed gugomea closed 1 month ago
I see the regression indeed, I will check it deeper and come back to it in a few days (and will provide answers to your other questions). Thanks for reporting.
The partitions are a graphical mean to cut the main (top level) diagram in pages. Most of the times SDL diagrams are flat (no nested states) and therefore the diagram can become very large and inconvenient to read.
With partitions you can put for instance one state per page (and name the partition with the name of the state). Navigation between them is then much better to handle.
Because SDL allows to define the same state at multiple places in the same diagram (or partition) - also for readability purposes, it can be that the nested state is defined in one partition, but another partition references the same state. This is why, when you double click on a state, it has to look in all partitions for a possible nested definition. It may not always be defined in self.scene()
.
The bug you found however is that we should still first look in the current scene, and then if not found, look in the other partitions ; otherwise as you point out, partitions can be at an upper level and miss the sub-sub-state definition. The regression was introduced with the partitions, a few months ago. Unfortunately not caught by the CI as the test being on the GUI side, it's very difficult to automate.
I fixed it on gitlab, and I will merge it in github soon (we have a certificate renewal issue at the moment on gitlab so it will take a few more days).
To answer your other questions:
The fix is committed in the Github repo.
Thank you for the detailed response, now it's much more clear!
Hi, I would like to show a bug when entering nested states in depth ≥ 1 (supposing the initial state is at depth 0) and some questions about partitions and the datadict. The code is from the master branch of the gitlab repository, I'm sorry but currently I cannot access the gitlab account.
As a quick temporal patch, I've changed the following function at
opengeode/sdlSymbols.py:1153
to
We probably don't have to check all partitions, since the partition we would find will point to
self.scene()
. The reason of the bug is that we only have access to top_level partitions, so we are always checking the depth 0 states no matter how deep we are in reality. This results in iterating until reaching theself.nested_scene = None
statement and triggering the prompt of creating the nested state.SDL_Scene.partitions
is a map of the kindpartition_name
→SDL_Scene
, why is only top_level scene populated with partitions? We don't have enough information, since there could be deeper scenes with same partition name and would wipe past entries in the map.TODO
of thecontext
ast that currently is a constant, but I'm not sure.