File tree 2 files changed +18
-18
lines changed
2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ LDFLAGS += $(shell $(PYTHON_CONFIG) --libs)
10
10
11
11
# Either finds numpy or set -DWITHOUT_NUMPY
12
12
EXTRA_FLAGS += $(shell $(PYTHON_BIN ) $(CURDIR ) /numpy_flags.py)
13
- WITHOUT_NUMPY := $(findstring $(CXXFLAGS ) , WITHOUT_NUMPY)
13
+ WITHOUT_NUMPY := $(findstring $(EXTRA_FLAGS ) , WITHOUT_NUMPY)
14
14
15
15
# Examples requiring numpy support to compile
16
- EXAMPLES_NUMPY := surface
16
+ EXAMPLES_NUMPY := surface colorbar
17
17
EXAMPLES := minimal basic modern animation nonblock xkcd quiver bar \
18
- fill_inbetween fill update subplot2grid colorbar lines3d \
19
- $(if WITHOUT_NUMPY,,$(EXAMPLES_NUMPY ) )
18
+ fill_inbetween fill update subplot2grid lines3d \
19
+ $(if $( WITHOUT_NUMPY ) ,,$(EXAMPLES_NUMPY ) )
20
20
21
21
# Prefix every example with 'examples/build/'
22
22
EXAMPLE_TARGETS := $(patsubst % ,examples/build/% ,$(EXAMPLES ) )
Original file line number Diff line number Diff line change @@ -340,6 +340,20 @@ PyObject* get_2darray(const std::vector<::std::vector<Numeric>>& v)
340
340
return reinterpret_cast <PyObject *>(varray);
341
341
}
342
342
343
+ #else // fallback if we don't have numpy: copy every element of the given vector
344
+
345
+ template <typename Numeric>
346
+ PyObject* get_array (const std::vector<Numeric>& v)
347
+ {
348
+ PyObject* list = PyList_New (v.size ());
349
+ for (size_t i = 0 ; i < v.size (); ++i) {
350
+ PyList_SetItem (list, i, PyFloat_FromDouble (v.at (i)));
351
+ }
352
+ return list;
353
+ }
354
+
355
+ #endif // WITHOUT_NUMPY
356
+
343
357
// sometimes, for labels and such, we need string arrays
344
358
PyObject * get_array (const std::vector<std::string>& strings)
345
359
{
@@ -361,20 +375,6 @@ PyObject* get_listlist(const std::vector<std::vector<Numeric>>& ll)
361
375
return listlist;
362
376
}
363
377
364
- #else // fallback if we don't have numpy: copy every element of the given vector
365
-
366
- template <typename Numeric>
367
- PyObject* get_array (const std::vector<Numeric>& v)
368
- {
369
- PyObject* list = PyList_New (v.size ());
370
- for (size_t i = 0 ; i < v.size (); ++i) {
371
- PyList_SetItem (list, i, PyFloat_FromDouble (v.at (i)));
372
- }
373
- return list;
374
- }
375
-
376
- #endif // WITHOUT_NUMPY
377
-
378
378
} // namespace detail
379
379
380
380
// / Plot a line through the given x and y data points..
You can’t perform that action at this time.
0 commit comments