Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use const for archive writer #251

Merged
merged 4 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions ansys/mapdl/reader/cython/_archive.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ def py_write_nblock_float(filename, const int [::1] node_id, int max_node_id,


def py_write_eblock(filename,
int [::1] elem_id,
int [::1] etype,
int [::1] mtype,
int [::1] rcon,
int [::1] elem_nnodes,
int64_t [::1] cells,
int64_t [::1] offset,
uint8_t [::1] celltypes,
int [::1] typenum,
int [::1] nodenum,
const int [::1] elem_id,
const int [::1] etype,
const int [::1] mtype,
const int [::1] rcon,
const int [::1] elem_nnodes,
const int64_t [::1] cells,
const int64_t [::1] offset,
const uint8_t [::1] celltypes,
const int [::1] typenum,
const int [::1] nodenum,
mode='w'):
cdef FILE* cfile = fopen(filename.encode(), mode.encode())
write_eblock(cfile,
Expand Down
2 changes: 1 addition & 1 deletion ansys/mapdl/reader/cython/_binary_reader.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ cdef np.ndarray wrap_array(void* c_ptr, int size, int type_flag, int prec_flag):
ndarray = np.array(array_wrapper, copy=False)

# Assign our object to the 'base' of the ndarray object
ndarray.base = <PyObject*> array_wrapper
np.PyArray_SetBaseObject(ndarray, array_wrapper)

# Increment the reference count, as the above assignment was done in
# C, and Python does not know that there is this additional reference
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"cython<3.0.0",
"cython==3.0.0b2",
"oldest-supported-numpy",
"setuptools>=45.0",
"wheel>=0.37.0",
Expand Down
5 changes: 3 additions & 2 deletions requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Sphinx<6
Sphinx<7
ansys-sphinx-theme==0.9.8
imageio==2.28.1
notfound==1.0.2
pypandoc==1.11
pyvista==0.38.5
pyvista==0.39.0
sphinx-copybutton==0.5.2
sphinx-gallery==0.13.0
sphinx-notfound-page==0.8.3
Expand Down