-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backtest() works, but backtest_many() gives MemoryError #177
Comments
Thanks for reporting this. Yes, it looks like an incompatibility between |
Of course, I am experimenting with trying this on my end too, but if you push out a patch I'll happily try it. |
And yes - no problem with |
Ok, working on it in PR #178 |
Simply replacing I am digging into the code further. |
Looks like the fix passes tests, I'm going to merge and then you can try by installing the development version (https://www.cvxportfolio.com/en/master/#advanced-install-development-version); not sure which environment manager you're using but the syntax should be similar to |
Ok, in any case I've merged (always good to minimize dependencies, |
Just a thought. Perhaps @quant5 you have some Windows-specific |
I reverse engineered the call stack and got something to work. It turns out to be simple: setting
|
Obviously not sure if this is specific to my machine, Windows, etc. but if it makes it into any fix (e.g., a As a side note, removing the |
Sounds reasonable, I'll delve into the docs of |
This minor release contains various new features and fixes. Features: - new constraints Min/MaxHoldings, Min/MaxTradeWeights, Min/MaxTrades, FixedImbalance and NoCash (GH issue #180); - improved ParticipationRateLimit constraint; - improved exception reporting, now giving full path in evaluation tree where exception was raised (GH PR #176); - redesigned forecast.py, no API changes, still work in progress for full support for regularized regression; - added market_data = None option in Policy.execute; now Cvxportfolio policies can be executed (e.g., for online usage) without a MarketData server; all data needs to be provided separately to each individual object; - AnnualizedVolatility utility object, for usage in risk constraints; - added reject_trades_below and max_fraction_liquidity options to MarketSimulator, allowing to filter both small and too large trades (in simulation, using realized daily volumes); - minor updates in examples; - a few new sections in documentation manual; - changed license from APACHE2 to GPLv3, see explanation in GH issue #166; - moved documentation website to pydata-sphinx theme, and redesigned it a little; Fixes: - GH issue #146, cache files invalidatation on user interrupt; - GH issue #177, now using default Python multiprocessing, moved; multiprocess to optional dependency; - various smaller ones. This release took a bit longer than the usual 2-3 months. We hope to release 1.5.0 in about 2-3 months from now.
Specifications
Windows machine (x86). Python 3.11.5.
Fresh install of cvxportfolio to the new version (1.3.2) from a fresh virtual environment.
Description
I try to run the hello_world.py file here: https://github.com/cvxgrp/cvxportfolio/blob/master/examples/hello_world.py
simulator.backtest_many([policy, cvx.Uniform()], start_time="2020-01-01")
:backtest(), script succeeds. Example:
simulator.backtest(policy, start_time="2020-01-01")or
simulator.backtest(cvx.Uniform(), start_time="2020-01-01")`Other remarks
python -m cvxportfolio.tests
) worked fine. (see below)My thought is that
multiprocess
compatibility with Numpy could be the issue? But not seeing anything from a quick search. Any help would be appreciated.The text was updated successfully, but these errors were encountered: