Skip to content

Fix broken --config command-line argument#2251

Merged
Martin-Molinero merged 2 commits into
QuantConnect:masterfrom
mblouin02:bug-2249-fix-config-file-argument-not-working
Jul 16, 2018
Merged

Fix broken --config command-line argument#2251
Martin-Molinero merged 2 commits into
QuantConnect:masterfrom
mblouin02:bug-2249-fix-config-file-argument-not-working

Conversation

@mblouin02
Copy link
Copy Markdown
Contributor

Description

Reset the configuration settings at the beginning of program
execution, so that, when passing a custom --config argument
to the program, values from that file are read instead of the
default config file.

Related Issue

#2249

Motivation and Context

Config file argument was not used in the program.

How Has This Been Tested?

Reproduced the steps 1-7 described in #2249, and confirmed that the value is now correctly read.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • [N/A] I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description or feature-<issue#>-<description>

Reset the configuration settings at the beginning of program
execution, so that, when passing a custom --config argument
to the program, values from that file are read instead of the
default config file.
@Martin-Molinero
Copy link
Copy Markdown
Member

Hi @mblouin02!
Thank you for the issue and PR. Let me suggest a minor change. I believe it would be better to move the Reset() call inside the if statement at https://github.com/QuantConnect/Lean/blob/master/Configuration/Config.cs#L57. That way, if another command line argument is send along with the --config it will also be taken into account.

Adressing Martin Molinero's comment from this pull request:
QuantConnect#2251 (comment)
@mblouin02
Copy link
Copy Markdown
Contributor Author

Hi @Martin-Molinero,

I did the change that you recommended. Feel free to comment.

Copy link
Copy Markdown
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@Martin-Molinero Martin-Molinero merged commit 4776dab into QuantConnect:master Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants