Skip to content
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

Using argparse for simulator #102

Merged
merged 7 commits into from
Jun 3, 2021

Conversation

bknueven
Copy link
Collaborator

@bknueven bknueven commented Jun 1, 2021

More progress on #93.

argparse interfaces nicely with the Pyomo Config system, which we would like to move towards. The simulator currently utilizes optparse, which was deprecated in Python 3.2

This PR also removes some deprecated or no-longer-supported options from runner scripts.

@bknueven bknueven requested a review from darrylmelander June 1, 2021 17:18
@darrylmelander
Copy link
Collaborator

The plugin code needs to be updated too.

def add_custom_commandline_option(option: Option) -> None:

@bknueven
Copy link
Collaborator Author

bknueven commented Jun 2, 2021

The plugin code needs to be updated too.

def add_custom_commandline_option(option: Option) -> None:

Because argparse doesn't have a class analogous to optparse.Option, I resorted to having this function call the add_argument method directly, just passing along its args and kwargs.

@bknueven
Copy link
Collaborator Author

bknueven commented Jun 2, 2021

As a final sanity check I ran git grep optparse on the top level prescient directory and came back empty.

@darrylmelander darrylmelander merged commit b8f7ec0 into grid-parity-exchange:main Jun 3, 2021
@bknueven bknueven deleted the argparse branch June 7, 2021 20:28
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