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

Dev hc #35

Closed
wants to merge 314 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
8848f39
func load_previous_data added
Mar 18, 2023
c416ca9
celery task queue implemented
Mar 23, 2023
ca16e8d
bug fixed when using pyomo with celery
Mar 23, 2023
d661504
show loading page during calculation, redirect to results page after …
Mar 24, 2023
f8114b1
fowarded proxy header
Mar 27, 2023
df20a92
gunicorn: allow forwarded headers
Mar 27, 2023
5dae15a
limit number of days for simulation
Mar 27, 2023
8e68252
store db-data outside of container
Mar 27, 2023
a3b4f66
investigate the causes of login failure and provide feedback
Mar 27, 2023
62ff2a1
extend the expiration time of the access token if remember_me checkbo…
Mar 27, 2023
da90f5c
href removed from wizard elements
Mar 27, 2023
69cfcc1
option to delete projects added
Mar 27, 2023
127be27
style of confirm box adjusted
Mar 28, 2023
48fea8c
show users status of their celery task
Mar 28, 2023
2e1b053
option added to revoke celery tasks
Mar 28, 2023
a1a7f8a
check if user has pending calculations before new ones can be started
Mar 29, 2023
f9ec675
Show results button in projects overview; Inform about pending calcul…
Mar 29, 2023
ae52938
bug fix map loading
Mar 30, 2023
f07af21
clear all nodes from map without calling function read_database
Mar 30, 2023
e539190
Creation of anonymous user accounts for test users, which are automat…
Mar 30, 2023
48f3a18
fixed bug: plots.js was not loaded
Mar 30, 2023
2c28de3
bug fix: incorrect html id of dashboard element
Mar 30, 2023
45dcf04
show model status in projects overview
Mar 31, 2023
a851182
The number of consumers that can be selected on the card is now limited
Mar 31, 2023
0de678b
cursor with wait symbol while adding consumer to map
Mar 31, 2023
dcd6253
Added toggle switch to 'calculating' page: the user can choose to rec…
Apr 3, 2023
1f7e3fb
same font color for all forward buttons
Apr 3, 2023
10ee817
same font color for all 'previous' buttons
Apr 3, 2023
aeb3c0e
page 'account overview' added with the option to change the registere…
Apr 3, 2023
026befd
users can change their password
Apr 4, 2023
df67023
users can delte their accounts
Apr 4, 2023
a84fbe1
request cookie consent
Apr 4, 2023
df325b9
avoiding redirects
Apr 4, 2023
7dbee15
footer unified
Apr 5, 2023
24c38ea
user registration in modal form instead of separate page
Apr 5, 2023
1ff565d
users can reset forgotten pw
Apr 5, 2023
9006fdc
imprint added (german and english)
Apr 6, 2023
19b574e
imprint added (german and english)
Apr 6, 2023
2c2bfdd
privacy protection statement added (german and english)
Apr 6, 2023
753d95a
footer adjusted for legal notes pages
Apr 6, 2023
4515f2f
remove unnecessary files
Apr 6, 2023
d6952ca
Welcome-text adopted
Apr 6, 2023
4e31ddd
remove drawn boundaries from map when clicking trash bin symbol
Apr 7, 2023
580adf3
bug fixed: drawn lines on the map are no longer displayed incorrectly…
Apr 7, 2023
0c60359
more detailed status messages
Apr 7, 2023
041ef9f
adminer added
Apr 7, 2023
1576720
captcha added
Apr 10, 2023
5b4e5df
ackee analytics added
Apr 11, 2023
8301d6f
ackee analytics added
Apr 12, 2023
37b58c7
bug fix: account activation not working
Apr 12, 2023
af95192
duplicate code removed
Apr 12, 2023
d4e3f66
hide account options for anonymous users
Apr 12, 2023
fcf8361
different execution when code is dockerized
Apr 12, 2023
cf8bf04
different execution if code is dockerized
Apr 12, 2023
2d60bda
show wait symbol while waiting for db
Apr 12, 2023
18746a3
ackee config file changed so it can handle docker-secrets
Apr 13, 2023
c80e112
ackee and mongo setup
Apr 13, 2023
fd8ead6
prevent unnecessary database operations: store map elements in the fr…
Apr 15, 2023
ceb5279
prevent unnecessary database operations: store map elements in the fr…
Apr 15, 2023
b2ac34e
restructuring js code
Apr 15, 2023
b1b49de
db_links_to_js: use fetch instead of ajax/XMLHttpRequest and log errors
Apr 15, 2023
e78ab56
add_buildings_inside_boundary: use fetch instead of ajax/XMLHttpReque…
Apr 15, 2023
688f5a4
code restructuring and speed up building detection by using built-in …
Apr 19, 2023
04d8500
check if duplicated consumers exist
Apr 19, 2023
d1de8dc
process of consumer selection through map drawing tools completely re…
Apr 20, 2023
254ea7c
js code for the map on the results page has been replaced
Apr 20, 2023
17624aa
bug fix: only calculate surface area if mor the to coordinates are given
Apr 20, 2023
f990cf1
limit the resource consumption of celery workers
Apr 21, 2023
df099db
Consider the case that no buildings can be identified in the selected…
Apr 25, 2023
877f1cd
Consider the case that no buildings can be identified in the selected…
Apr 25, 2023
37cfa5a
remove action command
Apr 25, 2023
2ce190e
Activate Conda environment with Python 3.9
Apr 25, 2023
0708911
new page "consumer_types" added
May 3, 2023
dc48b9d
"consumer_types" added
May 4, 2023
8e361ae
consumer details are obtained from the frontend and saved in the data…
May 4, 2023
5d39ad3
change marker position on map if lat, lng-input forms are changed
May 4, 2023
3e28953
bug fix: methods for voltage drop calculation used outdated attributes
May 4, 2023
0f8eeee
consumer type added
May 4, 2023
2f8672f
save user input before switching to previous page
May 4, 2023
17a8775
show max voltage drop on results page
May 4, 2023
834f6ba
save/load shs selection (allow/disallow)
May 4, 2023
4457da6
Determine the direction of the connection lines and parent poles
May 8, 2023
1b62ecf
minor changes
May 8, 2023
a3b776f
deactivation of the determination of the building base area
May 8, 2023
04b39d1
center results dashboard
May 8, 2023
81b9846
additional functionality to specify consumers
May 11, 2023
f2ab0c2
unified database functions
May 11, 2023
3c28700
unified database functions
May 11, 2023
d66a3b9
pydantic and db models separated
May 11, 2023
68054fc
download results as xlsx
May 17, 2023
4a2f0f6
rearrange plots
May 17, 2023
7c94eaa
reduce the decimal places of the parameters
May 17, 2023
e92ec47
rectifier disabled by default
May 17, 2023
b4f2882
if pv or battery is selected, inverter must also be selected
May 17, 2023
5c4df8d
calculate dc feed-in from pv using era5 data
May 18, 2023
2127c24
create weather db on start up if not exists
May 19, 2023
0abdc9d
solar potential as f(lat, lon)
May 22, 2023
4ac77fb
advanced options for consumers: add custom load
May 23, 2023
f4fea80
satellite layer added
May 24, 2023
536e87b
Additional infos on homepage
May 25, 2023
80ebfda
Additional infos on homepage
May 25, 2023
5d724e8
log in via modal
May 25, 2023
05889e4
ensure editing rights for DB data
May 31, 2023
6d071dc
install specific package without user dependencies
May 31, 2023
25c6dc5
remove anchor-links from buttons
May 31, 2023
b0f5c9d
get db_name from config-file
May 31, 2023
263183d
dropdown menus adopted
May 31, 2023
1cf1f6c
minor changes
May 31, 2023
9e2b917
pictogram edited
May 31, 2023
f1cbe93
logos on homepage
May 31, 2023
0613cd9
form submission calls func instead of page refresh
May 31, 2023
fe4aeb4
color structuring of areas of the homepage
May 31, 2023
2c7fc0c
text on homepage adjusted
Jun 1, 2023
283845f
redirect on error
Jun 1, 2023
b002525
error logger added
Jun 1, 2023
3a50d86
error traceback added
Jun 1, 2023
21e66f1
domain changed
Jun 1, 2023
a780e9a
loading and scroll effects added
Jun 1, 2023
f9174ff
loading and scroll effects added
Jun 1, 2023
ef00b47
module added for queries of demand tool
Jun 2, 2023
caf4969
msgbox for warnings added
Jun 4, 2023
90b306f
default start date changed
Jun 4, 2023
adf2f0c
text rephrased
Jun 4, 2023
82e31a1
different celery worker for milp and spatial opt (to meet gurobi lice…
Jun 5, 2023
c28ef2f
new "queries_demand.py" with full and dummy functions - also with exa…
GregoryIreland Jun 5, 2023
7170b71
more efficient search algorithm for determining the minimum number of…
Jun 6, 2023
fa86337
async db session maker implementation changed
Jun 6, 2023
7cc5222
voltage drop ignored above threshold
Jun 6, 2023
da8fc0e
no more async funcs declared as celery tasks
Jun 6, 2023
fa0c4fa
query uid and gid from host system
Jun 7, 2023
acd2d44
db connections error handling (retry, create new engine)
Jun 7, 2023
385040b
increase number of allowed mysql conenctions
Jun 7, 2023
e77a3ad
log optimization model errors
Jun 7, 2023
740d336
minor changes
Jun 7, 2023
6dcfb57
warning if location is outside nigeria
Jun 8, 2023
18d4ee9
text rephrased
Jun 8, 2023
14c9a9d
problem with manually added consumers fixed
Jun 8, 2023
2a73b85
warning msg if no consumers are selected
Jun 8, 2023
6efa224
minor changes
Jun 8, 2023
effde82
minor changes
Jun 9, 2023
545ffa2
node data integration in demand estimation tool
Jun 9, 2023
a533e74
Directly added with GitHub file upload tool
GregoryIreland Jun 9, 2023
70e8a73
Update .gitignore to exclude wp3 folder in data folder
GregoryIreland Jun 9, 2023
764b67e
Update .gitignore
GregoryIreland Jun 9, 2023
90c0bf7
Update .gitignore
GregoryIreland Jun 9, 2023
9a252c6
Update .gitignore
GregoryIreland Jun 9, 2023
92b5a89
Fixed .gitignore to allow "/data/wp3/" folder. Removed files from /da…
GregoryIreland Jun 9, 2023
525a87f
demand estimation page added with all needed js and fastapi funcs
Jun 9, 2023
c828826
Merge remote-tracking branch 'origin/dev_hc' into dev_hc
Jun 9, 2023
c5110d3
demand estimation page added with all needed js and fastapi funcs
Jun 9, 2023
a363bad
queries_demand integrated
Jun 9, 2023
8896453
queries_demand integrated
Jun 10, 2023
081e44b
queries_demand integrated
Jun 10, 2023
be69ab3
queries_demand integrated
Jun 11, 2023
5bfec82
Updated to latest demand profiles corresponding to presentation
GregoryIreland Jun 12, 2023
6a49c29
typo
Jun 13, 2023
475edef
save and load selection of energy_system_design
Jun 14, 2023
43abb41
change password bug fix
Jun 14, 2023
fc8fec5
if _get_user_from_token does not work user get_user_from_task_id
Jun 14, 2023
ce22e2f
surface area, peak demand and average consumption of nodes removed
Jun 14, 2023
2192101
drawMarker stays enabled after a marker was manually put on the map
Jun 15, 2023
d982b54
different marker colors for household, enterprises and public_services
Jun 15, 2023
72cd97c
show shs icon if user selects shs_options equal shs
Jun 16, 2023
4202fd7
storage and reload of large load selection
Jun 16, 2023
afeaa19
renew expiring tokens
Jun 16, 2023
8428672
oemof.solph 0.5.0 adaptions
Jun 16, 2023
141ea28
diesel engine with min_load added
Jun 16, 2023
15eedc0
unused methods removed
Jun 17, 2023
9ec9648
poles allocated to branches
Jun 17, 2023
213e566
shs implemented
Jun 21, 2023
600bf67
legend added to map
Jun 21, 2023
1a7d708
replace nodes and links after grid optimization
Jun 21, 2023
5b68b21
relocate power house after shs exec
Jun 23, 2023
f6a2994
power-house position can be selected manually
Jun 27, 2023
cfaa0ec
map drawing tools adopted
Jun 27, 2023
00a49c2
only show power-house marker on map during consumer selection if adde…
Jun 27, 2023
5aeec10
determine power-house position again after shs determination
Jun 27, 2023
df2ddf7
avoid division by zero
Jun 27, 2023
fd973c1
front-end and db implementation of shs
Jun 27, 2023
b43fd9d
mail error logger
Jun 28, 2023
6add83f
celery options
Jun 28, 2023
a9a33b1
marker specification unified
Jun 28, 2023
9e672c5
energy flow plot with second y-axis
Jul 2, 2023
addca06
energy flow plot with second y-axis
Jul 2, 2023
ab06da7
dealing with the case that no enterprise is selected
Jul 2, 2023
44141bb
restructure code of optimization model
Jul 2, 2023
66f50aa
warning if no diesel generator is selected
Jul 7, 2023
200a9fc
handle infeasible error
Jul 7, 2023
407407b
warning if there is no feasible solution
Jul 7, 2023
93d7251
remove power house if no links left
Jul 7, 2023
1560192
warning if no grid consumers left
Jul 7, 2023
444e0f7
different colors for bars with unit kw and kwh
Jul 7, 2023
3c23b55
minor changes
Jul 12, 2023
2a2f339
explanations added to each parameter input field
Jul 14, 2023
190c762
save and restore selection of consumer categories
Jul 19, 2023
ebd20dd
dummy plot integrated for demand estimation plot
Jul 19, 2023
6b26a51
Fixed error in saving data when using the Firefox browser
Jul 25, 2023
163be7a
minor changes
Jul 25, 2023
af404a1
load previous data on demand estimation page
Jul 26, 2023
1516821
avoiding overlapping in sankey diagram
Jul 26, 2023
6fbf819
redundant drawing elements removed
Jul 26, 2023
befe385
integrate dummy instruction video
Jul 26, 2023
845ad23
don't show video tutorial again option added
Jul 27, 2023
542e361
avoid captcha error by specifying pillow version
Jul 27, 2023
7fa8ac7
avoid captcha error by specifying pillow version
Jul 27, 2023
c2d5f8f
avoid captcha error by specifying pillow version
Jul 27, 2023
d3c4f22
additional parameters on results page
Jul 30, 2023
689ea40
downgrade of python and package number to avoid conflicts
Jul 30, 2023
1d73f4c
check border color of shortage chart after loading previous data
Jul 30, 2023
9d3e19c
map legend distinguishes between load center and power house
Jul 31, 2023
9ed84d1
map legend distinguishes between load center and power house
Jul 31, 2023
13b62a5
check link types if power house set manually
Jul 31, 2023
e88bae5
reduce db queries for plots
Jul 31, 2023
2d4c319
change status of model on failure
Jul 31, 2023
bacd9a0
h-orientation of bar chart
Aug 1, 2023
b1ee973
contact form implemented and new mail address added
Aug 2, 2023
472d736
contact form implemented and new mail address added
Aug 2, 2023
c752464
contact form implemented and new mail address added
Aug 2, 2023
e6cfdb1
contact form implemented and new mail address added
Aug 2, 2023
456efed
integration of href and save-funcs in wizard
Aug 2, 2023
da10773
data availability is checked before calculation is started
Aug 2, 2023
e9689f6
data availability is checked before calculation is started
Aug 2, 2023
dab86f5
min and max simulation time adjusted
Aug 3, 2023
4877ffc
question mark hoover effect adjusted
Aug 3, 2023
f6f065d
if results are missing, start calc on request
Aug 3, 2023
f7fb43b
recalculate option added
Aug 4, 2023
ad5fc18
download excel
Aug 4, 2023
06fd31c
add links to logos
Aug 4, 2023
6312e74
timeseries stored in db as json
Aug 4, 2023
b204ad2
style changes
Aug 7, 2023
fc7d399
tutorial video added
Aug 8, 2023
0865331
citation added
Aug 9, 2023
63308e7
show number of selected consumers
Aug 9, 2023
1af44fc
explanation for parameter added
Aug 9, 2023
4c7519f
turial video added
Aug 9, 2023
287a76e
turial video added
Aug 9, 2023
5650183
create an example project for each user
Aug 10, 2023
9dbf9a4
create an example project for each user
Aug 10, 2023
c90218d
nodes stored in json format
Aug 10, 2023
6690d4e
links stored in json format
Aug 10, 2023
a499623
modal style changed
Aug 10, 2023
21cdf1b
minor changes
Aug 10, 2023
64f2adb
minor changes
Aug 11, 2023
ebd4589
ajax replaced by fetch
Aug 11, 2023
784d946
ajax replaced by fetch
Aug 11, 2023
b96c16f
ajax replaced by fetch
Aug 11, 2023
7a205d4
location search option modified
Aug 11, 2023
a1035c5
load results bug when running in docker fixed
Aug 11, 2023
67867de
formatting excel result file
Aug 11, 2023
57c3699
bug fix for counter "number of selected consumers"
Sep 7, 2023
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
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
*.db
run
venv/
.secrets/
*secret*
*.DS_Store
data
/fastapi_app/data/*
!/fastapi_app/data/wp3/
scratch.py
fastapi_app/io/db/dev_config.py
/.db_data/
47 changes: 0 additions & 47 deletions CHANGELOG.md

This file was deleted.

170 changes: 0 additions & 170 deletions CONTRIBUTING.md

This file was deleted.

16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM continuumio/miniconda3
WORKDIR /src
RUN apt-get update -q \
&& apt-get install --no-install-recommends -qy g++ gcc inetutils-ping coinor-cbc\
&& rm -rf /var/lib/apt/lists/*
RUN conda update -n base -c defaults conda
RUN conda create -n py38 python=3.8 pip
RUN echo "source activate py38" > ~/.bashrc
ENV PATH /opt/conda/envs/py38/bin:$PATH
COPY requirements.txt .
COPY no_deps_requirements.txt .
RUN pip install --upgrade pip || true
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-deps --no-cache-dir -r no_deps_requirements.txt
RUN conda config --set channel_priority false
COPY . .
5 changes: 5 additions & 0 deletions Dockerfile-mongo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM mongo:latest

ARG UID=1006
ARG GID=1006
RUN usermod -u $UID mongodb && groupmod -g $GID mongodb
6 changes: 6 additions & 0 deletions Dockerfile-mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mysql:latest

ARG UID=1006
ARG GID=1006

RUN usermod -u $UID mysql && groupmod -g $GID mysql
30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,3 @@ The features of the tool are listed below:
- Automatic identification of buildings that are better to be served by idividual solar home systems.


## Get started

### Installation

1. From the root of the repository, first create a virtual environment (here called venv) using the following command:
python3 -m venv venv

or if you want to install a specific version of python, first install *virtualenv* and then:
virtualenv venv --python=python_version

Note that conda can also be used to set up a virtual environment

2. Activate the virtual environment running the following command:

i. On Linux, MacOs
source venv/bin/activate

ii. On Windows
venv\Scripts\activate

3. Install the required packages using the following command:
pip install -r requirements.txt

### Launching of the app

1. Run the following command to start the FastAPI server:
uvicorn fastapi_app.main:app --reload

2. Open the following URL in a browser (preferably on Chrome or Firefox):
http://127.0.0.1:8000/
28 changes: 28 additions & 0 deletions ackee_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use static'

const { day } = require('./times')
const fs = require('fs');
const filePath = process.env.ACKEE_PASSWORD_FILE;
const fileContent = fs.readFileSync(filePath, 'utf-8');
process.env.ACKEE_PASSWORD = fileContent
process.env.ACKEE_MONGODB = 'mongodb://' + process.env.ACKEE_USERNAME + ':' + fileContent + '@' + process.env.MONGO_CONTAINER_NAME + ':' + process.env.DB_PORT + '/admin'

// Must be a function or object that loads and returns the env variables at runtime.
// Otherwise it wouldn't be possible to mock the env variables with mockedEnv.
module.exports = new Proxy({}, {
get: function(target, prop) {
const data = {
ttl: process.env.ACKEE_TTL || day,
port: process.env.ACKEE_PORT || process.env.PORT || 3000,
dbUrl: process.env.ACKEE_MONGODB || process.env.MONGODB_URI,
allowOrigin: process.env.ACKEE_ALLOW_ORIGIN,
autoOrigin: process.env.ACKEE_AUTO_ORIGIN === 'true',
username: process.env.ACKEE_USERNAME,
password: process.env.ACKEE_PASSWORD,
isDemoMode: process.env.ACKEE_DEMO === 'true',
isDevelopmentMode: process.env.NODE_ENV === 'development',
isPreBuildMode: process.env.BUILD_ENV === 'pre',
}
return data[prop]
},
})
30 changes: 30 additions & 0 deletions celery_worker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os
from celery import Celery

CELERY_BROKER_URL = (os.environ.get("CELERY_BROKER_URL", "redis://redis:6379/0"),)
CELERY_RESULT_BACKEND = os.environ.get("CELERY_RESULT_BACKEND", "redis://redis:6379/0")

worker = Celery(
"worker",
broker=CELERY_BROKER_URL,
backend=CELERY_RESULT_BACKEND,
include=["fastapi_app.main"],
)

worker.conf.task_queues = {
'default_queue': {
'exchange': 'default_exchange',
'routing_key': 'default',
},
'milp_queue': {
'exchange': 'milp_exchange',
'routing_key': 'milp',
},

}

worker.conf.task_routes = {
'celery_worker.task_grid_opt': {'queue': 'default_queue'},
'celery_worker.task_supply_opt': {'queue': 'milp_queue'},
'celery_worker.task_remove_anonymous_users': {'queue':'default_queue'},
}
9 changes: 0 additions & 9 deletions debugger.py

This file was deleted.

Loading