AB-CE / examples

Repos for examples of abcEconomics simulations that can be extended from
Apache License 2.0
29 stars 23 forks source link

OverflowError: Python int too large to convert to C long #8

Open ymanol opened 4 years ago

ymanol commented 4 years ago

I ran the 2sectors example and received the following error:

File "abcEconomics\trade.pyx", line 485, in abcEconomics.trade.Trade.sell File "abcEconomics\trade.pyx", line 121, in abcEconomics.trade.Offer.cinit OverflowError: Python int too large to convert to C long

patrickxli commented 4 years ago

Same error here I experience:

File "abcEconomics\trade.pyx", line 485, in abcEconomics.trade.Trade.sell File "abcEconomics\trade.pyx", line 121, in abcEconomics.trade.Offer.cinit OverflowError: Python int too large to convert to C long

Any way to fix it?

rht commented 4 years ago

Didn't see this issue until just now. The abcEconomics on current master (not yet renamed to main to avoid the bad connotation) no longer uses cython, because the speedup gain is not significant, so we remove it for simplicity's sake. I will try to update the version uses in this repo when I have the time.

Currently, to make it work on cython's C, we probably need to use long long (int64).

rht commented 4 years ago

I ran the start.py of 2sectors on latest master (https://github.com/AB-CE/abce/commit/983d427899a081160a3e3f0592ed0b1c1e3b69ab) and it worked fine. However, some of the examples are using outdated API that it will take a while to update this repo's requirements.txt.