cuemacro/finmarketpy

platform.platform() doesn't just yield 'mac' [AttributeError: 'MarketConstants' object has no attribute 'generic_plat']

Closed this issue · 0 comments

We get more detailed platform information now

>>> import platform
>>> platform.platform()
'macOS-10.15.7-x86_64-i386-64bit'

This causes the backtesting engine to fail on modern macbooks

AttributeError                            Traceback (most recent call last)
<ipython-input-12-80a29ff8827d> in <module>
----> 1 model.construct_strategy()

/usr/local/anaconda3/envs/qtrade/lib/python3.8/site-packages/finmarketpy/backtest/backtestengine.py in construct_strategy(self, br, run_in_parallel)
   1074 
   1075         # each portfolio key calculate returns - can put parts of the portfolio in the key
-> 1076         if market_constants.backtest_thread_no[market_constants.generic_plat] > 1 and run_in_parallel:
   1077             swim_pool = SwimPool(multiprocessing_library=market_constants.multiprocessing_library)
   1078 

AttributeError: 'MarketConstants' object has no attribute 'generic_plat'