Skip to content

Commit

Permalink
Merge pull request cyclus#1636 from cyclus/cython3-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke authored Jan 15, 2024
2 parents ebea144 + 4422ae2 commit 1c2ea10
Show file tree
Hide file tree
Showing 15 changed files with 254 additions and 257 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Since last release
* Added code coverage reporting to GitHub workflows (#1616)
* Adds active and dormant buying cycles in buy policy (#1596)
* Add random number generator (Mersenne Twister 19937, from boost) and the ability to set the seed in the simulation control block (#1599, #1639)
* Adds support for Cython3 (#1636)

**Changed:**

Expand Down
4 changes: 1 addition & 3 deletions cmake/UseCython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,7 @@ function( compile_pyx _name generated_file )
set( cython_debug_arg "--gdb" )
endif()

if( "${PYTHONLIBS_VERSION_STRING}" MATCHES "^2." )
set( version_arg "-2" )
elseif( "${PYTHONLIBS_VERSION_STRING}" MATCHES "^3." )
if( "${Python3_VERSION_MAJOR}" MATCHES "3" )
set( version_arg "-3" )
else()
set( version_arg )
Expand Down
166 changes: 83 additions & 83 deletions cyclus/agents.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ from cyclus.cpp_cyclus cimport shared_ptr
cdef cppclass CyclusAgentShim "CyclusAgentShim" (cpp_cyclus.Agent): # C++CONSTRUCTORS CyclusAgentShim(cyclus::Context*)
# Agent interface
CyclusAgentShim(cpp_cyclus.Context*)
std_string version() except +
cpp_cyclus.Agent* Clone() except +
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except +
void InitFromAgent "InitFrom" (CyclusAgentShim*) except +
void InitFrom(cpp_cyclus.QueryableBackend*) except +
void Snapshot(cpp_cyclus.DbInit) except +
void InitInv(cpp_cyclus.Inventories&) except +
cpp_cyclus.Inventories SnapshotInv() except +
std_string schema() except +
cpp_jsoncpp.Value annotations() except +
void Build(cpp_cyclus.Agent*) except +
void EnterNotify() except +
void BuildNotify() except +
void DecomNotify() except +
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except +
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except +
std_string version() except *
cpp_cyclus.Agent* Clone() except *
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except *
void InitFromAgent "InitFrom" (CyclusAgentShim*) except *
void InitFrom(cpp_cyclus.QueryableBackend*) except *
void Snapshot(cpp_cyclus.DbInit) except *
void InitInv(cpp_cyclus.Inventories&) except *
cpp_cyclus.Inventories SnapshotInv() except *
std_string schema() except *
cpp_jsoncpp.Value annotations() except *
void Build(cpp_cyclus.Agent*) except *
void EnterNotify() except *
void BuildNotify() except *
void DecomNotify() except *
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except *
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except *
# Extra interface
PyObject* self # the Python object we are shimming

Expand All @@ -43,25 +43,25 @@ cdef cppclass CyclusAgentShim "CyclusAgentShim" (cpp_cyclus.Agent): # C++CONSTR
cdef cppclass CyclusRegionShim "CyclusRegionShim" (cpp_cyclus.Region): # C++CONSTRUCTORS CyclusRegionShim(cyclus::Context*)
# Agent interface
CyclusRegionShim(cpp_cyclus.Context*)
std_string version() except +
cpp_cyclus.Agent* Clone() except +
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except +
void InitFromAgent "InitFrom" (CyclusRegionShim*) except +
void InitFrom(cpp_cyclus.QueryableBackend*) except +
void Snapshot(cpp_cyclus.DbInit) except +
void InitInv(cpp_cyclus.Inventories&) except +
cpp_cyclus.Inventories SnapshotInv() except +
std_string schema() except +
cpp_jsoncpp.Value annotations() except +
void Build(cpp_cyclus.Agent*) except +
void EnterNotify() except +
void BuildNotify() except +
void DecomNotify() except +
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except +
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except +
void Tick() except +
void Tock() except +
void Decision() except +
std_string version() except *
cpp_cyclus.Agent* Clone() except *
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except *
void InitFromAgent "InitFrom" (CyclusRegionShim*) except *
void InitFrom(cpp_cyclus.QueryableBackend*) except *
void Snapshot(cpp_cyclus.DbInit) except *
void InitInv(cpp_cyclus.Inventories&) except *
cpp_cyclus.Inventories SnapshotInv() except *
std_string schema() except *
cpp_jsoncpp.Value annotations() except *
void Build(cpp_cyclus.Agent*) except *
void EnterNotify() except *
void BuildNotify() except *
void DecomNotify() except *
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except *
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except *
void Tick() except *
void Tock() except *
void Decision() except *
# Extra interface
PyObject* self # the Python object we are shimming

Expand All @@ -72,25 +72,25 @@ cdef cppclass CyclusRegionShim "CyclusRegionShim" (cpp_cyclus.Region): # C++CON
cdef cppclass CyclusInstitutionShim "CyclusInstitutionShim" (cpp_cyclus.Institution): # C++CONSTRUCTORS CyclusInstitutionShim(cyclus::Context*)
# Agent interface
CyclusInstitutionShim(cpp_cyclus.Context*)
std_string version() except +
cpp_cyclus.Agent* Clone() except +
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except +
void InitFromAgent "InitFrom" (CyclusInstitutionShim*) except +
void InitFrom(cpp_cyclus.QueryableBackend*) except +
void Snapshot(cpp_cyclus.DbInit) except +
void InitInv(cpp_cyclus.Inventories&) except +
cpp_cyclus.Inventories SnapshotInv() except +
std_string schema() except +
cpp_jsoncpp.Value annotations() except +
void Build(cpp_cyclus.Agent*) except +
void EnterNotify() except +
void BuildNotify() except +
void DecomNotify() except +
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except +
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except +
void Tick() except +
void Tock() except +
void Decision() except +
std_string version() except *
cpp_cyclus.Agent* Clone() except *
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except *
void InitFromAgent "InitFrom" (CyclusInstitutionShim*) except *
void InitFrom(cpp_cyclus.QueryableBackend*) except *
void Snapshot(cpp_cyclus.DbInit) except *
void InitInv(cpp_cyclus.Inventories&) except *
cpp_cyclus.Inventories SnapshotInv() except *
std_string schema() except *
cpp_jsoncpp.Value annotations() except *
void Build(cpp_cyclus.Agent*) except *
void EnterNotify() except *
void BuildNotify() except *
void DecomNotify() except *
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except *
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except *
void Tick() except *
void Tock() except *
void Decision() except *
# Extra interface
PyObject* self # the Python object we are shimming

Expand All @@ -101,34 +101,34 @@ cdef cppclass CyclusInstitutionShim "CyclusInstitutionShim" (cpp_cyclus.Institut
cdef cppclass CyclusFacilityShim "CyclusFacilityShim" (cpp_cyclus.Facility): # C++CONSTRUCTORS CyclusFacilityShim(cyclus::Context*)
# Agent interface
CyclusFacilityShim(cpp_cyclus.Context*)
std_string version() except +
cpp_cyclus.Agent* Clone() except +
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except +
void InitFromAgent "InitFrom" (CyclusFacilityShim*) except +
void InitFrom(cpp_cyclus.QueryableBackend*) except +
void Snapshot(cpp_cyclus.DbInit) except +
void InitInv(cpp_cyclus.Inventories&) except +
cpp_cyclus.Inventories SnapshotInv() except +
std_string schema() except +
cpp_jsoncpp.Value annotations() except +
void Build(cpp_cyclus.Agent*) except +
void EnterNotify() except +
void BuildNotify() except +
void DecomNotify() except +
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except +
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except +
void Tick() except +
void Tock() except +
void Decision() except +
cpp_bool CheckDecommissionCondition() except +
std_set[shared_ptr[cpp_cyclus.RequestPortfolio[cpp_cyclus.Material]]] GetMatlRequests() except +
std_set[shared_ptr[cpp_cyclus.RequestPortfolio[cpp_cyclus.Product]]] GetProductRequests() except +
std_set[shared_ptr[cpp_cyclus.BidPortfolio[cpp_cyclus.Material]]] GetMatlBids(cpp_cyclus.CommodMap[cpp_cyclus.Material].type&) except +
std_set[shared_ptr[cpp_cyclus.BidPortfolio[cpp_cyclus.Product]]] GetProductBids(cpp_cyclus.CommodMap[cpp_cyclus.Product].type&) except +
void GetMatlTrades(const std_vector[cpp_cyclus.Trade[cpp_cyclus.Material]]&, std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Material], shared_ptr[cpp_cyclus.Material]]]&) except +
void GetProductTrades(const std_vector[cpp_cyclus.Trade[cpp_cyclus.Product]]&, std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Product], shared_ptr[cpp_cyclus.Product]]]&) except +
void AcceptMatlTrades(const std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Material], shared_ptr[cpp_cyclus.Material]]]&) except +
void AcceptProductTrades(const std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Product], shared_ptr[cpp_cyclus.Product]]]&) except +
std_string version() except *
cpp_cyclus.Agent* Clone() except *
void InfileToDb(cpp_cyclus.InfileTree*, cpp_cyclus.DbInit) except *
void InitFromAgent "InitFrom" (CyclusFacilityShim*) except *
void InitFrom(cpp_cyclus.QueryableBackend*) except *
void Snapshot(cpp_cyclus.DbInit) except *
void InitInv(cpp_cyclus.Inventories&) except *
cpp_cyclus.Inventories SnapshotInv() except *
std_string schema() except *
cpp_jsoncpp.Value annotations() except *
void Build(cpp_cyclus.Agent*) except *
void EnterNotify() except *
void BuildNotify() except *
void DecomNotify() except *
void AdjustMatlPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Material].type&) except *
void AdjustProductPrefs(cpp_cyclus.PrefMap[cpp_cyclus.Product].type&) except *
void Tick() except *
void Tock() except *
void Decision() except *
cpp_bool CheckDecommissionCondition() except *
std_set[shared_ptr[cpp_cyclus.RequestPortfolio[cpp_cyclus.Material]]] GetMatlRequests() except *
std_set[shared_ptr[cpp_cyclus.RequestPortfolio[cpp_cyclus.Product]]] GetProductRequests() except *
std_set[shared_ptr[cpp_cyclus.BidPortfolio[cpp_cyclus.Material]]] GetMatlBids(cpp_cyclus.CommodMap[cpp_cyclus.Material].type&) except *
std_set[shared_ptr[cpp_cyclus.BidPortfolio[cpp_cyclus.Product]]] GetProductBids(cpp_cyclus.CommodMap[cpp_cyclus.Product].type&) except *
void GetMatlTrades(const std_vector[cpp_cyclus.Trade[cpp_cyclus.Material]]&, std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Material], shared_ptr[cpp_cyclus.Material]]]&) except *
void GetProductTrades(const std_vector[cpp_cyclus.Trade[cpp_cyclus.Product]]&, std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Product], shared_ptr[cpp_cyclus.Product]]]&) except *
void AcceptMatlTrades(const std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Material], shared_ptr[cpp_cyclus.Material]]]&) except *
void AcceptProductTrades(const std_vector[std_pair[cpp_cyclus.Trade[cpp_cyclus.Product], shared_ptr[cpp_cyclus.Product]]]&) except *
# Extra interface
PyObject* self # the Python object we are shimming

Expand Down Expand Up @@ -171,4 +171,4 @@ cdef class _Facility(_Agent):
#

cdef tuple index_and_sort_vars(dict)
cdef cpp_cyclus.Agent* dynamic_agent_ptr(object) except +
cdef cpp_cyclus.Agent* dynamic_agent_ptr(object) except *
Loading

0 comments on commit 1c2ea10

Please sign in to comment.