-
Notifications
You must be signed in to change notification settings - Fork 30
Reorganize ecm_prep.py #473
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
base: master
Are you sure you want to change the base?
Conversation
d12e4c2
to
d217f1e
Compare
295bcab
to
d244b6f
Compare
@@ -5455,12 +5452,12 @@ def main(opts: argparse.NameSpace): # noqa: F821 | |||
try: | |||
elec_carb = elec_cost_carb['CO2 intensity of electricity']['data'] | |||
elec_cost = elec_cost_carb['End-use electricity price']['data'] | |||
fmt = True # Boolean for indicating data key substructure | |||
format_data = True # Boolean for indicating data key substructure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable fmt
conflicted with the imported class fmt
@classmethod | ||
def load_json(cls, filepath: Path) -> dict: | ||
"""Loads data from a .json file | ||
class ECMUtils: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is similar to ECMPrep
, but ECMPrep
is meant to store methods that update Measure
and MeasurePackage
instances. It might make sense to merge the two since they both contain common static methods used throughout the module.
Fixes #438
Improve encapsulation of ecm_prep.py by breaking out code into other modules. Only the
main()
function in ecm_prep.py exists outside of a class now. Below is a summary of changes.JsonIO
containing json file handling methods previously in ecm_prep.UtilsMyEncoder
that was previously stored in ecm_prep.pyPrintFormat
containing output format methods previously stored in ecm_prep.py (eg, verboseprint())PrintFormat.verboseprint
in ecm_prep.py and in run.pyUsefulVars
previously in ecm_prep.pyUsefulInputFiles
previously in ecm_prep.pyEPlusMapDicts
previously in ecm_prep.pyECMUtils
class in ecm_prep.py to store static methodsECMPrep
class in ecm_prep.py to store static methods for altering Measure and MeasurePackage instancesprepare_measures()
,prepare_packages()
, andsplit_clean_data()
EPlusGlobals
class and associated testsbreakout_mseg()
to an instance method of the Measure classTo-do in a future PR
scout/ecm_prep/
which contains:ecm_prep.Utils
Measure
Package
scout ecm_prep
that calls scout/ecm_prep/ecm_prep.py`