-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix more conflicts, all tests now pass
- Loading branch information
Showing
25 changed files
with
291 additions
and
180 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2016-2025 Blue Marble Analytics LLC. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" | ||
""" | ||
|
||
import os.path | ||
|
||
|
||
def create_csv_generic( | ||
filename, | ||
df, | ||
overwrite, | ||
): | ||
""" """ | ||
if not os.path.exists(filename) or overwrite: | ||
df.to_csv( | ||
filename, | ||
mode="w", | ||
index=False, | ||
) | ||
else: | ||
raise ValueError( | ||
f"The file {filename} already exists and overwrite has not been " | ||
"indicated." | ||
) |
This file contains 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
36 changes: 36 additions & 0 deletions
36
data_toolkit/project/opchar/var_profiles/common_methods.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2016-2024 Blue Marble Analytics LLC. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os.path | ||
import pandas as pd | ||
|
||
from data_toolkit.common_methods import create_csv_generic | ||
|
||
|
||
def create_iterations_csv( | ||
iterations_directory, project, profile_id, profile_name, overwrite | ||
): | ||
filename = os.path.join( | ||
iterations_directory, | ||
f"{project}-{profile_id}-{profile_name}.csv", | ||
) | ||
|
||
df = pd.DataFrame( | ||
{ | ||
"varies_by_weather_iteration": [1], | ||
"varies_by_hydro_iteration": [0], | ||
} | ||
) | ||
|
||
create_csv_generic(filename=filename, df=df, overwrite=overwrite) |
This file contains 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
This file contains 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
This file contains 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
4 changes: 2 additions & 2 deletions
4
..._test_examples/project/project_availability/weather/iterations/Batteries-1-ra_toolkit.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
0,0 | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
4 changes: 2 additions & 2 deletions
4
db/csvs_test_examples/project/project_availability/weather/iterations/Gas-1-ra_toolkit.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
4 changes: 2 additions & 2 deletions
4
...svs_test_examples/project/project_availability/weather/iterations/Hybrid-1-ra_toolkit.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
0,0 | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
4 changes: 2 additions & 2 deletions
4
...t_examples/project/project_variable_generator_profiles/iterations/Hybrid-3-ra_toolkit.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
4 changes: 2 additions & 2 deletions
4
...st_examples/project/project_variable_generator_profiles/iterations/Solar-3-ra_toolkit.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
2 changes: 2 additions & 0 deletions
2
...amples/project/project_variable_generator_profiles/iterations/Solar_Zone1-1-open_data.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
2 changes: 2 additions & 0 deletions
2
...amples/project/project_variable_generator_profiles/iterations/Solar_Zone2-1-open_data.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
4 changes: 2 additions & 2 deletions
4
...est_examples/project/project_variable_generator_profiles/iterations/Wind-3-ra_toolkit.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
2 changes: 2 additions & 0 deletions
2
...xamples/project/project_variable_generator_profiles/iterations/Wind_Zone1-1-open_data.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
2 changes: 2 additions & 0 deletions
2
...xamples/project/project_variable_generator_profiles/iterations/Wind_Zone2-1-open_data.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
varies_by_weather_iteration,varies_by_hydro_iteration | ||
1,0 |
This file contains 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
3 changes: 3 additions & 0 deletions
3
...es/open_data/weather_iteration_2010/hydro_iteration_2010/1/inputs/load_level_defaults.tab
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
load_zone load_component load_level_default | ||
Zone1 all . | ||
Zone2 all . |
98 changes: 49 additions & 49 deletions
98
examples/open_data/weather_iteration_2010/hydro_iteration_2010/1/inputs/load_mw.tab
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
LOAD_ZONES timepoint load_mw | ||
Zone1 1 9001.0 | ||
Zone1 2 8454.0 | ||
Zone1 3 8074.0 | ||
Zone1 4 7818.0 | ||
Zone1 5 7767.0 | ||
Zone1 6 7942.0 | ||
Zone1 7 8233.0 | ||
Zone1 8 8288.0 | ||
Zone1 9 7940.0 | ||
Zone1 10 7733.0 | ||
Zone1 11 7640.0 | ||
Zone1 12 7556.0 | ||
Zone1 13 7736.0 | ||
Zone1 14 8081.0 | ||
Zone1 15 8544.0 | ||
Zone1 16 9165.0 | ||
Zone1 17 10237.0 | ||
Zone1 18 11004.0 | ||
Zone1 19 10793.0 | ||
Zone1 20 10686.0 | ||
Zone1 21 10485.0 | ||
Zone1 22 10106.0 | ||
Zone1 23 9468.0 | ||
Zone1 24 8839.0 | ||
Zone2 1 9001.0 | ||
Zone2 2 8454.0 | ||
Zone2 3 8074.0 | ||
Zone2 4 7818.0 | ||
Zone2 5 7767.0 | ||
Zone2 6 7942.0 | ||
Zone2 7 8233.0 | ||
Zone2 8 8288.0 | ||
Zone2 9 7940.0 | ||
Zone2 10 7733.0 | ||
Zone2 11 7640.0 | ||
Zone2 12 7556.0 | ||
Zone2 13 7736.0 | ||
Zone2 14 8081.0 | ||
Zone2 15 8544.0 | ||
Zone2 16 9165.0 | ||
Zone2 17 10237.0 | ||
Zone2 18 11004.0 | ||
Zone2 19 10793.0 | ||
Zone2 20 10686.0 | ||
Zone2 21 10485.0 | ||
Zone2 22 10106.0 | ||
Zone2 23 9468.0 | ||
Zone2 24 8839.0 | ||
LOAD_ZONES timepoint load_component load_mw | ||
Zone1 1 all 9001.0 | ||
Zone1 2 all 8454.0 | ||
Zone1 3 all 8074.0 | ||
Zone1 4 all 7818.0 | ||
Zone1 5 all 7767.0 | ||
Zone1 6 all 7942.0 | ||
Zone1 7 all 8233.0 | ||
Zone1 8 all 8288.0 | ||
Zone1 9 all 7940.0 | ||
Zone1 10 all 7733.0 | ||
Zone1 11 all 7640.0 | ||
Zone1 12 all 7556.0 | ||
Zone1 13 all 7736.0 | ||
Zone1 14 all 8081.0 | ||
Zone1 15 all 8544.0 | ||
Zone1 16 all 9165.0 | ||
Zone1 17 all 10237.0 | ||
Zone1 18 all 11004.0 | ||
Zone1 19 all 10793.0 | ||
Zone1 20 all 10686.0 | ||
Zone1 21 all 10485.0 | ||
Zone1 22 all 10106.0 | ||
Zone1 23 all 9468.0 | ||
Zone1 24 all 8839.0 | ||
Zone2 1 all 9001.0 | ||
Zone2 2 all 8454.0 | ||
Zone2 3 all 8074.0 | ||
Zone2 4 all 7818.0 | ||
Zone2 5 all 7767.0 | ||
Zone2 6 all 7942.0 | ||
Zone2 7 all 8233.0 | ||
Zone2 8 all 8288.0 | ||
Zone2 9 all 7940.0 | ||
Zone2 10 all 7733.0 | ||
Zone2 11 all 7640.0 | ||
Zone2 12 all 7556.0 | ||
Zone2 13 all 7736.0 | ||
Zone2 14 all 8081.0 | ||
Zone2 15 all 8544.0 | ||
Zone2 16 all 9165.0 | ||
Zone2 17 all 10237.0 | ||
Zone2 18 all 11004.0 | ||
Zone2 19 all 10793.0 | ||
Zone2 20 all 10686.0 | ||
Zone2 21 all 10485.0 | ||
Zone2 22 all 10106.0 | ||
Zone2 23 all 9468.0 | ||
Zone2 24 all 8839.0 |
Oops, something went wrong.