Skip to content

Commit

Permalink
chore: add data folder within demo and adjust paths accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
dmuldrew authored and rouille committed Apr 8, 2020
1 parent 635870e commit 0b6a794
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion powersimdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__all__ = ['input', 'output', 'scenario','scaling']
__all__ = ['design','input', 'output', 'scenario']
2 changes: 1 addition & 1 deletion powersimdata/design/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__all__ = []
__all__ = ['demo','tests']
8 changes: 4 additions & 4 deletions powersimdata/design/clean_capacity_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def load_target_from_json(target_name):
"""
json_file = open(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"save_files",
"demo", "data", "save_files",
target_name+".json"), "r")
target_obj = jsonpickle.decode(json_file.read())
json_file.close()
Expand All @@ -106,7 +106,7 @@ def load_target_from_pickle(target_name):
"""
json_file = open(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"save_files", target_name+".pkl"),
"demo", "data", "save_files", target_name+".pkl"),
"rb")
target_obj = pickle.load(json_file)
json_file.close()
Expand Down Expand Up @@ -620,7 +620,7 @@ def save_target_as_json(self):
print(os.getcwd())
json_file = open(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"save_files",
"demo", "data", "save_files",
self.region_name+".json"), "w")
obj_json = json.dumps(json.loads(jsonpickle.encode(self)), indent=4,
sort_keys=True)
Expand All @@ -634,7 +634,7 @@ def save_target_as_pickle(self):
print(os.getcwd())
json_file = open(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"save_files",
"demo", "data", "save_files",
self.region_name+".pkl"), "wb")
pickle.dump(self, json_file)
json_file.close()
Expand Down
1 change: 1 addition & 0 deletions powersimdata/design/demo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__all__ = ['data']
Empty file.
File renamed without changes.

0 comments on commit 0b6a794

Please sign in to comment.