Skip to content

Commit cabbd53

Browse files
change copy files to get county level files if it's a github runner test
1 parent 52a1cc2 commit cabbd53

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

input_processing/copy_files.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,36 @@ def write_county_vre_hourly_profiles(inputs_case, reeds_path):
10231023
# tries to get environment variable from github, if it's not found it defaults to False
10241024
github_test = os.getenv("GITHUB_COUNTY_TEST", False)
10251025

1026-
if 'github.nrel.gov' in remote_url:
1026+
if ('github.com' in remote_url) and github_test:
1027+
sc_path = row['sc_path']
1028+
print(f'Copying county-level hourly profiles for {row["tech"]} {row["access_case"]}')
1029+
1030+
shutil.copy(
1031+
os.path.join(reeds_path,'tests','data','county',f'{row["tech"]}.h5'),
1032+
os.path.join(
1033+
reeds_path,'inputs','variability','multi_year',
1034+
f'{row["tech"]}-{access_case}_county.h5')
1035+
)
1036+
# Update the file version information
1037+
condition = (
1038+
(file_version_new['tech'] == row['tech'])
1039+
& (file_version_new['access_case'] == row['access_case'])
1040+
)
1041+
1042+
if condition.any():
1043+
file_version_new.loc[condition, 'file version'] = sc_path.split("/")[-1]
1044+
else:
1045+
newrow = pd.DataFrame(
1046+
data={
1047+
'tech': [row['tech']],
1048+
'access_case': [row['access_case']],
1049+
'file version': [sc_path.split("/")[-1]]
1050+
}
1051+
)
1052+
file_version_new = pd.concat([file_version_new, newrow])
1053+
file_version_updates += 1
1054+
1055+
elif 'github.nrel.gov' in remote_url:
10271056
sc_path = row['sc_path']
10281057
print(f'Copying county-level hourly profiles for {row["tech"]} {row["access_case"]}')
10291058

0 commit comments

Comments
 (0)