-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REF: Refactor to not depend on cython compile time conditional
statements
- Loading branch information
Showing
10 changed files
with
85 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
""" | ||
non-cpython array utilities | ||
https://github.com/pyproj4/pyproj/issues/854 | ||
""" | ||
cdef empty_array(int npts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
""" | ||
non-cpython array utilities | ||
https://github.com/pyproj4/pyproj/issues/854 | ||
""" | ||
cdef empty_array(int npts): | ||
return array.array("d", [float("NaN")] * npts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
""" | ||
cpython array utilities | ||
https://github.com/pyproj4/pyproj/issues/854 | ||
""" | ||
from cpython cimport array | ||
|
||
|
||
cdef array.array empty_array(int npts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
cpython array utilities | ||
https://github.com/pyproj4/pyproj/issues/854 | ||
""" | ||
|
||
from cpython cimport array | ||
|
||
|
||
cdef array.array _ARRAY_TEMPLATE = array.array("d", []) | ||
|
||
cdef array.array empty_array(int npts): | ||
return array.clone(_ARRAY_TEMPLATE, npts, zero=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,2 @@ | ||
cdef str cstrdecode(const char *instring) | ||
cpdef bytes cstrencode(str pystr) | ||
|
||
IF CTE_PYTHON_IMPLEMENTATION == "CPython": | ||
from cpython cimport array | ||
cdef array.array empty_array(int npts) | ||
|
||
ELSE: | ||
# https://github.com/pyproj4/pyproj/issues/854 | ||
cdef empty_array(int npts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "proj.h" | ||
|
||
#if PROJ_VERSION_MAJOR < 9 && PROJ_VERSION_MINOR < 1 | ||
PJ* proj_trans_get_last_used_operation(PJ *P) { | ||
return nullptr; | ||
} | ||
#endif |