pycopancore icon indicating copy to clipboard operation
pycopancore copied to clipboard

consider Cython support?

Open fkuehlein opened this issue 7 months ago • 0 comments

Hi!

I am currently working on a thorough revision of MayaSim's Python implementation. In that process I was seriously considering whether its full reimplementation in Pycopancore could be worthwile. I'm a fan of the conceptual structure of copan:CORE and I think MayaSim could hugely profit from that structure, apart from their obviously matching roots.

However, a problem of MayaSim is that it is quite large (i.e. many grid-cells, many agents, many simultaneous processes) and therefore rather unhandy for my purposes. I am trying to improve its performance by implementing some helper methods in Cython, which you're probably familiar with. I find Cython rather straightforward to use with Python. In Pycopancore, however, the inclusion of Cython or other more performant languages is currently not supported.

Therefore, I'd like to propose the addition of the Cython compiler to Pycopancore, such that the implementation of model components could contain both Python and Cython files (as in Pyunicorn). In the docs I found that a C++ implementation of Pycopancore is planned, but including Cython could improve model performances at a much smaller effort, especially under the assumption that the implementations of single model components are what requires most computational resources.

Has this been considered before? Just wanted to put it here, although unfortunately I probably won't have the capacities to reimplement MayaSim in Pycopancore anyway..

Cheers!

fkuehlein avatar Nov 09 '23 10:11 fkuehlein