Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add better (helpful?) errors on mechanism semantic misuse. (#2171)
Tell users if they switch up `GLOBAL` and 'normal' `PARAMETER`s while placing/painting. Example ``` In [3]: d = A.decor(); d.paint('(all)', A.density('pas/g=17')); c = A.cable_cell(A.segment_tree(), d); s = A.single_cell_mod ...: el(c); s.run(1) --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) Cell In[3], line 1 ----> 1 d = A.decor(); d.paint('(all)', A.density('pas/g=17')); c = A.cable_cell(A.segment_tree(), d); s = A.single_cell_model(c); s.run(1) RuntimeError: mechanism 'pas' has no global parameter 'g', but a normal parameter with the same name exists. Set it via the parameter map, eg 'density("pas", {{"g", ...}, ...})' In [7]: d = A.decor(); d.paint('(all)', A.density('pas', {'e':17})); t = A.segment_tree(); t.append(A.mnpos, (0, 0, 0, 1), ( ...: 0, 0, 1, 1), 1); c = A.cable_cell(t, d); s = A.single_cell_model(c); s.run(1) --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) Cell In[7], line 1 ----> 1 d = A.decor(); d.paint('(all)', A.density('pas', {'e':17})); t = A.segment_tree(); t.append(A.mnpos, (0, 0, 0, 1), (0, 0, 1, 1), 1); c = A.cable_cell(t, d); s = A.single_cell_model(c); s.run(1) RuntimeError: mechanism 'pas' has no parameter 'e', but a global parameter with the same name exists. Use 'pas/e=...' to set it. ```
- Loading branch information