match_indices.paired_miller_indices() ungraceful overshoot
Hello all, I accidentally gave paired_miller_indices() a value > 1 for i_array, and got a segfault. The problem looks to be in match_indices.cpp, line 94: result.push_back(miller_indices_[i_array][pairs_[i][i_array]]); Maybe there should be a test that raises an exception on the python side, if possible. James
Actually, is i_array even necessary as an argument? It's not clear to me when the two alternate values for i_array will make a difference in the return value. James On Apr 6, 2013, at 1:44 AM, James Stroud wrote:
Hello all,
I accidentally gave paired_miller_indices() a value > 1 for i_array, and got a segfault. The problem looks to be in match_indices.cpp, line 94:
result.push_back(miller_indices_[i_array][pairs_[i][i_array]]);
Maybe there should be a test that raises an exception on the python side, if possible.
James
Hi James;
I think you're right in that it's redundant, and exercise_match_indices() in boost_python/tst_miller.py succeeds with i_array==0 and i_array==1 alike. However, changing it will break the interface.
// Johan
On 6 Apr 2013, at 00:51, James Stroud
Actually, is i_array even necessary as an argument? It's not clear to me when the two alternate values for i_array will make a difference in the return value.
James
On Apr 6, 2013, at 1:44 AM, James Stroud wrote:
Hello all,
I accidentally gave paired_miller_indices() a value > 1 for i_array, and got a segfault. The problem looks to be in match_indices.cpp, line 94:
result.push_back(miller_indices_[i_array][pairs_[i][i_array]]);
Maybe there should be a test that raises an exception on the python side, if possible.
James
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Postdoctoral Fellow @ Physical Biosciences Division _______________________________________________________________ Lawrence Berkeley National Laboratory * 1 Cyclotron Rd. Mail Stop 64R0121 * Berkeley, CA 94720-8118 * +1 (510) 495-8055
On Sat, Apr 6, 2013 at 12:44 AM, James Stroud
I accidentally gave paired_miller_indices() a value > 1 for i_array, and got a segfault. The problem looks to be in match_indices.cpp, line 94:
result.push_back(miller_indices_[i_array][pairs_[i][i_array]]);
Maybe there should be a test that raises an exception on the python side, if possible.
The way this is usually handled is to add an assertion that i_array <= 1. I'm a little surprised this wasn't already in there, but I've committed the change. thanks, Nat
participants (3)
-
James Stroud
-
Johan Hattne
-
Nathaniel Echols