Skip to content

Commit

Permalink
Fixes for cython version 3.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ibell committed Aug 29, 2023
1 parent b2931cf commit 2e33166
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion PDSim/flow/flow.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cdef class FlowPathCollection(list):
cpdef calculate(self)
cpdef get_deepcopy(self)
cpdef sumterms(self, arraym summerdT, arraym summerdm)
cpdef list flow_paths
cdef list flow_paths

#Make a stripped down class with the necessary terms included
cdef class FlowPath(object):
Expand Down
6 changes: 3 additions & 3 deletions PDSim/flow/flow_models.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ cpdef double IsentropicNozzle(double A, State State_up, State State_down, int ot
cdef class FlowFunction(object):
cpdef double call(self, FlowPath FP) except *
cpdef resize(self, int Nvalues)
cpdef public arraym flows
cpdef public int Nflows
cpdef public __name__, __strf__
cdef public arraym flows
cdef public int Nflows
cdef public __name__, __strf__

cdef class PyFlowFunctionWrapper(FlowFunction):
cdef public dict kwargs
Expand Down
2 changes: 1 addition & 1 deletion PDSim/flow/flow_models.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ cpdef double IsentropicNozzle(double A, State State_up, State State_down, int ot
"""

#some cython type declarations
cython.declare(T_up = cython.double, T_down = cython.double, mdot = cython.double)
cython.declare(T_up = cython.double, T_down = cython.double, mdot = cython.double, pr=cython.double, pr_crit=cython.double, gamma=cython.double, k=cython.double)
# Since ideal, R=cp-cv, and k=cp/cv
cp = State_up.get_cp0()
R = 8314.472/State_up.get_MM() #[J/kg/K]
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools > 35", "numpy", "cython<3.0", "coolprop"] # PEP 518 specifications.
build-backend = "setuptools.build_meta"
requires = ["setuptools > 35", "numpy", "cython", "coolprop"] # PEP 518 specifications.
build-backend = "setuptools.build_meta"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def clean():
sources = [pyx_file]
#Try to find a PXD backpack if possible
pxd_file = pyx_file.rsplit('.',1)[0]+'.pxd'
if os.path.exists(pxd_file):
sources+=[pxd_file]
# if os.path.exists(pxd_file):
# sources+=[pxd_file]
pxd_files.append(pxd_file)

# Add sources for clipper module
Expand Down

0 comments on commit 2e33166

Please sign in to comment.