Scheduled maintenance on Monday 2019-06-24 between 10:00-11:00 CEST

Commit 1618af65 authored by Simon Perkins's avatar Simon Perkins

Try handle Nones/nullptrs properly

parent b9f6029b
......@@ -641,6 +641,8 @@ template<typename T> pyarr_c<complex<T>> vis2grid_c(
size_t nu=gconf.Nu(), nv=gconf.Nv();
checkArray(idx_, "idx", {nvis});
printf("user_grid %p %d\n", user_grid, user_grid == nullptr);
if(user_grid)
{ checkArray(*user_grid, "user_grid", {nu, nv}); }
......@@ -1128,15 +1130,15 @@ PYBIND11_MODULE(nifty_gridder, m)
"idx"_a, "vis"_a);
m.def("ms2grid",&ms2grid<double>, "baselines"_a, "gconf"_a, "idx"_a, "ms"_a);
m.def("grid2vis",&grid2vis<double>, grid2vis_DS, "baselines"_a, "gconf"_a,
"idx"_a, "grid"_a=py::none());
"idx"_a, "grid"_a);
m.def("grid2ms",&grid2ms<double>, "baselines"_a, "gconf"_a, "idx"_a,
"grid"_a, "ms_in"_a=py::none());
m.def("vis2grid_c",&vis2grid_c<double>, "baselines"_a, "gconf"_a, "idx"_a,
"vis"_a, "user_grid"_a);
"vis"_a, "user_grid"_a.none(true));
m.def("ms2grid_c",&ms2grid_c<double>, "baselines"_a, "gconf"_a, "idx"_a,
"ms"_a);
m.def("grid2vis_c",&grid2vis_c<double>, "baselines"_a, "gconf"_a, "idx"_a,
"grid"_a);
m.def("grid2ms_c",&grid2ms_c<double>, "baselines"_a, "gconf"_a, "idx"_a,
"grid"_a, "ms_in"_a.none(true));
"grid"_a, "ms_in"_a=py::none());
}
......@@ -67,6 +67,8 @@ def test_hoisted_grid_allocation(nxdirty, nydirty, nrow, nchan, epsilon):
# Same base array under the hood
assert grid.base is user_grid.base
ng.vis2grid_c(baselines, gconf, idx, vis, user_grid=None)
def test_pickling():
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment