Replace main.py with self contained modules - #4
Draft
adam-sedlak wants to merge 281 commits into
Draft
Conversation
…es too. Pending pull request.
feat: add more info about extra components added in run_capex.
…hod to_timeseries in dynamical variables. feat: printing of csv files containing states when emt and ssm simulation are executed. fix: add csv files of emt simulation and ssm simultion to gitignore.
fix: switching_load.py
… new components (dc_circuit_1a - parallel capacitor and resistor, dc_voltage_controller_1a - PI controller of i_ref_d based on v_dc imbalance)
Ruth is adding inverters models using DC-link.
fix: remove folders and files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As is, all modules feed into a single
main.pyscript. This however introduces many inter module dependencies through the imports inmain.py. Furthermore, this may not be the most intuitive user-interface as a single run script offers users less behind the scenes control (i.e., one run script does many different actions, reading, writing CSVs, running models, etc.) that are obscured from the user.Can we replace main.py scripts with module specific methods?
In this manner we would transition to a UI closer to something that of sklearn where each module has predictable well defined methods---such as
.train()and.predict(). However how to best do this is an open question. Many modules are related to one another (ACOPF --> SSM --> MOR) and need well defined interfaces to pass data between one another. Additionally some main scripts are across modules. And not all modules share the same methods. A few ideas for how to structure this are.run(),.write_csv(), andsimulate()that accept a system object in their arguments.pipe = Pipeline([ACOPF, SSM, EMT]); pipe.run(). If we can do this in a clean modular way I think it may have potential.One optional point to consider in this refactor is if we should change some of the import paths to be more user friendly/shorter.