ecell / ecell4_base

An integrated software environment for multi-algorithm, multi-timescale, multi-spatial-representation simulation of various cellular phenomena
https://ecell4.e-cell.org/
GNU General Public License v3.0
63 stars 23 forks source link

Alert when a dimension mismatches #347

Closed kaizu closed 5 years ago

kaizu commented 5 years ago

Show some warning when a dimension of the given structure mismatches the definition in the model.

with species_attributes():
    A | {'location': 'M'}

m = get_model()
f = spatiocyte.Factory()
w = f.world()
w.bind_to(m)
w.add_structure(Species('M'), Sphere(ones() * 0.5, 0.4).surface())  # should alert, but nothing happens now
w.add_molecules(Species('A'), 10)

sim = f.simulator(w)  # CRASH!
0ncorhynchus commented 5 years ago

Check List