fossilfree / numerous

Numerous - an object-oriented modelling and simulation engine.
https://numerous.com
BSD 3-Clause "New" or "Revised" License
14 stars 9 forks source link

Example code fails with KeyError: 'SETf426042f_f4c5_4fc7_9fa8_a61fd787ac16' #64

Open amipy opened 3 years ago

amipy commented 3 years ago

When using the example code provided in the README file, the following error is thrown after numerous reports 'variables sorted':

`

Traceback (most recent call last): File "C:\Users\alexi\Desktop\numerous-master\example.py", line 5, in model.Model(OscillatorSystem('system')), File "C:\Users\alexi\Desktop\numerous-master\numerous\engine\model\model.py", line 166, in init self.assemble() File "C:\Users\alexi\Desktop\numerous-master\numerous\engine\model\model.py", line 312, in assemble tmp_vars = self.mappings_graph.create_assignments(self.variables) File "C:\Users\alexi\Desktop\numerous-master\numerous\engine\model\graph_representation\mappings_graph.py", line 108, in create_assignments tmp_label = sv.tag + variables[str(self.key_map[va])].path.primary_path + '_tmp' KeyError: 'SETf426042f_f4c5_4fc7_9fa8_a61fd787ac16' ` The key causing the error changes every run, but always has the SET prefix.

artem-chupryna commented 3 years ago

Seems like += assignment stoped working for set variables. We need a test covering += for set variables in tests/set_variables_test