You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "run.py", line 306, in
int(sys.argv[2]), T_list, int(sys.argv[4]))
File "run.py", line 74, in run
r_list, t_list = singlerun(T_list, N_B, N_X)
File "run.py", line 190, in singlerun
dd = s.clear_volume(A_pos, float(A['radius']))
File "/storage1/wehrens/myfork_egfrd/egfrd.py", line 544, in clear_volume
return self.burst_objs(neighbors)
File "/storage1/wehrens/myfork_egfrd/egfrd.py", line 521, in burst_objs
for obj in objs:
File "/storage1/wehrens/myfork_egfrd/egfrd.py", line 1484, in get_neighbors_within_radius_no_sort
for container in self.containers:
AttributeError: 'EGFRDSimulator' object has no attribute 'containers'
Proposed solution
Simply build in a check in clear_volume that checks if there are domains at all, if not, just pass and return emtpy output.
The text was updated successfully, but these errors were encountered:
I've resolved the situation by updating egfrd.py as follows:
def get_neighbors_within_radius_no_sort(self, pos, radius, ignore=[]):
# Get neighbor domains within given radius.
#
# ignore: domain ids.
#
# Only returns neighbors, not the distances towards their
# shells. Can for example be used to try to clear all objects
# from a certain volume.
try:
for container in self.containers:
result = container.get_neighbors_within_radius(pos, radius)
# result = [((shell_id_shell_pair), distance), ]
# Since a domain can have more than 1 shell (multis for
# example), and for each shell there is an entry in the
# shell container, we make sure each domain occurs only once
# in the returned list here.
for did in uniq(s[0][1].did for s in result):
if did not in ignore:
yield self.domains[did]
except AttributeError:
pass
Problem
You might think this is not such a big problem, as usually the simulation isn't empty.
But I'm working on the rebinding sample, which, depending on arguments from the user, contains or doesn't contain inert X particles.
At a certain moment particles A and B are added to certain location, and therefore the volume should be cleared.
Now, when the user has decided there shouldn't be any X-particles, the eGFRD simulation crashes.
I don't know if this is the only case in which clear_volume crashes, but it's certainly something we should look into IMO.
Crash report:
wehrens@amocf23:~/myfork_egfrd/samples/rebind$ LOGLEVEL=ERROR PYTHONPATH=../.. python -O run.py 1 0 [INF] 100
Traceback (most recent call last):
File "run.py", line 306, in
int(sys.argv[2]), T_list, int(sys.argv[4]))
File "run.py", line 74, in run
r_list, t_list = singlerun(T_list, N_B, N_X)
File "run.py", line 190, in singlerun
dd = s.clear_volume(A_pos, float(A['radius']))
File "/storage1/wehrens/myfork_egfrd/egfrd.py", line 544, in clear_volume
return self.burst_objs(neighbors)
File "/storage1/wehrens/myfork_egfrd/egfrd.py", line 521, in burst_objs
for obj in objs:
File "/storage1/wehrens/myfork_egfrd/egfrd.py", line 1484, in get_neighbors_within_radius_no_sort
for container in self.containers:
AttributeError: 'EGFRDSimulator' object has no attribute 'containers'
Proposed solution
Simply build in a check in clear_volume that checks if there are domains at all, if not, just pass and return emtpy output.
The text was updated successfully, but these errors were encountered: