Skip to content

Commit

Permalink
Merge pull request #109 from QuantConnect/bug-107-remove-cli-research…
Browse files Browse the repository at this point in the history
…-limits

Remove local object storage limit
  • Loading branch information
Martin-Molinero authored Jun 24, 2022
2 parents 4139d38 + 28bf5d3 commit 3591e7f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
6 changes: 6 additions & 0 deletions lean/components/config/lean_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ def get_complete_lean_config(self,
project_config = self._project_config_manager.get_project_config(algorithm_file.parent)
config["parameters"] = project_config.get("parameters", {})

# No real limit for the object store by default
if "storage-limit-mb" not in config:
config["storage-limit-mb"] = "9999999"
if "storage-file-count" not in config:
config["storage-file-count"] = "9999999"

return config

def configure_data_purchase_limit(self, lean_config: Dict[str, Any], data_purchase_limit: Optional[int]) -> None:
Expand Down
19 changes: 13 additions & 6 deletions tests/commands/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_live_calls_lean_runner_with_correct_algorithm_file() -> None:
result = CliRunner().invoke(lean, ["live", "Python Project", "--environment", "live-paper"])

traceback.print_exception(*result.exc_info)

assert result.exit_code == 0

lean_runner.run_lean.assert_called_once_with(mock.ANY,
Expand Down Expand Up @@ -303,6 +303,7 @@ def test_live_aborts_when_lean_config_is_missing_properties(target: str, replace
"gdax-use-sandbox": "paper"
},
"Binance": {
"binance-exchange-name": "binance",
"binance-api-key": "123",
"binance-api-secret": "456",
"binance-use-testnet": "paper",
Expand Down Expand Up @@ -364,7 +365,7 @@ def test_live_aborts_when_lean_config_is_missing_properties(target: str, replace
"ftx-exchange-name": "FTX",
"ftx-organization": "abc",
},

}

data_feed_required_options = {
Expand Down Expand Up @@ -539,7 +540,7 @@ def test_live_non_interactive_calls_run_lean_when_all_options_given_with_multipl
False,
False)


@pytest.mark.parametrize("brokerage", brokerage_required_options.keys() - ["Paper Trading"])
def test_live_non_interactive_falls_back_to_lean_config_for_brokerage_settings(brokerage: str) -> None:
create_fake_lean_cli_directory()
Expand Down Expand Up @@ -578,12 +579,14 @@ def test_live_non_interactive_falls_back_to_lean_config_for_brokerage_settings(b
elif brokerage == "FTX":
data_feed = "Binance"
options.extend(["--ftx-exchange-name", "FTXUS",
"--binance-exchange-name", "binance",
"--binance-api-key", "123",
"--binance-api-secret", "456",
"--binance-use-testnet", "live"])
else:
data_feed = "Binance"
options.extend(["--binance-api-key", "123",
options.extend(["--binance-exchange-name", "binance",
"--binance-api-key", "123",
"--binance-api-secret", "456",
"--binance-use-testnet", "live"])

Expand Down Expand Up @@ -640,7 +643,9 @@ def test_live_non_interactive_falls_back_to_lean_config_for_data_feed_settings(d

if data_feed == "FTX":
options.extend(["--ftx-exchange-name", "FTX"])

elif data_feed == "Binance":
options.extend(["--binance-exchange-name", "binance"])

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", "Paper Trading",
"--data-feed", data_feed,
Expand Down Expand Up @@ -695,7 +700,9 @@ def test_live_non_interactive_falls_back_to_lean_config_for_multiple_data_feed_s

if data_feed1 == "FTX" or data_feed2 == "FTX":
options.extend(["--ftx-exchange-name", "FTX"])

elif data_feed1 == "Binance" or data_feed2 == "Binance":
options.extend(["--binance-exchange-name", "binance"])

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", "Paper Trading",
"--data-feed", data_feed1,
Expand Down

0 comments on commit 3591e7f

Please sign in to comment.