Breakthrough-Energy / SwitchWrapper

Wrapper for Switch
MIT License
1 stars 2 forks source link

feat: add function to write modules.txt file #77

Closed danielolsen closed 3 years ago

danielolsen commented 3 years ago

Pull Request doc

Purpose

Add a function to create the modules.txt file which is used to tell Switch which modules to import and use in building the optimization problem. Note: this file is created one level up from the rest of the input files.

What the code is doing

The list of modules contained in the example data is added to const.py, then imported and written as part of the prepare_inputs function.

Testing

Tested manually: the file is created in the expected location, with the expected contents.

Time estimate

2 minutes.

rouille commented 3 years ago

Do we need to import all the modules for every run?

danielolsen commented 3 years ago

Do we need to import all the modules for every run?

It seems that the canonical way to run Switch is via a command-line invocation, and then Switch looks to this file to determine which of its submodules to enable (or not). We are not using all of the Switch modules, and if we tried to use them all, Switch would complain that we don't have some of the required files for the modules that we're not currently preparing input files for.

rouille commented 3 years ago

Do we need to import all the modules for every run?

It seems that the canonical way to run Switch is via a command-line invocation, and then Switch looks to this file to determine which of its submodules to enable (or not). We are not using all of the Switch modules, and if we tried to use them all, Switch would complain that we don't have some of the required files for the modules that we're not currently preparing input files for.

Does this mean that depending on the scenario we want to run we will have to change the list to enable/disable modules?

danielolsen commented 3 years ago

Do we need to import all the modules for every run?

It seems that the canonical way to run Switch is via a command-line invocation, and then Switch looks to this file to determine which of its submodules to enable (or not). We are not using all of the Switch modules, and if we tried to use them all, Switch would complain that we don't have some of the required files for the modules that we're not currently preparing input files for.

Does this mean that depending on the scenario we want to run we will have to change the list to enable/disable modules?

For now, we are planning to run Switch with the same set of modules every time. If later this changes, then we will need a way for the user to specify which modules to run, and we will have to write that list in the module.txt file rather than this hard-coded list.