From: Erik M. <em...@us...> - 2005-11-11 00:28:53
|
Update of /cvsroot/cctbx/cctbx/maptbx/boost_python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7547/maptbx/boost_python Modified Files: basic_map.cpp tst_maptbx.py Log Message: basic_map now holds a reference to the unit_cell and also exposes the all() method of the accessor in the underlying data. Index: basic_map.cpp =================================================================== RCS file: /cvsroot/cctbx/cctbx/maptbx/boost_python/basic_map.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** basic_map.cpp 14 Sep 2005 08:16:43 -0000 1.2 --- basic_map.cpp 11 Nov 2005 00:28:42 -0000 1.3 *************** *** 17,51 **** struct basic_map_wrapper { ! typedef double FloatType; ! typedef signed long IntType; ! typedef out_of_bounds<void,FloatType,IntType> out_of_intf; ! typedef chiltbx::handle::handle<out_of_intf> out_of_handle; typedef out_of_bounds<raise,FloatType,IntType> out_of_raise; ! typedef out_of_bounds<substitute,FloatType,IntType> out_of_substitute; typedef out_of_bounds<clamp,FloatType,IntType> out_of_clamp; ! typedef out_of_bounds<interpolate,FloatType,IntType> out_of_interpolate; ! typedef basic_map<FloatType,IntType> basic_map_type; ! typedef af::flex_grid<> flex_grid; ! typedef af::c_grid_padded<dimension_3> c_grid_padded; ! typedef af::versa<FloatType,flex_grid> af_versa; ! typedef af::versa<FloatType,c_grid_padded> af_c_grid; ! typedef af::tiny<IntType,dimension_3> af_extents; ! typedef cdsa::float_asu<FloatType> cdsa_float_asu; ! typedef sgtbx::space_group tbx_space_group; ! typedef scitbx::mat3<FloatType> mat3; ! typedef fractional<FloatType> frac_type; ! typedef cartesian<FloatType> cart_type; ! typedef grid_point<IntType> grid_type; ! typedef transform<frac_type,grid_type> f2g_type; ! typedef transform<frac_type,cart_type> f2c_type; ! typedef transform<grid_type,frac_type> g2f_type; ! typedef transform<cart_type,frac_type> c2f_type; ! typedef transform<grid_type,cart_type> g2c_type; ! typedef transform<cart_type,grid_type> c2g_type; static void wrap () { --- 17,52 ---- struct basic_map_wrapper { ! typedef double FloatType; ! typedef signed long IntType; ! typedef out_of_bounds<void,FloatType,IntType> out_of_intf; ! typedef chiltbx::handle::handle<out_of_intf> out_of_handle; typedef out_of_bounds<raise,FloatType,IntType> out_of_raise; ! typedef out_of_bounds<substitute,FloatType,IntType> out_of_substitute; typedef out_of_bounds<clamp,FloatType,IntType> out_of_clamp; ! typedef out_of_bounds<interpolate,FloatType,IntType> out_of_interpolate; ! typedef basic_map<FloatType,IntType> basic_map_type; ! typedef af::flex_grid<> flex_grid; ! typedef af::c_grid_padded<dimension_3> c_grid_padded; ! typedef af::versa<FloatType,flex_grid> af_versa; ! typedef af::versa<FloatType,c_grid_padded> af_c_grid; ! typedef af::tiny<IntType,dimension_3> af_extents; ! typedef cdsa::float_asu<FloatType> cdsa_float_asu; ! typedef sgtbx::space_group tbx_space_group; ! typedef cctbx::uctbx::unit_cell tbx_unit_cell; ! typedef scitbx::mat3<FloatType> mat3; ! typedef fractional<FloatType> frac_type; ! typedef cartesian<FloatType> cart_type; ! typedef grid_point<IntType> grid_type; ! typedef transform<frac_type,grid_type> f2g_type; ! typedef transform<frac_type,cart_type> f2c_type; ! typedef transform<grid_type,frac_type> g2f_type; ! typedef transform<cart_type,frac_type> c2f_type; ! typedef transform<grid_type,cart_type> g2c_type; ! typedef transform<cart_type,grid_type> c2g_type; static void wrap () { *************** *** 81,100 **** af_extents const&, mat3 const&, ! out_of_handle const&>()) .def(init<unit_cell const&, af_versa const&, af_extents const&, mat3 const&, ! out_of_handle const&>()) .def(init<unit_cell const&, af_c_grid const&, af_extents const&, mat3 const&, ! out_of_handle const&>()) .def(init<non_symmetric const&, af_versa const&, af_extents const&, mat3 const&, ! out_of_handle const&>()) .def(init<basic_map_type>()) .def("as_asu", --- 82,105 ---- af_extents const&, mat3 const&, ! out_of_handle const&, ! tbx_unit_cell const&>()) .def(init<unit_cell const&, af_versa const&, af_extents const&, mat3 const&, ! out_of_handle const&, ! tbx_unit_cell const&>()) .def(init<unit_cell const&, af_c_grid const&, af_extents const&, mat3 const&, ! out_of_handle const&, ! tbx_unit_cell const&>()) .def(init<non_symmetric const&, af_versa const&, af_extents const&, mat3 const&, ! out_of_handle const&, ! tbx_unit_cell const&>()) .def(init<basic_map_type>()) .def("as_asu", *************** *** 174,177 **** --- 179,184 ---- .def("rebuild_transformers",&basic_map_type::rebuild_transformers, (arg_("extents"),arg_("matrix"))) + .def("extents",&basic_map_type::extents) + .def("unit_cell",&basic_map_type::unit_cell) ; Index: tst_maptbx.py =================================================================== RCS file: /cvsroot/cctbx/cctbx/maptbx/boost_python/tst_maptbx.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tst_maptbx.py 7 Sep 2005 19:46:48 -0000 1.38 --- tst_maptbx.py 11 Nov 2005 00:28:42 -0000 1.39 *************** *** 280,284 **** unit_cell_gridding_n, unit_cell.orthogonalization_matrix(), ! out_of_bounds_clamp.as_handle()) sites_cart = flex.vec3_double() --- 280,285 ---- unit_cell_gridding_n, unit_cell.orthogonalization_matrix(), ! out_of_bounds_clamp.as_handle(), ! unit_cell) sites_cart = flex.vec3_double() *************** *** 325,329 **** emap.focus(), unit_cell.orthogonalization_matrix(), ! out_of_bounds_raise.as_handle()) sites = flex.vec3_double() sites.append( (21,-3.4E8,2.6) ) --- 326,331 ---- emap.focus(), unit_cell.orthogonalization_matrix(), ! out_of_bounds_raise.as_handle(), ! unit_cell) sites = flex.vec3_double() sites.append( (21,-3.4E8,2.6) ) *************** *** 438,442 **** unit_cell_gridding_n, unit_cell.orthogonalization_matrix(), ! out_of_bounds_raise.as_handle()) for site_cart,expected_result in ([(0.468661,-1.549268,3.352108),-0.333095], --- 440,445 ---- unit_cell_gridding_n, unit_cell.orthogonalization_matrix(), ! out_of_bounds_raise.as_handle(), ! unit_cell) for site_cart,expected_result in ([(0.468661,-1.549268,3.352108),-0.333095], *************** *** 470,474 **** emap.focus(), unit_cell.orthogonalization_matrix(), ! out_of_bounds_raise.as_handle()) assert basic_map.get_grid_value((0,0,0))==10 --- 473,478 ---- emap.focus(), unit_cell.orthogonalization_matrix(), ! out_of_bounds_raise.as_handle(), ! unit_cell) assert basic_map.get_grid_value((0,0,0))==10 |