Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Nektar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mesh generation
Nektar
Commits
172db761
Commit
172db761
authored
4 years ago
by
Jeremy Cohen
Browse files
Options
Downloads
Patches
Plain Diff
Fix for Mac OS numpy warnings - patch
parent
cc50164f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/thirdparty-patches/numpy-deprecated-api-warnings.patch
+74
-0
74 additions, 0 deletions
cmake/thirdparty-patches/numpy-deprecated-api-warnings.patch
with
74 additions
and
0 deletions
cmake/thirdparty-patches/numpy-deprecated-api-warnings.patch
0 → 100644
+
74
−
0
View file @
172db761
--- CMakeLists.txt 2019-10-07 12:58:21.000000000 +0100
+++ CMakeLists.txt 2020-06-01 13:49:08.000000000 +0100
@@ -144,6 +144,9 @@
# compiler definitions for non-windows builds
if (NOT WIN32)
add_definitions(-fPIC)
+ if (APPLE)
+ add_definitions(-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
+ endif()
endif()
if (BUILD_TESTS)
--- libs/numpy/src/ndarray.cpp 2020-06-01 13:51:55.000000000 +0100
+++ libs/numpy/src/ndarray.cpp 2020-06-01 13:52:17.000000000 +0100
@@ -25,20 +25,20 @@
ndarray::bitflag numpy_to_bitflag(int const f)
{
ndarray::bitflag r = ndarray::NONE;
- if (f & NPY_C_CONTIGUOUS) r = (r | ndarray::C_CONTIGUOUS);
- if (f & NPY_F_CONTIGUOUS) r = (r | ndarray::F_CONTIGUOUS);
- if (f & NPY_ALIGNED) r = (r | ndarray::ALIGNED);
- if (f & NPY_WRITEABLE) r = (r | ndarray::WRITEABLE);
+ if (f & NPY_ARRAY_C_CONTIGUOUS) r = (r | ndarray::C_CONTIGUOUS);
+ if (f & NPY_ARRAY_F_CONTIGUOUS) r = (r | ndarray::F_CONTIGUOUS);
+ if (f & NPY_ARRAY_ALIGNED) r = (r | ndarray::ALIGNED);
+ if (f & NPY_ARRAY_WRITEABLE) r = (r | ndarray::WRITEABLE);
return r;
}
int bitflag_to_numpy(ndarray::bitflag f)
{
int r = 0;
- if (f & ndarray::C_CONTIGUOUS) r |= NPY_C_CONTIGUOUS;
- if (f & ndarray::F_CONTIGUOUS) r |= NPY_F_CONTIGUOUS;
- if (f & ndarray::ALIGNED) r |= NPY_ALIGNED;
- if (f & ndarray::WRITEABLE) r |= NPY_WRITEABLE;
+ if (f & ndarray::C_CONTIGUOUS) r |= NPY_ARRAY_C_CONTIGUOUS;
+ if (f & ndarray::F_CONTIGUOUS) r |= NPY_ARRAY_F_CONTIGUOUS;
+ if (f & ndarray::ALIGNED) r |= NPY_ARRAY_ALIGNED;
+ if (f & ndarray::WRITEABLE) r |= NPY_ARRAY_WRITEABLE;
return r;
}
@@ -122,10 +122,10 @@
}
int itemsize = dt.get_itemsize();
int flags = 0;
- if (writeable) flags |= NPY_WRITEABLE;
- if (is_c_contiguous(shape, strides, itemsize)) flags |= NPY_C_CONTIGUOUS;
- if (is_f_contiguous(shape, strides, itemsize)) flags |= NPY_F_CONTIGUOUS;
- if (is_aligned(strides, itemsize)) flags |= NPY_ALIGNED;
+ if (writeable) flags |= NPY_ARRAY_WRITEABLE;
+ if (is_c_contiguous(shape, strides, itemsize)) flags |= NPY_ARRAY_C_CONTIGUOUS;
+ if (is_f_contiguous(shape, strides, itemsize)) flags |= NPY_ARRAY_F_CONTIGUOUS;
+ if (is_aligned(strides, itemsize)) flags |= NPY_ARRAY_ALIGNED;
ndarray r(python::detail::new_reference
(PyArray_NewFromDescr(&PyArray_Type,
incref_dtype(dt),
@@ -246,13 +246,13 @@
ndarray array(python::object const & obj)
{
return ndarray(python::detail::new_reference
- (PyArray_FromAny(obj.ptr(), NULL, 0, 0, NPY_ENSUREARRAY, NULL)));
+ (PyArray_FromAny(obj.ptr(), NULL, 0, 0, NPY_ARRAY_ENSUREARRAY, NULL)));
}
ndarray array(python::object const & obj, dtype const & dt)
{
return ndarray(python::detail::new_reference
- (PyArray_FromAny(obj.ptr(), detail::incref_dtype(dt), 0, 0, NPY_ENSUREARRAY, NULL)));
+ (PyArray_FromAny(obj.ptr(), detail::incref_dtype(dt), 0, 0, NPY_ARRAY_ENSUREARRAY, NULL)));
}
ndarray from_object(python::object const & obj, dtype const & dt, int nd_min, int nd_max, ndarray::bitflag flags)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment