74 Commits

Author SHA1 Message Date
Martin-Molinero afd62cda32 Minor initialization weak (#9460)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
2026-05-06 15:57:09 -03:00
Jhonathan Abreu 0282954b57 Fix launcher exit on null job (#8889) 2025-07-24 18:04:31 -04:00
Jhonathan Abreu 2372153eec Exit properly from launcher program (#8888)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Don't leave unhandled exceptions and exit properly from program
2025-07-24 15:37:05 -04:00
Martin-Molinero 2a82c6f9bb Consolidate Configuration.Get usages (#7796)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
2024-02-20 13:37:22 -03:00
Martin-Molinero 0fa471f4e5 Resource related improvements (#6683)
Python Virtual Environments / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
- Add resource controls logs
- Make sure the OS CPU performance counter thread is only created when
  desired, not in research
2022-10-12 17:25:56 -03:00
Martin-Molinero dc7b2faa6b Fix launcher potential null reference (#6567)
Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
- Fix launcher potential null reference if the job is null
2022-08-22 19:03:32 -03:00
Martin-Molinero 3f42101f6d Update to python38 and libraries (#6558)
* Update to python38

- Update to python38
- Update libraries

* Create latest virtual environment. Add CI unit tests

* Further update python packages

* Virtual env fixes

- Refactor python virtual env setup
- Adding CI unit tests for python packages and virtual envs

* Adding more python packages

- Adding NBeats, Ax-platform, Riskfolio-Lib

* Rename pomegranate venv
2022-08-22 13:54:02 -03:00
Martin-Molinero 6f3208eded Python Virtual Environments Support (#6556)
Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
- Add support to use a python virtual environment if defined in the
  algorithm job. Adding tests
2022-08-17 16:40:52 -03:00
Martin-Molinero 18eec48a3d Avoid PythonNet runtime stash on shutdown (#6441)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
* Can't relesase the GIL after shutdown

* Bump version to pythonnet 2.0.16
2022-06-27 13:04:01 -03:00
Martin-Molinero 59ac2f57ed Shutdown python manually (#6439)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
2022-06-24 18:43:44 -03:00
Martin-Molinero 4b86c78df0 Add unit test showcasing feature (#6339)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
2022-05-13 20:21:08 -03:00
Martin-Molinero ef4fea7592 Fix engine initialization (#5814)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
2021-07-30 17:33:03 -07:00
Martin-Molinero 41636c94c3 Common engine initialization (#5809)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
- Create Lean common engine initialization class, which will be called
  by research and Lean launcher
- Fix backtest deserialization bug due to failing to handle decimal
  value
2021-07-29 21:14:17 -03:00
Martin-Molinero 2df6715301 Add hostname to initial log message (#5608)
Build & Test Lean / build (push) Has been cancelled
2021-05-26 19:27:05 -03:00
Martin-Molinero ba4c45d729 Remove version checking (#5315) 2021-02-18 18:32:07 -03:00
Gerardo Salazar aef2a47892 Updates CPU performance metrics gathering approach (#5261)
* Updates CPU performance metrics gathering for project modernization

  * PerformanceCounters are not supported cross-platform in
    .NET Core/5.0, which requires the use of an alternative method
    in the gathering of performance metrics. Since no exposed .NET API
    exists to gather these metrics without blocking, a new thread is
    created to block the time necessary for the CPU performance to be
    calculated.

* Address review: remove ResetEvent and make CpuPercent atomic

* Dispose of CpuPerformance instance before exiting Lean

* Minor tweak for Task and comment

Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
2021-02-05 20:23:30 -03:00
Martin-Molinero 2de9c21b6d Optimization tweaks (#5056)
* Add progress for runtimeStats

- Add optimization progress runtimestats
- Add ServerStatistics for the last backtesting package

* Add StaticOptimizationParameter

- Add StaticOptimizationParameter. Updating unit tests
2020-12-18 16:01:44 -08:00
Martin-Molinero 0dfb368cb4 Lean shutdown improvements (#4982)
- Use DisposeSafely instead of dipose.
- Adding some logs to know when handlers are getting disposed.
- Normalize exit procedure
2020-12-02 09:55:50 -08:00
Colton Sellers 041a111b92 Implement safe exiting for Lean (#4972) 2020-11-27 18:14:18 -03:00
Martin Molinero eb6e0a141c Specify log file location
- Respect "results-destination-folder", if provided, for system log
2020-05-27 14:33:44 -03:00
Martin Molinero cd9bf4cc77 Making WorkerThread static
- Making WorkerThread instance static
- Adding PythonInitialize.AddPythonPaths(), useful to add paths to
python after initialization
2020-01-14 11:31:58 -03:00
Jared 053dbd5cf9 Merge pull request #3902 from Martin-Molinero/improve-null-job-exception-error-message
Improve null job exception message
2019-12-09 14:39:51 -08:00
Martin Molinero 2229f1fab9 Improve null job exception message 2019-12-09 19:17:23 -03:00
Martin-Molinero 60ce6cf437 Revert "Add assembly loading logs" 2019-12-09 17:21:44 -03:00
Martin Molinero ace13218ad Add assembly loading logs 2019-11-19 12:52:21 -03:00
Michael Handschuh 09cc78599a Add mechanism for scheduled events to use 'additional time'
We restrict each algorithm time loop to a pre-determined amount of time.
Exceeding this limit will cause the algorithm to immediately terminate.
This quickly becomes an issue when considering users running trainable
models that have a long initialization period that exceeds the time loop
maximum.

This change provides a mechanism through which a long-running scheduled
event is permitted to keep running and is permitted to avoid the time loop
permitted by requesting additional time. Requests for additional time are
limited according to a leaky bucket implementation whose parameters are
set via the job's controls structure. The fundamental time unit for the
algorithm is a single minute.

Here's how it works. If a scheduled event takes longer than one full wall
clock second then a request is made to the leaky bucket for one more minute.
If the scheduled event continues to take more time, it will continue to
request additional minutes. Each requested minute will prevent the algorithm's
time loop check from terminating the algorithm. When the bucket is empty and
no more minutes are available to be requested, a TimeoutException is thrown
causing a cascade that ends in the algorithm's termination and status being
flipped to RuntimeError.

Additionally, this applies equally to ALL scheduled events. While some helpers
were added with the naming of Train and TrainNow to the ScheduleManager, these
methods don't do anything special and the infrastructure doesn't otherwise
flag them as different, so this feature becomes part of the core Scheduled
Event feature set.

Further, the live scheduled events were not touched and are still pending
further discussion regarding the value added by enforcing a time restriction
when simulation time and wall clock time are equivalent.

Fixes #3319
2019-10-19 14:52:34 -04:00
Michael Handschuh 30c8772a7e Update Compression/Jupyter/Launcher/Queues/UserInterface to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 15:30:44 -04:00
Martin Molinero eb9fe73ebc Engine code clean up 2019-08-16 19:09:45 -03:00
AlexCatarino a751556779 Removes QuantConnect.Views project
This UX has been deprecated and now removed.
2019-08-14 21:23:58 +01:00
Stefano Raggi f44c202d76 Fix Console.OutputEncoding in LEAN Launcher (Windows only)
The current setting of Encoding.Unicode was preventing LEAN from receiving IBAutomater output and error events when running local LEAN under Windows.
Changing to Encoding.UTF8 solves the issue.
2019-08-01 17:04:26 +02:00
Jared 992d721d08 Revert "Reduce python load time 30% (#3440)" (#3441)
Reverts test commit 70017f0e05.
2019-07-28 18:37:34 -07:00
Jared 70017f0e05 Reduce python load time 30% (#3440)
Optimize python load times
2019-07-28 17:20:52 -07:00
Michael Wei 3d89898ba2 Emit an error if desktop-exe does not exist 2019-05-27 22:14:13 -07:00
Stefano Raggi a5c8a0325a Remove TotalPhysicalMemory and FreePhysicalMemory from OS class 2019-01-11 19:52:55 +01:00
AlexCatarino 296693c9f7 Logs pythonnet after it is loaded. 2018-08-27 23:36:23 +01:00
Amir Mamaghani 9d449800eb Feature - CLI arguments overrides configuration file + load config from CLI 2018-05-15 21:44:25 +02:00
Amir Mamaghani 4ac2c8cf27 QuantConnect.Configuration - Added ability to choose configuration file during runtime. 2018-05-15 15:40:30 +02:00
Andrew d893bd7398 Renamed ILeanManagement to ILeanManager
Renamed this interface and all associated classes and content to be more
in line with Lean naming conventions.
2017-08-09 16:15:52 -04:00
Andrew 719174ebae Added more logging at shutdown 2017-07-29 12:12:38 -04:00
Andrew 8ebe60a616 Exit added 2017-07-29 11:55:31 -04:00
Andrew 3a7be01d78 Remove ICommand, ICommandQueueHandler and CommandResultPacket 2017-07-14 15:39:49 -04:00
Andrew 143e779bb8 Add Dispose method to ILeanManagement 2017-07-14 12:40:53 -04:00
Andrew c7a00df8f4 Add the ILeanManagement to the LeanEngineSystemHandlers 2017-07-14 12:40:53 -04:00
Andrew 958f2504f6 Initialize ILeanManagement in Lean.Launcher 2017-07-14 12:40:52 -04:00
Andrew e4ebcf6cf3 Created ILeanManagement
ILeanManagement is meant to be a wrapper on the entire Lean engine and allow
command to be sent from ILeanManagement to the rest of Lean.  In addition,
ILeanManagement can act as a hosting environment specific implementation for hosting Leaninstances.
2017-07-14 12:40:52 -04:00
Andrew cd882d58b1 Remove call to Environment.Exit(0) 2017-02-27 12:17:59 -05:00
quant1729 e7ff615fe2 Exploring linux unicode issue 2017-02-09 16:04:27 +08:00
jaredbroad 89f7403e4d Temporary fix while debug Launcher failing to close down cleanly 2017-02-02 10:33:14 -05:00
Andrew a143b62ff4 Add userId to the runtime error packet 2017-01-31 16:41:45 -05:00
quant1729 5d05dd0d4e Turned on unicode support in console app. Nice to have when you print greeks. 2016-11-22 16:18:28 +01:00