Skip to content
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

release 0.6.0 #390

Merged
merged 54 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5f9c730
Display interest rates in percent
joAschauer Apr 4, 2024
de15543
add percent sign to interest rate columns
joAschauer May 13, 2024
7817b50
display efficiency in %
joAschauer May 13, 2024
0a6bc7b
make full load hours input data not editable
joAschauer May 13, 2024
2a014ff
add class that loads FLH from profiles
joAschauer May 14, 2024
c28270a
Merge branch 'develop' into flh_input_data_from_profiles
joAschauer May 14, 2024
7bdc79e
fix incorrect variable reference
joAschauer May 14, 2024
261265e
use `get_data_type_from_input_data` instead lower level functions
joAschauer May 14, 2024
af7bbcf
better handling of simultaneuos file access from multiple opt processes
wingechr May 14, 2024
81d4a7e
set logging back to INFO
wingechr May 14, 2024
af23701
Merge pull request #377 from agoenergy/360-fix-parallel-optimization-…
wingechr May 14, 2024
279e9fb
display flh from profiles in input data
joAschauer May 14, 2024
79218b7
remove wind offshore profiles for Jordan
joAschauer May 14, 2024
0383931
Merge pull request #379 from agoenergy/remove-JOR-wind-offshore
markushal May 15, 2024
ec25ea5
display interest rates in percent in the map
joAschauer May 15, 2024
161044f
Merge branch 'develop' into flh_input_data_from_profiles
markushal May 15, 2024
735ccc5
Merge pull request #378 from agoenergy/flh_input_data_from_profiles
wingechr May 15, 2024
a151bbf
updated api endpoint
wingechr May 15, 2024
61cd3ff
Use buttons instead of tabs and improve performance
joAschauer May 15, 2024
f0905f7
add smoke test for each tab individually
joAschauer May 15, 2024
eb7ccc5
change unit to % in yaxis label of boxplot for interest rate
joAschauer May 15, 2024
03183e1
Merge branch 'develop' into joAschauer/issue261
joAschauer May 15, 2024
66971b2
consider user data in optimization only for parameter set in session …
joAschauer May 15, 2024
f9c1f8d
add info text to optimization tab
markushal May 15, 2024
a577b00
Merge pull request #306 from agoenergy/joAschauer/issue261
markushal May 15, 2024
56895ff
Merge pull request #381 from agoenergy/joAschauer/issue352
markushal May 15, 2024
9cc9cf1
Merge remote-tracking branch 'origin/develop' into 333-improve-optimi…
markushal May 15, 2024
c28b220
add test for res_calc_aggregate_statistics
markushal May 15, 2024
0cb2a2e
calculate curtailment
markushal May 15, 2024
5b7166e
Direct air capture and desalination data presentation
joAschauer May 15, 2024
0451aaa
add option to hide debugging output
markushal May 15, 2024
7bd7d77
move profile plot figure to plot_functions.py
markushal May 15, 2024
de4796d
always show correct unit in modified data list
joAschauer May 15, 2024
eeb9927
move profile figure plots to separate functions.
markushal May 15, 2024
5587a06
restructure optimization tab
markushal May 15, 2024
8390228
in api_data, allow exclusion of user data in flh optimizazion
wingechr May 15, 2024
5b22512
update streamlit and streamlit-antd-components
markushal May 15, 2024
0e0da06
fix that applied data changes by user are only applied to current sel…
wingechr May 15, 2024
24fedc3
re-enable streamlit cache for calculate_results_single
wingechr May 15, 2024
d645e75
Merge branch 'develop' into api-optimize-user-data-optional
wingechr May 15, 2024
e8a38ec
revert calling certain function only for specitic tabs
markushal May 15, 2024
e066248
remove some function calls again
markushal May 15, 2024
7e997ce
Merge branch '386-streamlit-crashes-when-switching-fast-between-tabs-…
markushal May 15, 2024
f14994c
Merge pull request #384 from agoenergy/joAschauer/issue231
markushal May 15, 2024
1330cb7
Merge pull request #383 from agoenergy/joAschauer/issue262
markushal May 15, 2024
a50a062
add info on downloading caches to README
markushal May 15, 2024
a5cd506
add info texts
markushal May 15, 2024
ad8d7c6
remove unwanted info
markushal May 15, 2024
a7cb22c
fomat dataframe
markushal May 15, 2024
2c7ad33
Update md/info_download_model.md
markushal May 16, 2024
09005e3
Merge pull request #388 from agoenergy/333-improve-optimization-tab
markushal May 16, 2024
0c9c31d
always consider user data when retrieving a network
joAschauer May 16, 2024
9a0a869
Merge pull request #382 from agoenergy/api-optimize-user-data-optional
markushal May 16, 2024
955eb5c
Bump version: 0.5.0 → 0.6.0
wingechr May 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.0
current_version = 0.6.0
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
uses: docker/build-push-action@v5
with:
push: true
tags: wingechr/ptx-boa:0.5.0
tags: wingechr/ptx-boa:0.6.0
2 changes: 1 addition & 1 deletion .streamlit/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
font="sans serif"

[logger]
level="WARNING"
level="INFO"

[browser]
gatherUsageStats = false
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.10-slim
LABEL version="0.5.0"
LABEL version="0.6.0"

RUN apt-get update
RUN apt-get install -y git
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ After cloning the repository, create a virtual python environment
in a subdirectory `.env` and activate it:

```bash
$ python -m venv .\.env
$ .env\Scripts\activate.bat
python -m venv .\.env
.env\Scripts\activate.bat
```

Install the necessary dependencies:

```bash
$ python -m pip install --upgrade pip
$ pip install -r requirements-dev.txt
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
```

The code is autoformatted and checked with [pre-commit](https://pre-commit.com/).
Expand All @@ -43,6 +43,13 @@ In order to run the tests locally run [pytest](https://pytest.org) in the root d
pytest
```

### Download optimization cache for local development

````bash
cd ptxboa\cache
scp -r ptxboa2:ptx-boa_offline_optimization/optimization_cache/* .
````

## Release Procedure

- merge all relevant branches into develop
Expand All @@ -61,7 +68,7 @@ pytest
# connect to server
ssh ptxboa
# pull latest image from dockerhub
VERSION=0.5.0
VERSION=0.6.0
docker pull wingechr/ptx-boa:$VERSION
# stop and delete the currently running container "app"
docker stop app
Expand Down
106 changes: 70 additions & 36 deletions app/layout_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,57 @@ def display_footer():
st.image("img/PtX-Hub_Logo_international_612x306.png")


def _form_data_editor(
key,
df,
df_orig,
index,
columns,
missing_index_name,
missing_index_value,
column_config,
):
if f"{key}_number" not in st.session_state:
st.session_state[f"{key}_number"] = 0
editor_key = f"{key}_{st.session_state[f'{key}_number']}"

with st.form(key=f"{key}_form", border=False):
st.info(
(
"You can edit data directly in the table. When done, click the "
"**Apply changes** button below to rerun calculations."
)
)

st.form_submit_button(
"Apply changes",
type="primary",
on_click=register_user_changes,
kwargs={
"missing_index_name": missing_index_name,
"missing_index_value": missing_index_value,
"index": index,
"columns": columns,
"values": "value",
"df_tab": df,
"df_orig": df_orig,
"key": key,
"editor_key": editor_key,
},
)

df = st.data_editor(
df,
use_container_width=True,
key=editor_key,
num_rows="fixed",
disabled=[index],
column_config=column_config,
)

return df


def display_and_edit_input_data(
api: PtxboaAPI,
data_type: Literal[
Expand Down Expand Up @@ -243,9 +294,9 @@ def display_and_edit_input_data(
missing_index_name = "source_region_code"
missing_index_value = None
column_config = {
"CAPEX": st.column_config.NumberColumn(format="%.2e USD/kg", min_value=0),
"CAPEX": st.column_config.NumberColumn(format="%.5f USD/kg", min_value=0),
"OPEX (fix)": st.column_config.NumberColumn(
format="%.2e USD/kg", min_value=0
format="%.5f USD/kg", min_value=0
),
"efficiency": st.column_config.NumberColumn(
format="%.2f", min_value=0, max_value=1
Expand All @@ -263,7 +314,9 @@ def display_and_edit_input_data(
missing_index_name = "parameter_code"
missing_index_value = "interest rate"
column_config = {
c: st.column_config.NumberColumn(format="%.3f", min_value=0, max_value=1)
c: st.column_config.NumberColumn(
format="%.2f %%", min_value=0, max_value=100
)
for c in df.columns
}

Expand Down Expand Up @@ -307,43 +360,24 @@ def display_and_edit_input_data(

# if editing is enabled, store modifications in session_state:
if st.session_state["edit_input_data"]:
if f"{key}_number" not in st.session_state:
st.session_state[f"{key}_number"] = 0
editor_key = f"{key}_{st.session_state[f'{key}_number']}"

with st.form(key=f"{key}_form", border=False):
st.info(
(
"You can edit data directly in the table. When done, click the "
"**Apply changes** button below to rerun calculations."
)
)

st.form_submit_button(
"Apply changes",
type="primary",
on_click=register_user_changes,
kwargs={
"missing_index_name": missing_index_name,
"missing_index_value": missing_index_value,
"index": index,
"columns": columns,
"values": "value",
"df_tab": df,
"df_orig": df_orig,
"key": key,
"editor_key": editor_key,
},
)

df = st.data_editor(
if data_type == "full load hours":
st.info("Full load hours data cannot be modified.")
st.dataframe(
df,
use_container_width=True,
key=editor_key,
num_rows="fixed",
disabled=[index],
column_config=column_config,
)
else:
df = _form_data_editor(
key,
df,
df_orig,
index,
columns,
missing_index_name,
missing_index_value,
column_config,
)

else:
st.dataframe(
Expand Down
Loading
Loading