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

Integration of added value calculator #147

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
LOCAL_APPS = [
"slapp.users",
"slapp.explorer",
"slapp.kommWertTool"
# Your stuff: custom apps go here
]
# https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
Expand Down
1 change: 1 addition & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
path("explorer/", include("slapp.explorer.urls", namespace="explorer")),
path("map/", include("django_mapengine.urls")),
*static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT),
path('kommWertTool/', include('slapp.kommWertTool.urls', namespace="kommWertTool")),
]

# API URLS
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ pandas==2.2.1

django-filter~=23.5
djangorestframework-gis~=1.0

# ADDED VALUE REQUIREMENTS
gunicorn
python-dotenv
matplotlib
pandas
numpy
16 changes: 8 additions & 8 deletions slapp/explorer/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
PotentialareaPVAgricultureLFAOff,
PotentialareaPVRoadRailway,
PotentialareaWindSTP2018Vreg,
PotentialareaWindSTP2027Repowering,
PotentialareaWindSTP2027SearchAreaForestArea,
PotentialareaWindSTP2027SearchAreaOpenArea,
PotentialareaWindSTP2027VR,
#PotentialareaWindSTP2027Repowering,
#PotentialareaWindSTP2027SearchAreaForestArea,
#PotentialareaWindSTP2027SearchAreaOpenArea,
#PotentialareaWindSTP2027VR,
PVground,
PVroof,
Railway,
Expand Down Expand Up @@ -77,9 +77,9 @@
PotentialareaPVAgricultureLFAOff,
PotentialareaPVRoadRailway,
PotentialareaWindSTP2018Vreg,
PotentialareaWindSTP2027Repowering,
PotentialareaWindSTP2027SearchAreaForestArea,
PotentialareaWindSTP2027SearchAreaOpenArea,
PotentialareaWindSTP2027VR,
#PotentialareaWindSTP2027Repowering,
#PotentialareaWindSTP2027SearchAreaForestArea,
#PotentialareaWindSTP2027SearchAreaOpenArea,
#PotentialareaWindSTP2027VR,
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.10 on 2024-10-29 07:15

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("explorer", "0003_region_municipality_region"),
]

operations = [
migrations.DeleteModel(
name="PotentialareaWindSTP2027Repowering",
),
migrations.DeleteModel(
name="PotentialareaWindSTP2027SearchAreaForestArea",
),
migrations.DeleteModel(
name="PotentialareaWindSTP2027SearchAreaOpenArea",
),
migrations.DeleteModel(
name="PotentialareaWindSTP2027VR",
),
]
7 changes: 4 additions & 3 deletions slapp/explorer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,20 +571,20 @@ class Water(StaticRegionModel): # noqa: D101

class PotentialareaPVAgricultureLFAOff(StaticRegionModel): # noqa: D101
data_file = "potentialarea_pv_agriculture_lfa-off_region"
layer = "potentialarea_pv_agriculture_lfa-off_region"
layer = "potentialarea_pv_agriculture_lfa-off"


class PotentialareaPVRoadRailway(StaticRegionModel): # noqa: D101
data_file = "potentialarea_pv_road_railway_region"
layer = "potentialarea_pv_road_railway_region"
layer = "potentialarea_pv_road_railway"


class PotentialareaWindSTP2018Vreg(StaticRegionModel): # noqa: D101
data_file = "potentialarea_wind_stp_2018_vreg"
layer = "potentialarea_wind_stp_2018_vreg"


class PotentialareaWindSTP2027Repowering(StaticRegionModel): # noqa: D101
""" class PotentialareaWindSTP2027Repowering(StaticRegionModel): # noqa: D101
data_file = "potentialarea_wind_stp_2027_repowering"
layer = "potentialarea_wind_stp_2027_repowering"

Expand All @@ -602,3 +602,4 @@ class PotentialareaWindSTP2027SearchAreaOpenArea(StaticRegionModel): # noqa: D1
class PotentialareaWindSTP2027VR(StaticRegionModel): # noqa: D101
data_file = "potentialarea_wind_stp_2027_vr"
layer = "potentialarea_wind_stp_2027_vr"
"""
1 change: 0 additions & 1 deletion slapp/explorer/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
path("results_variation/", views.optimization_results, name="results_variation"),
path("results_robustness/", views.robustness, name="results_robustness"),
path("parameters_robustness/", views.robustness_parameters, name="parameters_robustness"),
path("added_value/", views.added_value, name="added_value"),
]

htmx_urlpatterns = [
Expand Down
8 changes: 4 additions & 4 deletions slapp/explorer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def optimization_results(request: HttpRequest) -> HttpResponse:
municipalities = None
messages.add_message(request, messages.WARNING, "Keine Gemeinde(n) ausgewählt.")

next_url = reverse("explorer:added_value")
next_url = reverse("kommWertTool:added_value")
prev_url = reverse("explorer:parameters_variation")
active_tab = "step_6_results"
sidepanel = True
Expand Down Expand Up @@ -414,7 +414,7 @@ def robustness(request: HttpRequest) -> HttpResponse:
municipalities = None
messages.add_message(request, messages.WARNING, "Keine Gemeinde(n) ausgewählt.")

next_url = reverse("explorer:added_value")
next_url = reverse("kommWertTool:added_value")
prev_url = reverse("explorer:parameters_robustness")
active_tab = "step_6_results"
sidepanel = True
Expand Down Expand Up @@ -462,11 +462,11 @@ def added_value(request: HttpRequest) -> HttpResponse:
{4: "explorer:esm_mode"},
{5: "explorer:parameters_variation"},
{6: "explorer:results_variation"},
{7: "explorer:added_value"},
{7: "kommWertTool:added_value"},
{8: "--- placeholder ---"},
{9: "explorer:parameters_robustness"},
{10: "explorer:results_robustness"},
{11: "explorer:added_value"},
{11: "kommWertTool:added_value"},
]


Expand Down
Empty file added slapp/kommWertTool/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions slapp/kommWertTool/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions slapp/kommWertTool/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class KommwerttoolConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "kommWertTool"
Loading
Loading