Closed 10sun closed 2 years ago
@10sun Can you give some more details on the environment you are running the code on? From the debug output you shared, it looks like it's some type of remote machine?
This is a bit of a strange stack trace, I'd suggest some of the following steps to debug:
_ef_default_returns_range
, which is defined as follows:def _ef_default_returns_range(ef, points):
ef_minvol = copy.deepcopy(ef)
ef_maxret = copy.deepcopy(ef)
ef_minvol.min_volatility()
min_ret = ef_minvol.portfolio_performance()[0]
max_ret = ef_maxret._max_return()
return np.linspace(min_ret, max_ret - 0.0001, points)
Perhaps try running each of these lines separately to see if one of them in particular is causing problems?
I'm closing for now as this is stale, but feel free to reopen if needed.
Describe the bug while calling this function, I ran into the problem of ''Exiting message loop for channel Server[1]: [WinError 10054] An existing connection was forcibly closed by the remote host".
Through debugging into the function, it is found that the error happened after finishing line 248, 'ef_param_range = _ef_default_returns_range(opt, points)'.
The debug log file says '' "exitCode": 3221226356. Would this be possibly linked to a heap corruption?
Code sample
Operating system, python version, PyPortfolioOpt version Win 10 Enterprise, OS Build: 19042.1110, python 3.7.6 PyPortfolioOpt 1.4.2
Additional context some debug printout: