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

Adapt to new prescient plugin system #2

Merged
merged 7 commits into from
Aug 26, 2021

Conversation

xiangao1
Copy link
Owner

Changes in coordinator.py:

  1. Register the customized command-line options using Prescient's new plugin system.
  2. Register the callback functions using Prescient's new plugin system.

Changes in thermal_generator_prescient_plugin.py:

  1. Demonstrate an example with the new plugin system.

@xiangao1 xiangao1 requested a review from bknueven August 24, 2021 22:16
@xiangao1 xiangao1 self-assigned this Aug 24, 2021
@xiangao1 xiangao1 mentioned this pull request Aug 24, 2021
description = 'Specifies the generator we derive bidding strategis for.',
default = None)).declare_as_argument(f'--{key}.bidding-generator')
## How to access this option?
# options.plugin.{key}.bidding_generator
Copy link
Collaborator

Choose a reason for hiding this comment

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

plugin_config.bidding_generator -- I would refactor this class slightly and store the plugin_config passed into register_plugins somewhere. You probably also don't need the _register_*_callbacks methods anymore.

The declare_as_argument method just has to do with how the command line option is created. Using the key in the name is optional.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks Ben! I just pushed a small change to store the plugin_config as a property. I think I should get rid of the bidding_generator option, because the coordinator should get this information from both bidder and tracker.

The _register_*_callbacks methods make it a little easier for me to manage the plugin functions, in case we have more than one callbacks at some plugin points.

@bknueven
Copy link
Collaborator

Note that large Prescient PR also enabled one to run Prescient directly from Python, see: https://github.com/grid-parity-exchange/Prescient/blob/06c8b1d9416baf1ef85cfa880935674db25487cd/tests/simulator_tests/test_sim_rts_mod.py#L138-L198.

So it's possible to create an overall "driver" which runs Prescient along with the configured classes.

@xiangao1
Copy link
Owner Author

Note that large Prescient PR also enabled one to run Prescient directly from Python, see: https://github.com/grid-parity-exchange/Prescient/blob/06c8b1d9416baf1ef85cfa880935674db25487cd/tests/simulator_tests/test_sim_rts_mod.py#L138-L198.

So it's possible to create an overall "driver" which runs Prescient along with the configured classes.

Now my example uses the Python API.

@bknueven
Copy link
Collaborator

Now my example uses the Python API.

Excellent! Related, though I'm not sure when/where you want to include it, is the new shortcut simulator: grid-parity-exchange/Prescient#113, which just needs a single generator and two LMP time series (one for DA, and another for RT).

@xiangao1
Copy link
Owner Author

Now my example uses the Python API.

Excellent! Related, though I'm not sure when/where you want to include it, is the new shortcut simulator: grid-parity-exchange/Prescient#113, which just needs a single generator and two LMP time series (one for DA, and another for RT).

Perfect! I'll have to talk to @adowling2 and @nicolepcortes about the shortcut simulator.

@adowling2
Copy link
Collaborator

@bknueven, thanks for the update. @nicolepcortes will reach out to you about the shortcut simulator soon.

@xiangao1 xiangao1 merged commit 93a83c6 into generalize-objects Aug 26, 2021
xiangao1 pushed a commit that referenced this pull request Apr 4, 2022
Avoid using `index()` when identifying differential variables in Petsc
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.

3 participants