Skip to content

Commit a172380

Browse files
committed
All project tests now really passing
1 parent 2d5803f commit a172380

7 files changed

Lines changed: 208 additions & 129 deletions

File tree

include/Projection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SignalSpace {
4040
py::object ret_val;
4141

4242
private:
43-
bool _Validate(py::object input, std::string var_name,
43+
constexpr bool _Validate(py::object input, std::string var_name,
4444
int dtype);
4545
};
4646

include/numpy_assist.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class BufferWrapper {
133133
// Constructor with no shape or type checking.
134134
BufferWrapper(std::string name, const py::object &src, bool optional)
135135
: BufferWrapper() {
136-
if (optional && (src.ptr() == Py_None))
136+
if (optional && (src.is_none()))
137137
return;
138138
//std::cerr << "BufferWrapper ctor " << name << " src = " << src.ptr() << ")" << std::endl;
139139
if (PyObject_GetBuffer(src.ptr(), view.get(),
@@ -156,27 +156,27 @@ class BufferWrapper {
156156
std::vector<int> shape)
157157
: BufferWrapper(name, src, optional) {
158158

159-
//std::cerr << "BufferWrapper start 4-arg ctor" << std::endl;
159+
std::cerr << "BufferWrapper start 4-arg ctor" << std::endl;
160160

161161
// "optional" items will cause the parent constructor to
162162
// succeed, but will leave buffer pointer unset.
163163
if (view->buf == NULL) {
164-
//std::cerr << "BufferWrapper: view->buf == NULL, return" << std::endl;
164+
std::cerr << "BufferWrapper: view->buf == NULL, return" << std::endl;
165165
return;
166166
}
167167

168168
if (!check_buffer_type<T>(*(view.get()))) {
169-
//std::cerr << "BufferWrapper: view invalid type = " << type_name<T>() << std::endl;
169+
std::cerr << "BufferWrapper: view invalid type = " << type_name<T>() << std::endl;
170170
throw dtype_exception(name, type_name<T>());
171171
}
172172

173173
std::vector<int> vshape;
174-
//std::cerr << "BufferWrapper: vshape = ";
174+
std::cerr << "BufferWrapper: vshape = ";
175175
for (int i=0; i<view->ndim; i++) {
176-
//std::cerr << view->shape[i] << ",";
176+
std::cerr << view->shape[i] << ",";
177177
vshape.push_back(view->shape[i]);
178178
}
179-
//std::cerr << std::endl;
179+
std::cerr << std::endl;
180180

181181
// Note special value -1 is as in numpy -- matches a single
182182
// axis. Special value -2 is treated as an ellipsis -- can be
@@ -205,6 +205,7 @@ class BufferWrapper {
205205
std::ostringstream s;
206206
s << "Expected " << shape_string(shape) << " but got " <<
207207
shape_string(vshape) << ".";
208+
std::cerr << s.str() << std::endl;
208209
throw shape_exception(name, s.str());
209210
}
210211
}
@@ -229,3 +230,7 @@ class BufferWrapper {
229230
private:
230231
std::shared_ptr<Py_buffer> view;
231232
};
233+
234+
235+
// Convert an n-dimensional array into a list of array slices.
236+
py::list list_of_arrays(py::object input);

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ so-hk-tool = "so3g.hk.cli:main"
5757

5858
[tool.scikit-build]
5959
# A list of args to pass to CMake when configuring the project.
60-
cmake.args = []
60+
#cmake.args = []
61+
cmake.args = ["-DCMAKE_C_FLAGS='-O0 -g'", "-DCMAKE_CXX_FLAGS='-O0 -g'"]
6162
# A table of defines to pass to CMake when configuring the project. Additive.
6263
cmake.define = {}
6364
# The build type to use when building the project.
@@ -110,7 +111,7 @@ build.requires = []
110111
# The components to install.
111112
install.components = []
112113
# Whether to strip the binaries.
113-
install.strip = true
114+
install.strip = false
114115
# Add the python build environment site_packages folder to the CMake prefix paths.
115116
search.site-packages = true
116117
# Strictly check all config options.

python/so3g/proj/wcs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,8 @@ def for_geom(cls, shape, wcs, interpol=None):
606606
interpol = INTERPOLS[0]
607607
self.interpol = interpol
608608

609+
print(f"for_geom: naxis = {self.naxis}, cdelt = {self.cdelt}, crpix = {self.crpix}", flush=True)
610+
609611
return self
610612

611613
@classmethod

0 commit comments

Comments
 (0)