Skip to content

Commit

Permalink
fixing hard-coded path to arbitrary path
Browse files Browse the repository at this point in the history
  • Loading branch information
ebalogun01 committed Dec 18, 2023
1 parent 4fb62e2 commit 8d25f41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions test_cases/battery/IEEE123_secondary.glm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ object load {
object transformer {
name dcfc_trans_0;
phases "ABCN";
from "meter_87";
from "meter_77";
to dcfc_load_0;
configuration dcfc_transformer;
}
Expand All @@ -69,7 +69,7 @@ object load {
object transformer {
name dcfc_trans_1;
phases "ABCN";
from "meter_48";
from "meter_98";
to dcfc_load_1;
configuration dcfc_transformer;
}
Expand All @@ -86,8 +86,8 @@ object load {

object transformer {
name dcfc_trans_2;
phases "ABC";
from "meter_64";
phases "ABCN";
from "meter_82";
to dcfc_load_2;
configuration dcfc_transformer;
}
Expand All @@ -105,7 +105,7 @@ object load {
object transformer {
name dcfc_trans_3;
phases "ABCN";
from "meter_95";
from "meter_79";
to dcfc_load_3;
configuration dcfc_transformer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ def run():
"""
path_prefix = os.getcwd()
os.chdir(path_prefix) # change directory
path_prefix = path_prefix[0:path_prefix.index('EV50_cosimulation')] + 'EV50_cosimulation'
path_prefix.replace('\\', '/')
path_prefix = "\\".join(path_prefix.split('\\')[:-3]) # Gets absolute path to the root of the project to get the desired files.

f = open('config.txt', 'r')
param_dict = f.read()
Expand Down Expand Up @@ -262,9 +261,13 @@ def run():

# % load residential load data
os.chdir(load_data_dir)
data_use = pandas.read_csv('data_2015_use.csv')

year = 2018
# Check if current directory is empty
if len(os.listdir(os.getcwd())) == 0:
raise FileNotFoundError('No data files in directory: ', os.getcwd(), 'Please check the directory to '
'ensure data file exists.')
return
data_use = pandas.read_csv('data_use.csv')
year = 2018 # NOTE: Make sure the year matches your data year or else the timestamps will be wrong and may throw erros.

timestamp_list = [[] for k in range(len(data_use.month))]
for i in range(len(timestamp_list)):
Expand Down

0 comments on commit 8d25f41

Please sign in to comment.