diff --git a/.dockerignore b/.dockerignore index 1264b88..aa1f4fa 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,29 @@ +**/__pycache__ +**/.venv +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +Lib Scripts -Lib \ No newline at end of file +venv \ No newline at end of file diff --git a/app/Dockerfiles/Dockerfile.dev b/app/Dockerfiles/Dockerfile.dev index 5c28337..10d3169 100644 --- a/app/Dockerfiles/Dockerfile.dev +++ b/app/Dockerfiles/Dockerfile.dev @@ -9,24 +9,24 @@ RUN apt-get install -y wget python3 python3-pip git WORKDIR /opt/resilience_calculator COPY . . -# Certificates -RUN wget -q -P /usr/local/share/ca-certificates/ http://certstore.inl.gov/pki/CAINLROOT_B64.crt -RUN /usr/sbin/update-ca-certificates -RUN pip config set global.cert /usr/local/share/ca-certificates/CAINLROOT_B64.crt - # App dependencies RUN pip install -r requirements.dev.txt -RUN pip install --src spine -r requirements.spine.txt +RUN pip install --src /opt/spine -r requirements.spine.txt +ENV PATH=$PATH:/opt/spine -# Config +# # Config RUN mkdir -p /root/.spinetoolbox/SpineProject COPY ./install/SpineToolbox.conf /root/.spinetoolbox/SpineProject -# Julia +# # Julia WORKDIR /opt RUN wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz RUN tar zxvf julia-1.9.3-linux-x86_64.tar.gz ENV PATH=$PATH:/opt/julia-1.9.3/bin RUN . ./resilience_calculator/install/julia.sh -ENTRYPOINT [ "./entrypoint.local.sh" ] \ No newline at end of file +# Environment +ENV QT_QPA_PLATFORM="offscreen" +ENV FLASK_APP=./src/app.py + +WORKDIR /opt/resilience_calculator \ No newline at end of file diff --git a/app/entrypoint.local.sh b/app/entrypoint.local.sh new file mode 100644 index 0000000..9867933 --- /dev/null +++ b/app/entrypoint.local.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Copyright 2023, Battelle Energy Alliance, LLC + +mv /opt/spine/spine-engine /opt/resilience_calculator/spine/ +mv /opt/spine/spine-items /opt/resilience_calculator/spine/ +mv /opt/spine/spinedb-api /opt/resilience_calculator/spine/ +mv /opt/spine/spinetoolbox /opt/resilience_calculator/spine/ + +tail -f /dev/null \ No newline at end of file diff --git a/app/requirements.dev.txt b/app/requirements.dev.txt index 356ae20..acb5463 100644 --- a/app/requirements.dev.txt +++ b/app/requirements.dev.txt @@ -48,7 +48,7 @@ semantic-version==2.10.0 setuptools==59.6.0 shiboken2==5.15.2.1 six==1.16.0 -SQLAlchemy==2.0.23 +SQLAlchemy==1.3.24 termcolor==2.3.0 tomli==2.0.1 typing_extensions==4.8.0 diff --git a/app/requirements.git.txt b/app/requirements.spine.txt similarity index 100% rename from app/requirements.git.txt rename to app/requirements.spine.txt diff --git a/app/spine/projects/.gitignore b/app/spine/projects/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/app/spine/projects/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/metrics/Metrics.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/metrics/Metrics.sqlite deleted file mode 100644 index 16e52c8..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/metrics/Metrics.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_db/baseline.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_db/baseline.sqlite deleted file mode 100644 index e69de29..0000000 diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_db/miracl_db.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_db/miracl_db.sqlite deleted file mode 100644 index c38f544..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_db/miracl_db.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite deleted file mode 100644 index 803cc9f..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite deleted file mode 100644 index dfec51d..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite deleted file mode 100644 index f52eafd..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite deleted file mode 100644 index f446f82..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite deleted file mode 100644 index f9ab40c..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/user_input/user_data.xlsx b/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/user_input/user_data.xlsx deleted file mode 100644 index 9fcbb97..0000000 Binary files a/app/spine/projects/Docker_20231113183624/.spinetoolbox/items/user_input/user_data.xlsx and /dev/null differ diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/local/project_local_data.json b/app/spine/projects/Docker_20231113183624/.spinetoolbox/local/project_local_data.json deleted file mode 100644 index f22a48d..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/local/project_local_data.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "items": { - "SpineOptdb": { - "url": { - "username": "", - "password": "" - } - }, - "SpineOptOut": { - "url": { - "username": "", - "password": "" - } - }, - "SpineOpt_template": { - "url": { - "username": "", - "password": "" - } - }, - "system": { - "db_credentials": {} - }, - "hazards": { - "db_credentials": {} - }, - "miracl_db": { - "url": { - "username": "", - "password": "" - } - }, - "hazard_def": { - "url": { - "username": "", - "password": "" - } - }, - "MIRACL_template": { - "url": { - "username": "", - "password": "" - } - } - } -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/project.json b/app/spine/projects/Docker_20231113183624/.spinetoolbox/project.json deleted file mode 100644 index 26a8a86..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/project.json +++ /dev/null @@ -1,576 +0,0 @@ -{ - "project": { - "version": 10, - "description": "", - "specifications": { - "Tool": [ - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/miracl2spineopt.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/apply_hazard.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/compute_metrics.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/run_spineopt.json" - } - ], - "Importer": [ - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Importer/miracl_import.json" - } - ] - }, - "connections": [ - { - "name": "from user_input to import_system", - "from": [ - "user_input", - "right" - ], - "to": [ - "import_system", - "left" - ] - }, - { - "name": "from import_system to miracl_db", - "from": [ - "import_system", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 2 - } - }, - { - "name": "from miracl_db to MIRACL2SpineOpt", - "from": [ - "miracl_db", - "right" - ], - "to": [ - "MIRACL2SpineOpt", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@miracl_db": { - "scenario_filter": { - "no_tornado": false, - "no_winter_storm": false, - "tornado": false, - "winter_storm": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from MIRACL2SpineOpt to SpineOptdb", - "from": [ - "MIRACL2SpineOpt", - "right" - ], - "to": [ - "SpineOptdb", - "left" - ], - "options": { - "write_index": 2 - } - }, - { - "name": "from SpineOptdb to Run SpineOpt 1", - "from": [ - "SpineOptdb", - "bottom" - ], - "to": [ - "Run SpineOpt 1", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptdb": { - "scenario_filter": { - "no_tornado": true, - "no_winter_storm": true, - "tornado": true, - "winter_storm": true - }, - "tool_filter": { - "object_activity_control": true - } - } - }, - "auto_online": true - } - }, - { - "name": "from Run SpineOpt 1 to SpineOptOut", - "from": [ - "Run SpineOpt 1", - "bottom" - ], - "to": [ - "SpineOptOut", - "left" - ], - "options": { - "write_index": 2, - "purge_before_writing": false - } - }, - { - "name": "from merge_SpineOpt to SpineOptdb", - "from": [ - "merge_SpineOpt", - "right" - ], - "to": [ - "SpineOptdb", - "left" - ], - "options": { - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from SpineOpt_template to merge_SpineOpt", - "from": [ - "SpineOpt_template", - "right" - ], - "to": [ - "merge_SpineOpt", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOpt_template": { - "scenario_filter": {}, - "tool_filter": { - "object_activity_control": true - } - } - }, - "auto_online": true - } - }, - { - "name": "from apply_hazards to miracl_db", - "from": [ - "apply_hazards", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 3 - } - }, - { - "name": "from MIRACL_template to merge_miracl", - "from": [ - "MIRACL_template", - "right" - ], - "to": [ - "merge_miracl", - "left" - ] - }, - { - "name": "from merge_miracl to miracl_db", - "from": [ - "merge_miracl", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 1, - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from merge_SpineOpt to SpineOptOut", - "from": [ - "merge_SpineOpt", - "right" - ], - "to": [ - "SpineOptOut", - "left" - ], - "options": { - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from user_input to apply_hazards", - "from": [ - "user_input", - "right" - ], - "to": [ - "apply_hazards", - "left" - ] - }, - { - "name": "from SpineOptOut to Merger 1", - "from": [ - "SpineOptOut", - "right" - ], - "to": [ - "Merger 1", - "bottom" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptOut": { - "tool_filter": { - "object_activity_control": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from SpineOptdb to Merger 1", - "from": [ - "SpineOptdb", - "right" - ], - "to": [ - "Merger 1", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptdb": { - "scenario_filter": { - "no_tornado": false, - "no_winter_storm": false, - "tornado": false, - "winter_storm": false - }, - "tool_filter": { - "object_activity_control": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from Merger 1 to SpineOptInOut", - "from": [ - "Merger 1", - "right" - ], - "to": [ - "SpineOptInOut", - "left" - ], - "options": { - "purge_before_writing": true - } - }, - { - "name": "from SpineOptInOut to compute_metrics", - "from": [ - "SpineOptInOut", - "bottom" - ], - "to": [ - "compute_metrics", - "left" - ] - }, - { - "name": "from compute_metrics to Metrics", - "from": [ - "compute_metrics", - "right" - ], - "to": [ - "Metrics", - "bottom" - ], - "options": { - "purge_before_writing": true - } - } - ], - "jumps": [] - }, - "items": { - "SpineOptdb": { - "type": "Data Store", - "description": "", - "x": 218.69172865094498, - "y": -137.97496859946125, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptdb/SpineOptdb.sqlite" - } - } - }, - "Run SpineOpt 1": { - "type": "Tool", - "description": "", - "x": 269.8612832690504, - "y": -3.2532080142197604, - "specification": "Run SpineOpt", - "execute_in_work": true, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@SpineOptdb" - }, - { - "type": "resource", - "arg": "db_url@SpineOptOut" - } - ], - "options": { - "julia_sysimage": "" - }, - "kill_completed_processes": false - }, - "SpineOptOut": { - "type": "Data Store", - "description": "", - "x": 322.4629095530751, - "y": 134.98995244261786, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptout/SpineOptOut.sqlite" - } - } - }, - "SpineOpt_template": { - "type": "Data Store", - "description": "", - "x": -65.32401527780792, - "y": 105.34259385444186, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite" - } - } - }, - "MIRACL2SpineOpt": { - "type": "Tool", - "description": "", - "x": 77.28798579743705, - "y": -134.09249179042615, - "specification": "MIRACL2SpineOpt", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@miracl_db" - }, - { - "type": "resource", - "arg": "db_url@SpineOptdb" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "apply_hazards": { - "type": "Tool", - "description": "", - "x": -176.42825139097758, - "y": 10.280281547580952, - "specification": "apply_hazard", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "/user_data.xlsx" - }, - { - "type": "resource", - "arg": "db_url@miracl_db" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "miracl_db": { - "type": "Data Store", - "description": "", - "x": -39.04665852663763, - "y": -133.4916649537613, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/miracl_db/miracl_db.sqlite" - } - } - }, - "import_system": { - "type": "Importer", - "description": "", - "x": -177.91725306421642, - "y": -132.88487768371849, - "specification": "Miracl Import", - "cancel_on_error": false, - "on_conflict": "merge", - "file_selection": [ - [ - "/user_data.xlsx", - true - ] - ] - }, - "MIRACL_template": { - "type": "Data Store", - "description": "", - "x": -291.7426023862861, - "y": -244.07960355784394, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/miracl_template/Miracl_Template.sqlite" - } - } - }, - "user_input": { - "type": "Data Connection", - "description": "", - "x": -290.4259337572682, - "y": -59.97951838339294, - "file_references": [], - "db_references": [] - }, - "compute_metrics": { - "type": "Tool", - "description": "", - "x": 553.1081711185861, - "y": 103.54283159529211, - "specification": "compute_metrics", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@SpineOptInOut" - }, - { - "type": "resource", - "arg": "db_url@Metrics" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "merge_miracl": { - "type": "Merger", - "description": "", - "x": -180.0457556936171, - "y": -244.30793216015275, - "cancel_on_error": false - }, - "merge_SpineOpt": { - "type": "Merger", - "description": "", - "x": 37.950318297211346, - "y": 1.5723879686796005, - "cancel_on_error": false - }, - "Merger 1": { - "type": "Merger", - "description": "", - "x": 386.0502886819971, - "y": -135.70676702360254, - "cancel_on_error": false - }, - "SpineOptInOut": { - "type": "Data Store", - "description": "", - "x": 491.90682293891075, - "y": -26.27213046408856, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite" - } - } - }, - "Metrics": { - "type": "Data Store", - "description": "", - "x": 611.8267677079696, - "y": -24.067719640686192, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/metrics/Metrics.sqlite" - } - } - } - } -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Importer/miracl_import.json b/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Importer/miracl_import.json deleted file mode 100644 index 97a1112..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Importer/miracl_import.json +++ /dev/null @@ -1,1143 +0,0 @@ -{ - "name": "Miracl Import", - "item_type": "Importer", - "mapping": { - "table_mappings": { - "thermal_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2, - 3 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 1, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 4": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__reserve" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 2, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_storage__thermal_unit" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 3 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 3, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "electricity_node": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 1 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 1 - } - ] - } - } - ], - "transmission_line": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "transmission_line__from_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "transmission_line__to_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 2 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "demand": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "demand__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "solar_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "solar_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "wind_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "wind_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_pipeline": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_pipeline__from_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_pipeline__to_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 2 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "storage_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "model": [ - { - "start": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 1 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 1 - } - ] - } - }, - { - "end": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 2 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 2 - } - ] - } - }, - { - "resolution": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 3 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 3 - } - ] - } - }, - { - "window_duration": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 4 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 4 - } - ] - } - }, - { - "roll_forward": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 5 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 5 - } - ] - } - } - ], - "time_series": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": -1 - }, - { - "map_type": "Object", - "position": -2 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": -3 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValueType", - "position": "hidden", - "value": "time_series" - }, - { - "map_type": "IndexName", - "position": "hidden" - }, - { - "map_type": "ParameterValueIndex", - "position": 0 - }, - { - "map_type": "ExpandedValue", - "position": "hidden" - } - ] - } - } - ], - "fuel_storage": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "hazard": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "hazard_component": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ] - }, - "selected_tables": [ - "thermal_unit", - "electricity_node", - "transmission_line", - "demand", - "solar_unit", - "wind_unit", - "fuel_pipeline", - "storage_unit", - "model", - "time_series", - "fuel_storage", - "hazard", - "hazard_component" - ], - "table_options": { - "thermal_unit": { - "max_rows": 5, - "header": true - }, - "electricity_node": { - "header": true - }, - "transmission_line": { - "header": true - }, - "demand": { - "header": true - }, - "solar_unit": { - "header": true - }, - "wind_unit": { - "header": true - }, - "fuel_pipeline": { - "header": true - }, - "storage_unit": { - "header": true - }, - "model": { - "header": true - }, - "time_series": {}, - "fuel_storage": {}, - "hazard": {}, - "hazard_component": {} - }, - "table_types": { - "thermal_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "float", - "5": "float", - "6": "float", - "7": "float", - "8": "float", - "9": "float", - "10": "float", - "11": "float", - "12": "float", - "13": "float", - "14": "float", - "15": "string" - }, - "electricity_node": { - "0": "string", - "1": "string" - }, - "transmission_line": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "float", - "6": "float" - }, - "demand": { - "0": "string", - "1": "string", - "2": "float", - "3": "float" - }, - "solar_unit": { - "0": "string", - "1": "string", - "2": "float", - "3": "float" - }, - "wind_unit": { - "0": "string", - "1": "float", - "2": "float", - "3": "float" - }, - "fuel_pipeline": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "duration" - }, - "storage_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string", - "5": "string", - "6": "string", - "7": "string" - }, - "model": { - "0": "string", - "1": "datetime", - "2": "datetime", - "3": "duration", - "4": "duration", - "5": "duration" - }, - "time_series": { - "0": "datetime", - "1": "float", - "2": "float", - "3": "float", - "4": "float" - } - }, - "table_default_column_type": {}, - "table_row_types": { - "time_series": { - "0": "string", - "1": "string", - "2": "string" - } - }, - "source_type": "ExcelConnector" - }, - "description": "" -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Importer/miracl_import.json.bak b/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Importer/miracl_import.json.bak deleted file mode 100644 index d1cdfb5..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Importer/miracl_import.json.bak +++ /dev/null @@ -1,356 +0,0 @@ -{ - "name": "Miracl Import", - "item_type": "Importer", - "mapping": { - "table_mappings": { - "thermal_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__to_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 1, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__to_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 2, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "electricity_node": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "transmission_line": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "demand": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "solar_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "wind_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_strorage": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_pipeline": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ] - }, - "selected_tables": [ - "thermal_unit", - "electricity_node", - "transmission_line", - "demand", - "solar_unit", - "wind_unit", - "fuel_strorage", - "fuel_pipeline" - ], - "table_options": { - "thermal_unit": { - "max_rows": 2, - "header": true - }, - "electricity_node": {}, - "transmission_line": {}, - "demand": {}, - "solar_unit": {}, - "wind_unit": {}, - "fuel_strorage": {}, - "fuel_pipeline": {} - }, - "table_types": { - "thermal_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "float", - "6": "float", - "7": "float", - "8": "float", - "9": "float", - "10": "float", - "11": "float", - "12": "float", - "13": "float", - "14": "float" - }, - "electricity_node": { - "0": "string" - }, - "transmission_line": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string", - "5": "string", - "6": "string" - }, - "demand": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "solar_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "wind_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "fuel_strorage": { - "0": "string", - "1": "string", - "2": "string" - }, - "fuel_pipeline": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string" - } - }, - "table_row_types": {}, - "source_type": "ExcelConnector" - }, - "description": "" -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/apply_hazard.json b/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/apply_hazard.json deleted file mode 100644 index 7e198e4..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/apply_hazard.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "apply_hazard", - "tooltype": "julia", - "includes": [ - "apply_hazard.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/compute_metrics.json b/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/compute_metrics.json deleted file mode 100644 index fbd6c0c..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/compute_metrics.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "compute_metrics", - "tooltype": "julia", - "includes": [ - "compute_metrics.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [ - "metrics.csv" - ], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/miracl2spineopt.json b/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/miracl2spineopt.json deleted file mode 100644 index f9346ba..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/miracl2spineopt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "MIRACL2SpineOpt", - "tooltype": "julia", - "includes": [ - "miracl2spineopt.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/run_spineopt.json b/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/run_spineopt.json deleted file mode 100644 index b456fbd..0000000 --- a/app/spine/projects/Docker_20231113183624/.spinetoolbox/specifications/Tool/run_spineopt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Run SpineOpt", - "tooltype": "julia", - "includes": [ - "run_spineopt.jl" - ], - "description": "Runs SpineOpt.", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/README.md b/app/spine/projects/Docker_20231113183624/README.md deleted file mode 100644 index 0122a81..0000000 --- a/app/spine/projects/Docker_20231113183624/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Spine - - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.software.inl.gov/miracle/Spine.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.software.inl.gov/miracle/Spine/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/app/spine/projects/Docker_20231113183624/apply_hazard.jl b/app/spine/projects/Docker_20231113183624/apply_hazard.jl deleted file mode 100644 index c93cf17..0000000 --- a/app/spine/projects/Docker_20231113183624/apply_hazard.jl +++ /dev/null @@ -1,93 +0,0 @@ -using Revise -using SpineInterface -using SpineOpt -using XLSX -using DataFrames -using Distributions -using Dates - -user_input_fp, system_url = ARGS - -module System end - -using_spinedb(system_url, System) - -""" -Apply hazards into system. -Create one scenario per hazard. -""" -function apply_hazards() - hazard_df = DataFrame(XLSX.readtable(user_input_fp, "hazard")) - hazard_component_df = DataFrame(XLSX.readtable(user_input_fp, "hazard_component")) - hazards = [row[1] for row in eachrow(hazard_df)] - model_hazard = Dict() - for (hzrd, mtts, mtte, model) in eachrow(hazard_df) - push!(get!(model_hazard, Symbol(model), []), (hzrd, mtts, mtte)) - end - hazard_components = Dict() - for (hzrd, comp_type, name, percentage_affected, failure_avail_factor) in eachrow(hazard_component_df) - push!(get!(hazard_components, hzrd, []), (comp_type, name, percentage_affected, failure_avail_factor)) - end - pvals = [] - for m in System.model() - push!(pvals, ("model", string(m.name), "is_active", false, "Base")) - m_start = System.model_start(model=m, _strict=false) - m_end = System.model_end(model=m, _strict=false) - # Simulate hazard forced outages - # Simulate components failures - for (hzrd, mtts, mtte) in get(model_hazard, m.name, ()) - hzrd_alt = string(hzrd, "_alt") - no_hzrd_alt = string("no_", hzrd, "_alt") - push!(pvals, ("model", string(m.name), "is_active", true, hzrd_alt)) - push!(pvals, ("model", string(m.name), "is_active", true, no_hzrd_alt)) - hazard_fo = unparse_db_value( - forced_availability_factor_time_series( - m_start, - m_end, - parse_db_value(Dict("data" => mtts, "type" => "duration")), - parse_db_value(Dict("data" => mtte, "type" => "duration")) - ) - ) - affected_components = [] - for (comp_type, name, percentage_affected, failure_avail_factor) in get(hazard_components, hzrd, ()) - comp_type = Symbol(comp_type) - if !isempty(name) - push!(affected_components, (comp_type, Symbol(name), failure_avail_factor)) - elseif !isempty(percentage_affected) - component_class = getproperty(System, comp_type) - components = component_class() - uniform = DiscreteUniform(1, length(components)) - for i in rand(uniform, div(percentage_affected * length(components), 100)) - obj = components[i] - push!(affected_components, (comp_type, obj.name, failure_avail_factor)) - end - end - end - for (comp_type, comp_name, failure_avail_factor) in affected_components - # TODO: Apply failure_avail_factor to hazard_fo - forced_availability_factor = (comp_type, comp_name, "forced_availability_factor", hazard_fo, hzrd_alt) - push!(pvals, forced_availability_factor) - end - end - end - # Generate scenarios and alternatives - scens = [(string(prefix, h), true) for h in hazards for prefix in ("", "no_")] - alts = [] - scen_alts = [] - for (scen, active) in scens - alt = string(scen, "_alt") - push!(alts, alt) - push!(scen_alts, (scen, alt, nothing)) - push!(scen_alts, (scen, "Base", alt)) - end - # Import data - data = Dict( - :object_parameter_values => pvals, - :alternatives => alts, - :scenarios => scens, - :scenario_alternatives => scen_alts - ) - println(import_data(system_url, data, "Apply hazard")) -end - -apply_hazards() \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/compute_metrics.jl b/app/spine/projects/Docker_20231113183624/compute_metrics.jl deleted file mode 100644 index edbf315..0000000 --- a/app/spine/projects/Docker_20231113183624/compute_metrics.jl +++ /dev/null @@ -1,78 +0,0 @@ -using SpineInterface -using XLSX -using DataFrames -using CSV -using Dates - -function get_outages() - #println(io, "Outages") - #println(io, "demand, start, duration [hr], load not served [kWh], % of load served") - outages = [] - @show collect(indices(node_slack_pos)) - for ent in indices(node_slack_pos) - @show nsp = node_slack_pos(; ent...) - nsp === nothing && continue - n = ent.node - start = nothing - load_not_served = nothing - for (time_stamp, value) in nsp - if start === nothing - if value > 0 - start = time_stamp - load_not_served = value - end - else - if value > 0 - load_not_served += value - else - duration = Hour(time_stamp - start).value - total_load = sum(demand(node=node(n.name), t=t) for t in start:Hour(1):time_stamp) - load_served_percentage = 100 * (total_load - load_not_served) / total_load - push!( - outages, - (node=n, start=start, duration=duration, total_load=total_load, load_not_served=load_not_served) - ) - start = nothing - end - end - end - end - outages -end - -function _percentage_of_served_load(total_load, load_not_served) - if iszero(total_load) - 0 - else - 100 * (total_load - load_not_served) / total_load - end -end - -function compute_metrics(url_in, url_out) - filter_configs = run_request(url_in, "call_method", ("get_filter_configs",)) - hazard = first(cfg["scenario"] for cfg in filter_configs if cfg["type"] == "scenario_filter") - using_spinedb(url_in) - outages = get_outages() - if isempty(outages) - load_not_served = 0 - percentage_of_served_load = 0 - outage_duration = nothing - else - load_not_served = sum(out.load_not_served for out in outages) - total_load = sum(out.total_load for out in outages) - percentage_of_served_load = _percentage_of_served_load(total_load, load_not_served) - outage_duration = Map([x.start for x in outages], [x.duration for x in outages]) - end - params = Dict( - :value => Dict( - (hazard=Symbol(hazard), metrics=:load_not_served) => load_not_served, - (hazard=Symbol(hazard), metrics=:percentage_of_served_load) => percentage_of_served_load, - (hazard=Symbol(hazard), metrics=:outage_duration) => outage_duration - ) - ) - write_parameters(params, url_out; alternative="Base") -end - -url_in, url_out = ARGS - -compute_metrics(url_in, url_out) \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/design.md b/app/spine/projects/Docker_20231113183624/design.md deleted file mode 100644 index 12cdf7d..0000000 --- a/app/spine/projects/Docker_20231113183624/design.md +++ /dev/null @@ -1,159 +0,0 @@ -# Miracl-Spine implementation framework - - -## Purpose - -The purpose of this document is twofold: - -1. To present the requirements for the application of the Miracl framework in Spine. -2. To specify a Spine application that implements those requirements. - -If suited, this document might also be used as a base for the user manual of the resulting application. - -## Requirements - -TODO: Expand below - -### Use cases - -#### User defines and visualize an energy system - -#### User selects a hazard and applies the hazard to their system - -#### User runs the simulation for the selected hazard and collects the corresponding metrics - -## Spine system specification - -The specification consists of two parts: - -1. An energy system template that provides users with the basic building blocks for defining an energy system. -2. A hazard & metrics definition database where developers and users can define the different hazards that may affect the energy system, as well as metrics that reflect their consequences. - -The rationale is that hazard and metrics can be generally applied to *any* energy system regardless of its idiosyncrasies, and thus are better defined separately. - -### Energy system template - -The energy system template allows users to define an energy system to apply the Miracl framework on. The template provide classes, definitions, and alternatives that the user may use as it suits. - -To define a new system, the user must do the following: - -1. Enter the objects and relationships that compose the system in the appropriate classes. -2. Specify values for the appropriate parameters so as to characterize components' behavior under normal circumstances (no failure). -3. Specify any values that characterize the behavior under failure. - - -#### Alternatives - -| name | description | -|---|---| -| `Base` | The base alternative that describes the normal operation of the system. | -| `failure` | The alternative that describes the operation of the system under failure. | - -#### Object classes - -| name | description | -|----------------------|----------------------------------------------------------------------| -| `battery_storage_unit` | an electricity node that can store energy | -| `demand` | an electricty demand | -| `electricity_node` | null | -| `fuel_pipeline` | null | -| `fuel_storage` | a fuel that can be consumed to produce electricity | -| `model` | null | -| `reserve` | null | -| `solar_unit` | a generating unit that uses solar power power to produce electricity | -| `thermal_unit` | a generating unit that uses a fuel to produce electricity | -| `transmission_line` | an electricity transmission line | -| `wind_unit` | a generating unit that uses wind power to produce electricity | - -#### Relationship classes - -| name | member classes | -|---------------------------------------------|---------------------------------------| -| `battery_storage_unit__from_electricity_node` | `battery_storage_unit` - `electricity_node` | -| `battery_storage_unit__to_electricity_node` | `battery_storage_unit` - `electricity_node` | -| `demand__electricity_node` | `demand` - `electricity_node` | -| `fuel_pipeline__from_fuel_storage` | `fuel_pipeline` - `fuel_storage` | -| `fuel_pipeline__to_fuel_storage` | `fuel_pipeline` - `fuel_storage` | -| `fuel_storage__thermal_unit` | `fuel_storage` - `thermal_unit` | -| `solar_unit__electricity_node` | `solar_unit` - `electricity_node` | -| `thermal_unit__electricity_node` | `thermal_unit` - `electricity_node` | -| `thermal_unit__reserve` | `thermal_unit` - `reserve` | -| `transmission_line__from_electricity_node` | `transmission_line` - `electricity_node` | -| `transmission_line__to_electricity_node` | `transmission_line` - `electricity_node` | -| `wind_unit__electricity_node` | `wind_unit` - `electricity_node` | - -#### Parameter definitions - -| class | name | -|----------------------|---------------------------| -| `battery_storage_unit` | `charging_capacity` | -| `battery_storage_unit` | `discharge_rate` | -| `battery_storage_unit` | `generation_capacity` | -| `battery_storage_unit` | `round_trip_efficiency` | -| `battery_storage_unit` | `storage_volume` | -| `demand` | `absolute_demand` | -| `demand` | `load_participation_factor` | -| `fuel_pipeline` | `capacity_backward` | -| `fuel_pipeline` | `capacity_forward` | -| `fuel_storage` | `fuel_cost` | -| `fuel_storage` | `storage_capacity` | -| `fuel_storage` | `initial_level` | -| `solar_unit` | `availability_factor` | -| `solar_unit` | `max_capacity` | -| `thermal_unit` | `forced_outage_rate` | -| `thermal_unit` | `idle_heat_rate` | -| `thermal_unit` | `incremental_heat_rate` | -| `thermal_unit` | `max_capacity` | -| `thermal_unit` | `min_stable` | -| `thermal_unit` | `minimum_down_time` | -| `thermal_unit` | `minimum_up_time` | -| `thermal_unit` | `ramp_down_rate` | -| `thermal_unit` | `ramp_up_rate` | -| `thermal_unit` | `shutdown_cost` | -| `thermal_unit` | `start_up_cost` | -| `thermal_unit` | `start_up_fuel_use` | -| `transmission_line` | `capacity_backward` | -| `transmission_line` | `capacity_forward` | -| `transmission_line` | `reactance` | -| `transmission_line` | `resistance` | -| `wind_unit` | `availability_factor` | -| `wind_unit` | `max_capacity` | - - - -### Hazard & metrics definition database - -It provides a simple data structure for developers to characterize standard hazards and associated metrics. The structure is easy to extend so that advanced users can define their own hazards and metrics if needed. - -A new hazard is defined in three steps: - -1. Enter a corresponding object in the `hazard` class. -2. Enter the corresponding `hazard__component` relationships between the above `hazard` object and any `component` objects that are affected by it. -3. Specify `mean_time_to_failure` and `mean_time_to_repair` for each of the above relationships. - -Applying a hazard to an energy system is simply a matter of generating the parameter values that reflect the hazard for each affected component. First, we look at `mean_time_to_failure` and `mean_time_to_repair` to generate a time-series for the component status. Then, for each parameter value that has the `failure` alternative, we generate a new time-series that is a copy of the status time-series but has the values for `Base` and `failure` in the points where the component is on and off, respectively. The resulting time-series is then used as the value of the parameter for the hazard situation. - -TODO: Metrics - -#### Object classes - -| name | description | -|---|---| -| `hazard` | a hazard that may affect the energy system | -| `component` | an energy system component - corresponding to an object class from the System template above | -| `metrics` | a metrics that reflects a specific consequence of a hazard on the system | - -#### Relationship classes - - -| name | member classes | description | -|---|---|---| -| `hazard__component` | `hazard` - `component` | indicates that a certain hazard may affect a certain system component | -| `hazard__metrics` | `hazard` - `metrics` | indicates that a certain hazard may trigger the computation of a certain metrics | - -#### Parameter definitions - -| class | name | description | -|---|---|---| -| `hazard__component` | `mean_time_to_failure` | The average amount of time, counted from the beginning of the simulation period, until the component fails due to the hazard. A value of 0 is interpreted as immediate failure with no possibility of reparation. | -| `hazard__component` | `mean_time_to_repair` | The average amount of time before the component is back in operation (disregarded if `mean_time_to_failure` is 0) | diff --git a/app/spine/projects/Docker_20231113183624/miracl2spineopt.jl b/app/spine/projects/Docker_20231113183624/miracl2spineopt.jl deleted file mode 100644 index 102c3bd..0000000 --- a/app/spine/projects/Docker_20231113183624/miracl2spineopt.jl +++ /dev/null @@ -1,271 +0,0 @@ -using SpineInterface -using Dates - -url_in, url_out = ARGS - -function _do_work() - scens = [x["name"] for x in run_request(url_in, "query", ("scenario_sq",))["scenario_sq"]] - alts = [x["name"] for x in run_request(url_in, "query", ("alternative_sq",))["alternative_sq"]] - scen_alts = [ - (x["scenario_name"], x["alternative_name"], x["before_alternative_name"]) - for x in run_request( - url_in, "query", ("ext_linked_scenario_alternative_sq",) - )["ext_linked_scenario_alternative_sq"] - ] - data = Dict(:alternatives => alts, :scenarios => scens, :scenario_alternatives => scen_alts) - import_data(url_out, data, "Create hazard scenarios and alternatives") - for alt in alts - _import_alt_data(alt) - end -end - -function _import_alt_data(alt) - M = Module() - using_spinedb(url_in, M; filters=Dict("alternatives" => [String(alt)])) - objects = [] # Tuples (class, object) - object_pvals = [] # Tuples (class, object, parameter, value, alternative) - relationships = [] # Tuples (class, tuple of (object1, object2, ...)) - relationship_pvals = [] # Tuples (class, tuple of (object1, object2, ...), parameter, value, alternative) - data = Dict( - :objects => objects, - :object_parameter_values => object_pvals, - :relationships => relationships, - :relationship_parameter_values => relationship_pvals, - ) - # Model stuff - push!(objects, ("temporal_block", "flat")) - push!(objects, ("stochastic_structure", "deterministic")) - push!(objects, ("stochastic_scenario", "realisation")) - push!(objects, ("report", "basic_report")) - push!(relationships, ("stochastic_structure__stochastic_scenario", ("deterministic", "realisation"))) - push!(relationships, ("report__output", ("basic_report", "node_slack_pos"))) # For load not served metrics - push!(relationships, ("report__output", ("basic_report", "node_state"))) - push!(relationships, ("report__output", ("basic_report", "unit_flow"))) - push!(relationships, ("report__output", ("basic_report", "connection_flow"))) - for m in M.model() - push!(objects, ("model", m.name)) - push!(relationships, ("model__temporal_block", (m.name, "flat"))) - push!(relationships, ("model__default_temporal_block", (m.name, "flat"))) - push!(relationships, ("model__stochastic_structure", (m.name, "deterministic"))) - push!(relationships, ("model__default_stochastic_structure", (m.name, "deterministic"))) - push!(relationships, ("model__report", (m.name, "basic_report"))) - resolution = M.resolution(model=m, _strict=false) - model_start = M.model_start(model=m, _strict=false) - model_end = M.model_end(model=m, _strict=false) - roll_fwd = M.roll_forward(model=m, _strict=false) - is_active = M.is_active(model=m, _strict=false) - resolution === nothing || push!( - object_pvals, ("temporal_block", "flat", "resolution", unparse_db_value(resolution), alt) - ) - model_start === nothing || push!(object_pvals, ("model", m.name, "model_start", unparse_db_value(model_start), alt)) - model_end === nothing || push!(object_pvals, ("model", m.name, "model_end", unparse_db_value(model_end), alt)) - roll_fwd === nothing || push!(object_pvals, ("model", m.name, "roll_forward", unparse_db_value(roll_fwd), alt)) - is_active === nothing || push!(object_pvals, ("model", m.name, "is_active", unparse_db_value(is_active), alt)) - end - for n in M.reserve() - push!(objects, ("node", n.name)) - abs_req = M.absolute_requirement(reserve=n, _strict=false) - abs_req === nothing || push!(object_pvals, ("node", n.name, "demand", unparse_db_value(abs_req), alt)) - end - for (u, n) in M.thermal_unit__reserve() - push!(relationships, ("unit__to_node", (u.name, n.name))) - end - for n in M.electricity_node() - push!(objects, ("node", n.name)) - demands = (M.absolute_demand(demand=d, _strict=false) for d in M.demand__electricity_node(electricity_node=n)) - total_demand = sum(d for d in demands if d !== nothing; init=0) - if !iszero(total_demand) - push!(object_pvals, ("node", n.name, "demand", unparse_db_value(total_demand), alt)) - push!(object_pvals, ("node", n.name, "node_slack_penalty", 1, alt)) - end - balance_type = M.balance_type(electricity_node=n, _strict=false) - if balance_type == :infinite_supply - push!(object_pvals, ("node", n.name, "nodal_balance_sense", "<=", alt)) - end - end - for n in M.fuel_storage() - push!(objects, ("node", n.name)) - push!(object_pvals, ("node", n.name, "has_state", true, alt)) - end - for u in M.thermal_unit() - push!(objects, ("unit", u.name)) - mut = M.minimum_up_time(thermal_unit=u, _strict=false) - mut === nothing || push!(object_pvals, ("unit", u.name, "min_up_time", unparse_db_value(Hour(mut)), alt)) - mdt = M.minimum_down_time(thermal_unit=u, _strict=false) - mdt === nothing || push!(object_pvals, ("unit", u.name, "min_down_time", unparse_db_value(Hour(mdt)), alt)) - suc = M.start_up_cost(thermal_unit=u, _strict=false) - suc === nothing || push!(object_pvals, ("unit", u.name, "start_up_cost", suc, alt)) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!(relationships, ("unit__to_node", (u.name, n_to.name))) - cap = M.max_capacity(thermal_unit=u, _strict=false) - cap === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n_to.name), "unit_capacity", cap, alt) - ) - ms = M.min_stable(thermal_unit=u, _strict=false) - if !(ms === nothing) - if cap === nothing - @warn( - "A value for min_stable has been defined for thermal_unit $u ", - "but no value for `max_capacity` was found. min_stable is ignored for this unit") - else - min_val = ms / cap - push!( - relationship_pvals, - ("unit__to_node", (u.name, n_to.name), "minimum_operating_point", min_val, alt) - ) - end - end - end - end - for u in M.wind_unit() - push!(objects, ("unit", u.name)) - avf = M.availability_factor(wind_unit=u, _strict=false) - avf === nothing || push!(object_pvals, ("unit", u.name, "unit_availability_factor", unparse_db_value(avf), alt)) - for n in M.wind_unit__electricity_node(wind_unit=u) - push!(relationships, ("unit__to_node", (u.name, n.name))) - maxc = M.max_capacity(wind_unit=u, _strict=false) - maxc === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n.name), "unit_capacity", maxc, alt) - ) - end - end - for u in M.solar_unit() - push!(objects, ("unit", u.name)) - avf = M.availability_factor(solar_unit=u, _strict=false) - avf === nothing || push!(object_pvals, ("unit", u.name, "unit_availability_factor", avf, alt)) - for n in M.solar_unit__electricity_node(solar_unit=u) - push!(relationships, ("unit__to_node", (u.name, n.name))) - maxc = M.max_capacity(solar_unit=u, _strict=false) - maxc === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n.name), "unit_capacity", maxc, alt) - ) - end - end - for c in M.fuel_pipeline() - faf = M.forced_availability_factor(fuel_pipeline=c, _strict=false) - if faf !== nothing - push!(object_pvals, ("connection", c.name, "forced_availability_factor", unparse_db_value(faf), alt)) - end - push!(objects, ("connection", c.name)) - end - for (c, n) in M.fuel_pipeline__from_fuel_storage() - push!(relationships, ("connection__from_node", (c.name, n.name))) - cap_bwd = M.capacity_backward(fuel_pipeline=c, _strict=false) - if cap_bwd !== nothing - push!( - relationship_pvals, - ("connection__from_node", (c.name, n.name), "connection_capacity", unparse_db_value(cap_bwd), alt) - ) - end - end - for (c, n) in M.fuel_pipeline__to_fuel_storage() - push!(relationships, ("connection__to_node", (c.name, n.name))) - cap_fwd = M.capacity_forward(fuel_pipeline=c, _strict=false) - if cap_fwd !== nothing - push!( - relationship_pvals, - ("connection__to_node", (c.name, n.name), "connection_capacity", unparse_db_value(cap_fwd), alt) - ) - # FIXME: We add a small negative cost so that the pipeline fills the receiving storage. - # This is important in rolling optimizations that cannot see the full horizon at once. - push!( - relationship_pvals, - ("connection__to_node", (c.name, n.name), "connection_flow_cost", -1, alt) - ) - end - end - for c in M.transmission_line() - push!(objects, ("connection", c.name)) - react = M.reactance(transmission_line=c, _strict=false) - react === nothing || push!(object_pvals, ("connection", c.name, "connection_reactance", react, alt)) - resist = M.resistance(transmission_line=c, _strict=false) - resist === nothing || push!(object_pvals, ("connection", c.name, "connection_resistance", resist, alt)) - faf = M.forced_availability_factor(transmission_line=c, _strict=false) - if faf !== nothing - push!(object_pvals, ("connection", c.name, "forced_availability_factor", unparse_db_value(faf), alt)) - end - end - for (c, n_from) in M.transmission_line__from_electricity_node() - push!(relationships, ("connection__from_node", (c.name, n_from.name))) - push!(relationships, ("connection__to_node", (c.name, n_from.name))) - cap_fwd = M.capacity_forward(transmission_line=c, _strict=false) - cap_fwd === nothing || push!( - relationship_pvals, - ("connection__from_node", (c.name, n_from.name), "connection_capacity", cap_fwd, alt) - ) - cap_bwd = M.capacity_backward(transmission_line=c, _strict=false) - cap_bwd === nothing || push!( - relationship_pvals, - ("connection__to_node", (c.name, n_from.name), "connection_capacity", cap_bwd, alt) - ) - for n_to in M.transmission_line__to_electricity_node(transmission_line=c) - push!(relationships, ("connection__from_node", (c.name, n_to.name))) - push!(relationships, ("connection__to_node", (c.name, n_to.name))) - push!(relationships, ("connection__node__node", (c.name, n_from.name, n_to.name))) - push!(relationships, ("connection__node__node", (c.name, n_to.name, n_from.name))) - push!( - relationship_pvals, - ("connection__node__node", (c.name, n_from.name, n_to.name), "fix_ratio_out_in_connection_flow", 1, alt) - ) - push!( - relationship_pvals, - ("connection__node__node", (c.name, n_to.name, n_from.name), "fix_ratio_out_in_connection_flow", 1, alt) - ) - end - end - for (n_fuel, u) in M.fuel_storage__thermal_unit() - push!(relationships, ("unit__from_node", (u.name, n_fuel.name))) - for n_elec in M.thermal_unit__electricity_node(thermal_unit=u) - push!(relationships, ("unit__to_node", (u.name, n_elec.name))) - push!(relationships, ("unit__node__node", (u.name, n_fuel.name, n_elec.name))) - end - end - for u in indices(M.idle_heat_rate) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_idle_heat_rate", M.idle_heat_rate(thermal_unit=u), - alt - ) - ) - end - end - end - for u in indices(M.incremental_heat_rate) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_incremental_heat_rate", - M.incremental_heat_rate(thermal_unit=u), alt - ) - ) - end - end - end - for u in indices(M.start_up_fuel_use) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_start_flow", - M.start_up_fuel_use(thermal_unit=u), alt - ) - ) - end - end - end - import_data(url_out, data, "Import data for alternative $alt") -end - -_do_work() \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113183624/run_spineopt.jl b/app/spine/projects/Docker_20231113183624/run_spineopt.jl deleted file mode 100644 index a651113..0000000 --- a/app/spine/projects/Docker_20231113183624/run_spineopt.jl +++ /dev/null @@ -1,20 +0,0 @@ -using SpineOpt - -run_spineopt(ARGS...) - -# The above uses the default solvers which are currently CLP for LP problems and Cbc for MIP problems -# The below is an example for using the CPLEX solver. Other solvers follow a similar form -#= -using SpineOpt -using CPLEX -using JuMP - -run_spineopt( - ARGS..., - mip_solver=optimizer_with_attributes( - CPLEX.Optimizer, - "CPX_PARAM_EPGAP" => 0.01 - ), - lp_solver=optimizer_with_attributes(CPLEX.Optimizer) -) -=# diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/metrics/Metrics.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/metrics/Metrics.sqlite deleted file mode 100644 index 16e52c8..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/metrics/Metrics.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_db/baseline.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_db/baseline.sqlite deleted file mode 100644 index e69de29..0000000 diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_db/miracl_db.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_db/miracl_db.sqlite deleted file mode 100644 index 0be2586..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_db/miracl_db.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite deleted file mode 100644 index 803cc9f..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite deleted file mode 100644 index dfec51d..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite deleted file mode 100644 index a8c94ea..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite deleted file mode 100644 index f446f82..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite deleted file mode 100644 index a254c44..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/user_input/user_data.xlsx b/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/user_input/user_data.xlsx deleted file mode 100644 index 9fcbb97..0000000 Binary files a/app/spine/projects/Docker_20231113202744/.spinetoolbox/items/user_input/user_data.xlsx and /dev/null differ diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/local/project_local_data.json b/app/spine/projects/Docker_20231113202744/.spinetoolbox/local/project_local_data.json deleted file mode 100644 index f22a48d..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/local/project_local_data.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "items": { - "SpineOptdb": { - "url": { - "username": "", - "password": "" - } - }, - "SpineOptOut": { - "url": { - "username": "", - "password": "" - } - }, - "SpineOpt_template": { - "url": { - "username": "", - "password": "" - } - }, - "system": { - "db_credentials": {} - }, - "hazards": { - "db_credentials": {} - }, - "miracl_db": { - "url": { - "username": "", - "password": "" - } - }, - "hazard_def": { - "url": { - "username": "", - "password": "" - } - }, - "MIRACL_template": { - "url": { - "username": "", - "password": "" - } - } - } -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/project.json b/app/spine/projects/Docker_20231113202744/.spinetoolbox/project.json deleted file mode 100644 index 26a8a86..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/project.json +++ /dev/null @@ -1,576 +0,0 @@ -{ - "project": { - "version": 10, - "description": "", - "specifications": { - "Tool": [ - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/miracl2spineopt.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/apply_hazard.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/compute_metrics.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/run_spineopt.json" - } - ], - "Importer": [ - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Importer/miracl_import.json" - } - ] - }, - "connections": [ - { - "name": "from user_input to import_system", - "from": [ - "user_input", - "right" - ], - "to": [ - "import_system", - "left" - ] - }, - { - "name": "from import_system to miracl_db", - "from": [ - "import_system", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 2 - } - }, - { - "name": "from miracl_db to MIRACL2SpineOpt", - "from": [ - "miracl_db", - "right" - ], - "to": [ - "MIRACL2SpineOpt", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@miracl_db": { - "scenario_filter": { - "no_tornado": false, - "no_winter_storm": false, - "tornado": false, - "winter_storm": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from MIRACL2SpineOpt to SpineOptdb", - "from": [ - "MIRACL2SpineOpt", - "right" - ], - "to": [ - "SpineOptdb", - "left" - ], - "options": { - "write_index": 2 - } - }, - { - "name": "from SpineOptdb to Run SpineOpt 1", - "from": [ - "SpineOptdb", - "bottom" - ], - "to": [ - "Run SpineOpt 1", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptdb": { - "scenario_filter": { - "no_tornado": true, - "no_winter_storm": true, - "tornado": true, - "winter_storm": true - }, - "tool_filter": { - "object_activity_control": true - } - } - }, - "auto_online": true - } - }, - { - "name": "from Run SpineOpt 1 to SpineOptOut", - "from": [ - "Run SpineOpt 1", - "bottom" - ], - "to": [ - "SpineOptOut", - "left" - ], - "options": { - "write_index": 2, - "purge_before_writing": false - } - }, - { - "name": "from merge_SpineOpt to SpineOptdb", - "from": [ - "merge_SpineOpt", - "right" - ], - "to": [ - "SpineOptdb", - "left" - ], - "options": { - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from SpineOpt_template to merge_SpineOpt", - "from": [ - "SpineOpt_template", - "right" - ], - "to": [ - "merge_SpineOpt", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOpt_template": { - "scenario_filter": {}, - "tool_filter": { - "object_activity_control": true - } - } - }, - "auto_online": true - } - }, - { - "name": "from apply_hazards to miracl_db", - "from": [ - "apply_hazards", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 3 - } - }, - { - "name": "from MIRACL_template to merge_miracl", - "from": [ - "MIRACL_template", - "right" - ], - "to": [ - "merge_miracl", - "left" - ] - }, - { - "name": "from merge_miracl to miracl_db", - "from": [ - "merge_miracl", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 1, - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from merge_SpineOpt to SpineOptOut", - "from": [ - "merge_SpineOpt", - "right" - ], - "to": [ - "SpineOptOut", - "left" - ], - "options": { - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from user_input to apply_hazards", - "from": [ - "user_input", - "right" - ], - "to": [ - "apply_hazards", - "left" - ] - }, - { - "name": "from SpineOptOut to Merger 1", - "from": [ - "SpineOptOut", - "right" - ], - "to": [ - "Merger 1", - "bottom" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptOut": { - "tool_filter": { - "object_activity_control": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from SpineOptdb to Merger 1", - "from": [ - "SpineOptdb", - "right" - ], - "to": [ - "Merger 1", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptdb": { - "scenario_filter": { - "no_tornado": false, - "no_winter_storm": false, - "tornado": false, - "winter_storm": false - }, - "tool_filter": { - "object_activity_control": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from Merger 1 to SpineOptInOut", - "from": [ - "Merger 1", - "right" - ], - "to": [ - "SpineOptInOut", - "left" - ], - "options": { - "purge_before_writing": true - } - }, - { - "name": "from SpineOptInOut to compute_metrics", - "from": [ - "SpineOptInOut", - "bottom" - ], - "to": [ - "compute_metrics", - "left" - ] - }, - { - "name": "from compute_metrics to Metrics", - "from": [ - "compute_metrics", - "right" - ], - "to": [ - "Metrics", - "bottom" - ], - "options": { - "purge_before_writing": true - } - } - ], - "jumps": [] - }, - "items": { - "SpineOptdb": { - "type": "Data Store", - "description": "", - "x": 218.69172865094498, - "y": -137.97496859946125, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptdb/SpineOptdb.sqlite" - } - } - }, - "Run SpineOpt 1": { - "type": "Tool", - "description": "", - "x": 269.8612832690504, - "y": -3.2532080142197604, - "specification": "Run SpineOpt", - "execute_in_work": true, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@SpineOptdb" - }, - { - "type": "resource", - "arg": "db_url@SpineOptOut" - } - ], - "options": { - "julia_sysimage": "" - }, - "kill_completed_processes": false - }, - "SpineOptOut": { - "type": "Data Store", - "description": "", - "x": 322.4629095530751, - "y": 134.98995244261786, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptout/SpineOptOut.sqlite" - } - } - }, - "SpineOpt_template": { - "type": "Data Store", - "description": "", - "x": -65.32401527780792, - "y": 105.34259385444186, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite" - } - } - }, - "MIRACL2SpineOpt": { - "type": "Tool", - "description": "", - "x": 77.28798579743705, - "y": -134.09249179042615, - "specification": "MIRACL2SpineOpt", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@miracl_db" - }, - { - "type": "resource", - "arg": "db_url@SpineOptdb" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "apply_hazards": { - "type": "Tool", - "description": "", - "x": -176.42825139097758, - "y": 10.280281547580952, - "specification": "apply_hazard", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "/user_data.xlsx" - }, - { - "type": "resource", - "arg": "db_url@miracl_db" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "miracl_db": { - "type": "Data Store", - "description": "", - "x": -39.04665852663763, - "y": -133.4916649537613, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/miracl_db/miracl_db.sqlite" - } - } - }, - "import_system": { - "type": "Importer", - "description": "", - "x": -177.91725306421642, - "y": -132.88487768371849, - "specification": "Miracl Import", - "cancel_on_error": false, - "on_conflict": "merge", - "file_selection": [ - [ - "/user_data.xlsx", - true - ] - ] - }, - "MIRACL_template": { - "type": "Data Store", - "description": "", - "x": -291.7426023862861, - "y": -244.07960355784394, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/miracl_template/Miracl_Template.sqlite" - } - } - }, - "user_input": { - "type": "Data Connection", - "description": "", - "x": -290.4259337572682, - "y": -59.97951838339294, - "file_references": [], - "db_references": [] - }, - "compute_metrics": { - "type": "Tool", - "description": "", - "x": 553.1081711185861, - "y": 103.54283159529211, - "specification": "compute_metrics", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@SpineOptInOut" - }, - { - "type": "resource", - "arg": "db_url@Metrics" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "merge_miracl": { - "type": "Merger", - "description": "", - "x": -180.0457556936171, - "y": -244.30793216015275, - "cancel_on_error": false - }, - "merge_SpineOpt": { - "type": "Merger", - "description": "", - "x": 37.950318297211346, - "y": 1.5723879686796005, - "cancel_on_error": false - }, - "Merger 1": { - "type": "Merger", - "description": "", - "x": 386.0502886819971, - "y": -135.70676702360254, - "cancel_on_error": false - }, - "SpineOptInOut": { - "type": "Data Store", - "description": "", - "x": 491.90682293891075, - "y": -26.27213046408856, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite" - } - } - }, - "Metrics": { - "type": "Data Store", - "description": "", - "x": 611.8267677079696, - "y": -24.067719640686192, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/metrics/Metrics.sqlite" - } - } - } - } -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Importer/miracl_import.json b/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Importer/miracl_import.json deleted file mode 100644 index 97a1112..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Importer/miracl_import.json +++ /dev/null @@ -1,1143 +0,0 @@ -{ - "name": "Miracl Import", - "item_type": "Importer", - "mapping": { - "table_mappings": { - "thermal_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2, - 3 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 1, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 4": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__reserve" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 2, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_storage__thermal_unit" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 3 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 3, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "electricity_node": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 1 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 1 - } - ] - } - } - ], - "transmission_line": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "transmission_line__from_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "transmission_line__to_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 2 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "demand": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "demand__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "solar_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "solar_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "wind_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "wind_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_pipeline": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_pipeline__from_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_pipeline__to_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 2 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "storage_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "model": [ - { - "start": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 1 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 1 - } - ] - } - }, - { - "end": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 2 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 2 - } - ] - } - }, - { - "resolution": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 3 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 3 - } - ] - } - }, - { - "window_duration": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 4 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 4 - } - ] - } - }, - { - "roll_forward": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 5 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 5 - } - ] - } - } - ], - "time_series": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": -1 - }, - { - "map_type": "Object", - "position": -2 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": -3 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValueType", - "position": "hidden", - "value": "time_series" - }, - { - "map_type": "IndexName", - "position": "hidden" - }, - { - "map_type": "ParameterValueIndex", - "position": 0 - }, - { - "map_type": "ExpandedValue", - "position": "hidden" - } - ] - } - } - ], - "fuel_storage": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "hazard": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "hazard_component": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ] - }, - "selected_tables": [ - "thermal_unit", - "electricity_node", - "transmission_line", - "demand", - "solar_unit", - "wind_unit", - "fuel_pipeline", - "storage_unit", - "model", - "time_series", - "fuel_storage", - "hazard", - "hazard_component" - ], - "table_options": { - "thermal_unit": { - "max_rows": 5, - "header": true - }, - "electricity_node": { - "header": true - }, - "transmission_line": { - "header": true - }, - "demand": { - "header": true - }, - "solar_unit": { - "header": true - }, - "wind_unit": { - "header": true - }, - "fuel_pipeline": { - "header": true - }, - "storage_unit": { - "header": true - }, - "model": { - "header": true - }, - "time_series": {}, - "fuel_storage": {}, - "hazard": {}, - "hazard_component": {} - }, - "table_types": { - "thermal_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "float", - "5": "float", - "6": "float", - "7": "float", - "8": "float", - "9": "float", - "10": "float", - "11": "float", - "12": "float", - "13": "float", - "14": "float", - "15": "string" - }, - "electricity_node": { - "0": "string", - "1": "string" - }, - "transmission_line": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "float", - "6": "float" - }, - "demand": { - "0": "string", - "1": "string", - "2": "float", - "3": "float" - }, - "solar_unit": { - "0": "string", - "1": "string", - "2": "float", - "3": "float" - }, - "wind_unit": { - "0": "string", - "1": "float", - "2": "float", - "3": "float" - }, - "fuel_pipeline": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "duration" - }, - "storage_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string", - "5": "string", - "6": "string", - "7": "string" - }, - "model": { - "0": "string", - "1": "datetime", - "2": "datetime", - "3": "duration", - "4": "duration", - "5": "duration" - }, - "time_series": { - "0": "datetime", - "1": "float", - "2": "float", - "3": "float", - "4": "float" - } - }, - "table_default_column_type": {}, - "table_row_types": { - "time_series": { - "0": "string", - "1": "string", - "2": "string" - } - }, - "source_type": "ExcelConnector" - }, - "description": "" -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Importer/miracl_import.json.bak b/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Importer/miracl_import.json.bak deleted file mode 100644 index d1cdfb5..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Importer/miracl_import.json.bak +++ /dev/null @@ -1,356 +0,0 @@ -{ - "name": "Miracl Import", - "item_type": "Importer", - "mapping": { - "table_mappings": { - "thermal_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__to_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 1, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__to_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 2, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "electricity_node": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "transmission_line": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "demand": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "solar_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "wind_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_strorage": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_pipeline": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ] - }, - "selected_tables": [ - "thermal_unit", - "electricity_node", - "transmission_line", - "demand", - "solar_unit", - "wind_unit", - "fuel_strorage", - "fuel_pipeline" - ], - "table_options": { - "thermal_unit": { - "max_rows": 2, - "header": true - }, - "electricity_node": {}, - "transmission_line": {}, - "demand": {}, - "solar_unit": {}, - "wind_unit": {}, - "fuel_strorage": {}, - "fuel_pipeline": {} - }, - "table_types": { - "thermal_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "float", - "6": "float", - "7": "float", - "8": "float", - "9": "float", - "10": "float", - "11": "float", - "12": "float", - "13": "float", - "14": "float" - }, - "electricity_node": { - "0": "string" - }, - "transmission_line": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string", - "5": "string", - "6": "string" - }, - "demand": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "solar_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "wind_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "fuel_strorage": { - "0": "string", - "1": "string", - "2": "string" - }, - "fuel_pipeline": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string" - } - }, - "table_row_types": {}, - "source_type": "ExcelConnector" - }, - "description": "" -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/apply_hazard.json b/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/apply_hazard.json deleted file mode 100644 index 7e198e4..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/apply_hazard.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "apply_hazard", - "tooltype": "julia", - "includes": [ - "apply_hazard.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/compute_metrics.json b/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/compute_metrics.json deleted file mode 100644 index fbd6c0c..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/compute_metrics.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "compute_metrics", - "tooltype": "julia", - "includes": [ - "compute_metrics.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [ - "metrics.csv" - ], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/miracl2spineopt.json b/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/miracl2spineopt.json deleted file mode 100644 index f9346ba..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/miracl2spineopt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "MIRACL2SpineOpt", - "tooltype": "julia", - "includes": [ - "miracl2spineopt.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/run_spineopt.json b/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/run_spineopt.json deleted file mode 100644 index b456fbd..0000000 --- a/app/spine/projects/Docker_20231113202744/.spinetoolbox/specifications/Tool/run_spineopt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Run SpineOpt", - "tooltype": "julia", - "includes": [ - "run_spineopt.jl" - ], - "description": "Runs SpineOpt.", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/README.md b/app/spine/projects/Docker_20231113202744/README.md deleted file mode 100644 index 0122a81..0000000 --- a/app/spine/projects/Docker_20231113202744/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Spine - - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.software.inl.gov/miracle/Spine.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.software.inl.gov/miracle/Spine/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/app/spine/projects/Docker_20231113202744/apply_hazard.jl b/app/spine/projects/Docker_20231113202744/apply_hazard.jl deleted file mode 100644 index c93cf17..0000000 --- a/app/spine/projects/Docker_20231113202744/apply_hazard.jl +++ /dev/null @@ -1,93 +0,0 @@ -using Revise -using SpineInterface -using SpineOpt -using XLSX -using DataFrames -using Distributions -using Dates - -user_input_fp, system_url = ARGS - -module System end - -using_spinedb(system_url, System) - -""" -Apply hazards into system. -Create one scenario per hazard. -""" -function apply_hazards() - hazard_df = DataFrame(XLSX.readtable(user_input_fp, "hazard")) - hazard_component_df = DataFrame(XLSX.readtable(user_input_fp, "hazard_component")) - hazards = [row[1] for row in eachrow(hazard_df)] - model_hazard = Dict() - for (hzrd, mtts, mtte, model) in eachrow(hazard_df) - push!(get!(model_hazard, Symbol(model), []), (hzrd, mtts, mtte)) - end - hazard_components = Dict() - for (hzrd, comp_type, name, percentage_affected, failure_avail_factor) in eachrow(hazard_component_df) - push!(get!(hazard_components, hzrd, []), (comp_type, name, percentage_affected, failure_avail_factor)) - end - pvals = [] - for m in System.model() - push!(pvals, ("model", string(m.name), "is_active", false, "Base")) - m_start = System.model_start(model=m, _strict=false) - m_end = System.model_end(model=m, _strict=false) - # Simulate hazard forced outages - # Simulate components failures - for (hzrd, mtts, mtte) in get(model_hazard, m.name, ()) - hzrd_alt = string(hzrd, "_alt") - no_hzrd_alt = string("no_", hzrd, "_alt") - push!(pvals, ("model", string(m.name), "is_active", true, hzrd_alt)) - push!(pvals, ("model", string(m.name), "is_active", true, no_hzrd_alt)) - hazard_fo = unparse_db_value( - forced_availability_factor_time_series( - m_start, - m_end, - parse_db_value(Dict("data" => mtts, "type" => "duration")), - parse_db_value(Dict("data" => mtte, "type" => "duration")) - ) - ) - affected_components = [] - for (comp_type, name, percentage_affected, failure_avail_factor) in get(hazard_components, hzrd, ()) - comp_type = Symbol(comp_type) - if !isempty(name) - push!(affected_components, (comp_type, Symbol(name), failure_avail_factor)) - elseif !isempty(percentage_affected) - component_class = getproperty(System, comp_type) - components = component_class() - uniform = DiscreteUniform(1, length(components)) - for i in rand(uniform, div(percentage_affected * length(components), 100)) - obj = components[i] - push!(affected_components, (comp_type, obj.name, failure_avail_factor)) - end - end - end - for (comp_type, comp_name, failure_avail_factor) in affected_components - # TODO: Apply failure_avail_factor to hazard_fo - forced_availability_factor = (comp_type, comp_name, "forced_availability_factor", hazard_fo, hzrd_alt) - push!(pvals, forced_availability_factor) - end - end - end - # Generate scenarios and alternatives - scens = [(string(prefix, h), true) for h in hazards for prefix in ("", "no_")] - alts = [] - scen_alts = [] - for (scen, active) in scens - alt = string(scen, "_alt") - push!(alts, alt) - push!(scen_alts, (scen, alt, nothing)) - push!(scen_alts, (scen, "Base", alt)) - end - # Import data - data = Dict( - :object_parameter_values => pvals, - :alternatives => alts, - :scenarios => scens, - :scenario_alternatives => scen_alts - ) - println(import_data(system_url, data, "Apply hazard")) -end - -apply_hazards() \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/compute_metrics.jl b/app/spine/projects/Docker_20231113202744/compute_metrics.jl deleted file mode 100644 index edbf315..0000000 --- a/app/spine/projects/Docker_20231113202744/compute_metrics.jl +++ /dev/null @@ -1,78 +0,0 @@ -using SpineInterface -using XLSX -using DataFrames -using CSV -using Dates - -function get_outages() - #println(io, "Outages") - #println(io, "demand, start, duration [hr], load not served [kWh], % of load served") - outages = [] - @show collect(indices(node_slack_pos)) - for ent in indices(node_slack_pos) - @show nsp = node_slack_pos(; ent...) - nsp === nothing && continue - n = ent.node - start = nothing - load_not_served = nothing - for (time_stamp, value) in nsp - if start === nothing - if value > 0 - start = time_stamp - load_not_served = value - end - else - if value > 0 - load_not_served += value - else - duration = Hour(time_stamp - start).value - total_load = sum(demand(node=node(n.name), t=t) for t in start:Hour(1):time_stamp) - load_served_percentage = 100 * (total_load - load_not_served) / total_load - push!( - outages, - (node=n, start=start, duration=duration, total_load=total_load, load_not_served=load_not_served) - ) - start = nothing - end - end - end - end - outages -end - -function _percentage_of_served_load(total_load, load_not_served) - if iszero(total_load) - 0 - else - 100 * (total_load - load_not_served) / total_load - end -end - -function compute_metrics(url_in, url_out) - filter_configs = run_request(url_in, "call_method", ("get_filter_configs",)) - hazard = first(cfg["scenario"] for cfg in filter_configs if cfg["type"] == "scenario_filter") - using_spinedb(url_in) - outages = get_outages() - if isempty(outages) - load_not_served = 0 - percentage_of_served_load = 0 - outage_duration = nothing - else - load_not_served = sum(out.load_not_served for out in outages) - total_load = sum(out.total_load for out in outages) - percentage_of_served_load = _percentage_of_served_load(total_load, load_not_served) - outage_duration = Map([x.start for x in outages], [x.duration for x in outages]) - end - params = Dict( - :value => Dict( - (hazard=Symbol(hazard), metrics=:load_not_served) => load_not_served, - (hazard=Symbol(hazard), metrics=:percentage_of_served_load) => percentage_of_served_load, - (hazard=Symbol(hazard), metrics=:outage_duration) => outage_duration - ) - ) - write_parameters(params, url_out; alternative="Base") -end - -url_in, url_out = ARGS - -compute_metrics(url_in, url_out) \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/design.md b/app/spine/projects/Docker_20231113202744/design.md deleted file mode 100644 index 12cdf7d..0000000 --- a/app/spine/projects/Docker_20231113202744/design.md +++ /dev/null @@ -1,159 +0,0 @@ -# Miracl-Spine implementation framework - - -## Purpose - -The purpose of this document is twofold: - -1. To present the requirements for the application of the Miracl framework in Spine. -2. To specify a Spine application that implements those requirements. - -If suited, this document might also be used as a base for the user manual of the resulting application. - -## Requirements - -TODO: Expand below - -### Use cases - -#### User defines and visualize an energy system - -#### User selects a hazard and applies the hazard to their system - -#### User runs the simulation for the selected hazard and collects the corresponding metrics - -## Spine system specification - -The specification consists of two parts: - -1. An energy system template that provides users with the basic building blocks for defining an energy system. -2. A hazard & metrics definition database where developers and users can define the different hazards that may affect the energy system, as well as metrics that reflect their consequences. - -The rationale is that hazard and metrics can be generally applied to *any* energy system regardless of its idiosyncrasies, and thus are better defined separately. - -### Energy system template - -The energy system template allows users to define an energy system to apply the Miracl framework on. The template provide classes, definitions, and alternatives that the user may use as it suits. - -To define a new system, the user must do the following: - -1. Enter the objects and relationships that compose the system in the appropriate classes. -2. Specify values for the appropriate parameters so as to characterize components' behavior under normal circumstances (no failure). -3. Specify any values that characterize the behavior under failure. - - -#### Alternatives - -| name | description | -|---|---| -| `Base` | The base alternative that describes the normal operation of the system. | -| `failure` | The alternative that describes the operation of the system under failure. | - -#### Object classes - -| name | description | -|----------------------|----------------------------------------------------------------------| -| `battery_storage_unit` | an electricity node that can store energy | -| `demand` | an electricty demand | -| `electricity_node` | null | -| `fuel_pipeline` | null | -| `fuel_storage` | a fuel that can be consumed to produce electricity | -| `model` | null | -| `reserve` | null | -| `solar_unit` | a generating unit that uses solar power power to produce electricity | -| `thermal_unit` | a generating unit that uses a fuel to produce electricity | -| `transmission_line` | an electricity transmission line | -| `wind_unit` | a generating unit that uses wind power to produce electricity | - -#### Relationship classes - -| name | member classes | -|---------------------------------------------|---------------------------------------| -| `battery_storage_unit__from_electricity_node` | `battery_storage_unit` - `electricity_node` | -| `battery_storage_unit__to_electricity_node` | `battery_storage_unit` - `electricity_node` | -| `demand__electricity_node` | `demand` - `electricity_node` | -| `fuel_pipeline__from_fuel_storage` | `fuel_pipeline` - `fuel_storage` | -| `fuel_pipeline__to_fuel_storage` | `fuel_pipeline` - `fuel_storage` | -| `fuel_storage__thermal_unit` | `fuel_storage` - `thermal_unit` | -| `solar_unit__electricity_node` | `solar_unit` - `electricity_node` | -| `thermal_unit__electricity_node` | `thermal_unit` - `electricity_node` | -| `thermal_unit__reserve` | `thermal_unit` - `reserve` | -| `transmission_line__from_electricity_node` | `transmission_line` - `electricity_node` | -| `transmission_line__to_electricity_node` | `transmission_line` - `electricity_node` | -| `wind_unit__electricity_node` | `wind_unit` - `electricity_node` | - -#### Parameter definitions - -| class | name | -|----------------------|---------------------------| -| `battery_storage_unit` | `charging_capacity` | -| `battery_storage_unit` | `discharge_rate` | -| `battery_storage_unit` | `generation_capacity` | -| `battery_storage_unit` | `round_trip_efficiency` | -| `battery_storage_unit` | `storage_volume` | -| `demand` | `absolute_demand` | -| `demand` | `load_participation_factor` | -| `fuel_pipeline` | `capacity_backward` | -| `fuel_pipeline` | `capacity_forward` | -| `fuel_storage` | `fuel_cost` | -| `fuel_storage` | `storage_capacity` | -| `fuel_storage` | `initial_level` | -| `solar_unit` | `availability_factor` | -| `solar_unit` | `max_capacity` | -| `thermal_unit` | `forced_outage_rate` | -| `thermal_unit` | `idle_heat_rate` | -| `thermal_unit` | `incremental_heat_rate` | -| `thermal_unit` | `max_capacity` | -| `thermal_unit` | `min_stable` | -| `thermal_unit` | `minimum_down_time` | -| `thermal_unit` | `minimum_up_time` | -| `thermal_unit` | `ramp_down_rate` | -| `thermal_unit` | `ramp_up_rate` | -| `thermal_unit` | `shutdown_cost` | -| `thermal_unit` | `start_up_cost` | -| `thermal_unit` | `start_up_fuel_use` | -| `transmission_line` | `capacity_backward` | -| `transmission_line` | `capacity_forward` | -| `transmission_line` | `reactance` | -| `transmission_line` | `resistance` | -| `wind_unit` | `availability_factor` | -| `wind_unit` | `max_capacity` | - - - -### Hazard & metrics definition database - -It provides a simple data structure for developers to characterize standard hazards and associated metrics. The structure is easy to extend so that advanced users can define their own hazards and metrics if needed. - -A new hazard is defined in three steps: - -1. Enter a corresponding object in the `hazard` class. -2. Enter the corresponding `hazard__component` relationships between the above `hazard` object and any `component` objects that are affected by it. -3. Specify `mean_time_to_failure` and `mean_time_to_repair` for each of the above relationships. - -Applying a hazard to an energy system is simply a matter of generating the parameter values that reflect the hazard for each affected component. First, we look at `mean_time_to_failure` and `mean_time_to_repair` to generate a time-series for the component status. Then, for each parameter value that has the `failure` alternative, we generate a new time-series that is a copy of the status time-series but has the values for `Base` and `failure` in the points where the component is on and off, respectively. The resulting time-series is then used as the value of the parameter for the hazard situation. - -TODO: Metrics - -#### Object classes - -| name | description | -|---|---| -| `hazard` | a hazard that may affect the energy system | -| `component` | an energy system component - corresponding to an object class from the System template above | -| `metrics` | a metrics that reflects a specific consequence of a hazard on the system | - -#### Relationship classes - - -| name | member classes | description | -|---|---|---| -| `hazard__component` | `hazard` - `component` | indicates that a certain hazard may affect a certain system component | -| `hazard__metrics` | `hazard` - `metrics` | indicates that a certain hazard may trigger the computation of a certain metrics | - -#### Parameter definitions - -| class | name | description | -|---|---|---| -| `hazard__component` | `mean_time_to_failure` | The average amount of time, counted from the beginning of the simulation period, until the component fails due to the hazard. A value of 0 is interpreted as immediate failure with no possibility of reparation. | -| `hazard__component` | `mean_time_to_repair` | The average amount of time before the component is back in operation (disregarded if `mean_time_to_failure` is 0) | diff --git a/app/spine/projects/Docker_20231113202744/miracl2spineopt.jl b/app/spine/projects/Docker_20231113202744/miracl2spineopt.jl deleted file mode 100644 index 102c3bd..0000000 --- a/app/spine/projects/Docker_20231113202744/miracl2spineopt.jl +++ /dev/null @@ -1,271 +0,0 @@ -using SpineInterface -using Dates - -url_in, url_out = ARGS - -function _do_work() - scens = [x["name"] for x in run_request(url_in, "query", ("scenario_sq",))["scenario_sq"]] - alts = [x["name"] for x in run_request(url_in, "query", ("alternative_sq",))["alternative_sq"]] - scen_alts = [ - (x["scenario_name"], x["alternative_name"], x["before_alternative_name"]) - for x in run_request( - url_in, "query", ("ext_linked_scenario_alternative_sq",) - )["ext_linked_scenario_alternative_sq"] - ] - data = Dict(:alternatives => alts, :scenarios => scens, :scenario_alternatives => scen_alts) - import_data(url_out, data, "Create hazard scenarios and alternatives") - for alt in alts - _import_alt_data(alt) - end -end - -function _import_alt_data(alt) - M = Module() - using_spinedb(url_in, M; filters=Dict("alternatives" => [String(alt)])) - objects = [] # Tuples (class, object) - object_pvals = [] # Tuples (class, object, parameter, value, alternative) - relationships = [] # Tuples (class, tuple of (object1, object2, ...)) - relationship_pvals = [] # Tuples (class, tuple of (object1, object2, ...), parameter, value, alternative) - data = Dict( - :objects => objects, - :object_parameter_values => object_pvals, - :relationships => relationships, - :relationship_parameter_values => relationship_pvals, - ) - # Model stuff - push!(objects, ("temporal_block", "flat")) - push!(objects, ("stochastic_structure", "deterministic")) - push!(objects, ("stochastic_scenario", "realisation")) - push!(objects, ("report", "basic_report")) - push!(relationships, ("stochastic_structure__stochastic_scenario", ("deterministic", "realisation"))) - push!(relationships, ("report__output", ("basic_report", "node_slack_pos"))) # For load not served metrics - push!(relationships, ("report__output", ("basic_report", "node_state"))) - push!(relationships, ("report__output", ("basic_report", "unit_flow"))) - push!(relationships, ("report__output", ("basic_report", "connection_flow"))) - for m in M.model() - push!(objects, ("model", m.name)) - push!(relationships, ("model__temporal_block", (m.name, "flat"))) - push!(relationships, ("model__default_temporal_block", (m.name, "flat"))) - push!(relationships, ("model__stochastic_structure", (m.name, "deterministic"))) - push!(relationships, ("model__default_stochastic_structure", (m.name, "deterministic"))) - push!(relationships, ("model__report", (m.name, "basic_report"))) - resolution = M.resolution(model=m, _strict=false) - model_start = M.model_start(model=m, _strict=false) - model_end = M.model_end(model=m, _strict=false) - roll_fwd = M.roll_forward(model=m, _strict=false) - is_active = M.is_active(model=m, _strict=false) - resolution === nothing || push!( - object_pvals, ("temporal_block", "flat", "resolution", unparse_db_value(resolution), alt) - ) - model_start === nothing || push!(object_pvals, ("model", m.name, "model_start", unparse_db_value(model_start), alt)) - model_end === nothing || push!(object_pvals, ("model", m.name, "model_end", unparse_db_value(model_end), alt)) - roll_fwd === nothing || push!(object_pvals, ("model", m.name, "roll_forward", unparse_db_value(roll_fwd), alt)) - is_active === nothing || push!(object_pvals, ("model", m.name, "is_active", unparse_db_value(is_active), alt)) - end - for n in M.reserve() - push!(objects, ("node", n.name)) - abs_req = M.absolute_requirement(reserve=n, _strict=false) - abs_req === nothing || push!(object_pvals, ("node", n.name, "demand", unparse_db_value(abs_req), alt)) - end - for (u, n) in M.thermal_unit__reserve() - push!(relationships, ("unit__to_node", (u.name, n.name))) - end - for n in M.electricity_node() - push!(objects, ("node", n.name)) - demands = (M.absolute_demand(demand=d, _strict=false) for d in M.demand__electricity_node(electricity_node=n)) - total_demand = sum(d for d in demands if d !== nothing; init=0) - if !iszero(total_demand) - push!(object_pvals, ("node", n.name, "demand", unparse_db_value(total_demand), alt)) - push!(object_pvals, ("node", n.name, "node_slack_penalty", 1, alt)) - end - balance_type = M.balance_type(electricity_node=n, _strict=false) - if balance_type == :infinite_supply - push!(object_pvals, ("node", n.name, "nodal_balance_sense", "<=", alt)) - end - end - for n in M.fuel_storage() - push!(objects, ("node", n.name)) - push!(object_pvals, ("node", n.name, "has_state", true, alt)) - end - for u in M.thermal_unit() - push!(objects, ("unit", u.name)) - mut = M.minimum_up_time(thermal_unit=u, _strict=false) - mut === nothing || push!(object_pvals, ("unit", u.name, "min_up_time", unparse_db_value(Hour(mut)), alt)) - mdt = M.minimum_down_time(thermal_unit=u, _strict=false) - mdt === nothing || push!(object_pvals, ("unit", u.name, "min_down_time", unparse_db_value(Hour(mdt)), alt)) - suc = M.start_up_cost(thermal_unit=u, _strict=false) - suc === nothing || push!(object_pvals, ("unit", u.name, "start_up_cost", suc, alt)) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!(relationships, ("unit__to_node", (u.name, n_to.name))) - cap = M.max_capacity(thermal_unit=u, _strict=false) - cap === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n_to.name), "unit_capacity", cap, alt) - ) - ms = M.min_stable(thermal_unit=u, _strict=false) - if !(ms === nothing) - if cap === nothing - @warn( - "A value for min_stable has been defined for thermal_unit $u ", - "but no value for `max_capacity` was found. min_stable is ignored for this unit") - else - min_val = ms / cap - push!( - relationship_pvals, - ("unit__to_node", (u.name, n_to.name), "minimum_operating_point", min_val, alt) - ) - end - end - end - end - for u in M.wind_unit() - push!(objects, ("unit", u.name)) - avf = M.availability_factor(wind_unit=u, _strict=false) - avf === nothing || push!(object_pvals, ("unit", u.name, "unit_availability_factor", unparse_db_value(avf), alt)) - for n in M.wind_unit__electricity_node(wind_unit=u) - push!(relationships, ("unit__to_node", (u.name, n.name))) - maxc = M.max_capacity(wind_unit=u, _strict=false) - maxc === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n.name), "unit_capacity", maxc, alt) - ) - end - end - for u in M.solar_unit() - push!(objects, ("unit", u.name)) - avf = M.availability_factor(solar_unit=u, _strict=false) - avf === nothing || push!(object_pvals, ("unit", u.name, "unit_availability_factor", avf, alt)) - for n in M.solar_unit__electricity_node(solar_unit=u) - push!(relationships, ("unit__to_node", (u.name, n.name))) - maxc = M.max_capacity(solar_unit=u, _strict=false) - maxc === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n.name), "unit_capacity", maxc, alt) - ) - end - end - for c in M.fuel_pipeline() - faf = M.forced_availability_factor(fuel_pipeline=c, _strict=false) - if faf !== nothing - push!(object_pvals, ("connection", c.name, "forced_availability_factor", unparse_db_value(faf), alt)) - end - push!(objects, ("connection", c.name)) - end - for (c, n) in M.fuel_pipeline__from_fuel_storage() - push!(relationships, ("connection__from_node", (c.name, n.name))) - cap_bwd = M.capacity_backward(fuel_pipeline=c, _strict=false) - if cap_bwd !== nothing - push!( - relationship_pvals, - ("connection__from_node", (c.name, n.name), "connection_capacity", unparse_db_value(cap_bwd), alt) - ) - end - end - for (c, n) in M.fuel_pipeline__to_fuel_storage() - push!(relationships, ("connection__to_node", (c.name, n.name))) - cap_fwd = M.capacity_forward(fuel_pipeline=c, _strict=false) - if cap_fwd !== nothing - push!( - relationship_pvals, - ("connection__to_node", (c.name, n.name), "connection_capacity", unparse_db_value(cap_fwd), alt) - ) - # FIXME: We add a small negative cost so that the pipeline fills the receiving storage. - # This is important in rolling optimizations that cannot see the full horizon at once. - push!( - relationship_pvals, - ("connection__to_node", (c.name, n.name), "connection_flow_cost", -1, alt) - ) - end - end - for c in M.transmission_line() - push!(objects, ("connection", c.name)) - react = M.reactance(transmission_line=c, _strict=false) - react === nothing || push!(object_pvals, ("connection", c.name, "connection_reactance", react, alt)) - resist = M.resistance(transmission_line=c, _strict=false) - resist === nothing || push!(object_pvals, ("connection", c.name, "connection_resistance", resist, alt)) - faf = M.forced_availability_factor(transmission_line=c, _strict=false) - if faf !== nothing - push!(object_pvals, ("connection", c.name, "forced_availability_factor", unparse_db_value(faf), alt)) - end - end - for (c, n_from) in M.transmission_line__from_electricity_node() - push!(relationships, ("connection__from_node", (c.name, n_from.name))) - push!(relationships, ("connection__to_node", (c.name, n_from.name))) - cap_fwd = M.capacity_forward(transmission_line=c, _strict=false) - cap_fwd === nothing || push!( - relationship_pvals, - ("connection__from_node", (c.name, n_from.name), "connection_capacity", cap_fwd, alt) - ) - cap_bwd = M.capacity_backward(transmission_line=c, _strict=false) - cap_bwd === nothing || push!( - relationship_pvals, - ("connection__to_node", (c.name, n_from.name), "connection_capacity", cap_bwd, alt) - ) - for n_to in M.transmission_line__to_electricity_node(transmission_line=c) - push!(relationships, ("connection__from_node", (c.name, n_to.name))) - push!(relationships, ("connection__to_node", (c.name, n_to.name))) - push!(relationships, ("connection__node__node", (c.name, n_from.name, n_to.name))) - push!(relationships, ("connection__node__node", (c.name, n_to.name, n_from.name))) - push!( - relationship_pvals, - ("connection__node__node", (c.name, n_from.name, n_to.name), "fix_ratio_out_in_connection_flow", 1, alt) - ) - push!( - relationship_pvals, - ("connection__node__node", (c.name, n_to.name, n_from.name), "fix_ratio_out_in_connection_flow", 1, alt) - ) - end - end - for (n_fuel, u) in M.fuel_storage__thermal_unit() - push!(relationships, ("unit__from_node", (u.name, n_fuel.name))) - for n_elec in M.thermal_unit__electricity_node(thermal_unit=u) - push!(relationships, ("unit__to_node", (u.name, n_elec.name))) - push!(relationships, ("unit__node__node", (u.name, n_fuel.name, n_elec.name))) - end - end - for u in indices(M.idle_heat_rate) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_idle_heat_rate", M.idle_heat_rate(thermal_unit=u), - alt - ) - ) - end - end - end - for u in indices(M.incremental_heat_rate) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_incremental_heat_rate", - M.incremental_heat_rate(thermal_unit=u), alt - ) - ) - end - end - end - for u in indices(M.start_up_fuel_use) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_start_flow", - M.start_up_fuel_use(thermal_unit=u), alt - ) - ) - end - end - end - import_data(url_out, data, "Import data for alternative $alt") -end - -_do_work() \ No newline at end of file diff --git a/app/spine/projects/Docker_20231113202744/run_spineopt.jl b/app/spine/projects/Docker_20231113202744/run_spineopt.jl deleted file mode 100644 index a651113..0000000 --- a/app/spine/projects/Docker_20231113202744/run_spineopt.jl +++ /dev/null @@ -1,20 +0,0 @@ -using SpineOpt - -run_spineopt(ARGS...) - -# The above uses the default solvers which are currently CLP for LP problems and Cbc for MIP problems -# The below is an example for using the CPLEX solver. Other solvers follow a similar form -#= -using SpineOpt -using CPLEX -using JuMP - -run_spineopt( - ARGS..., - mip_solver=optimizer_with_attributes( - CPLEX.Optimizer, - "CPX_PARAM_EPGAP" => 0.01 - ), - lp_solver=optimizer_with_attributes(CPLEX.Optimizer) -) -=# diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/metrics/Metrics.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/metrics/Metrics.sqlite deleted file mode 100644 index 16e52c8..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/metrics/Metrics.sqlite and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_db/baseline.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_db/baseline.sqlite deleted file mode 100644 index e69de29..0000000 diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_db/miracl_db.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_db/miracl_db.sqlite deleted file mode 100644 index 0be2586..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_db/miracl_db.sqlite and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite deleted file mode 100644 index 803cc9f..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/miracl_template/Miracl_Template.sqlite and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite deleted file mode 100644 index dfec51d..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite deleted file mode 100644 index a8c94ea..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptdb/SpineOptdb.sqlite and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite deleted file mode 100644 index f446f82..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite deleted file mode 100644 index a254c44..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/spineoptout/SpineOptOut.sqlite and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/user_input/user_data.xlsx b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/user_input/user_data.xlsx deleted file mode 100644 index 9fcbb97..0000000 Binary files a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/items/user_input/user_data.xlsx and /dev/null differ diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/local/project_local_data.json b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/local/project_local_data.json deleted file mode 100644 index f22a48d..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/local/project_local_data.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "items": { - "SpineOptdb": { - "url": { - "username": "", - "password": "" - } - }, - "SpineOptOut": { - "url": { - "username": "", - "password": "" - } - }, - "SpineOpt_template": { - "url": { - "username": "", - "password": "" - } - }, - "system": { - "db_credentials": {} - }, - "hazards": { - "db_credentials": {} - }, - "miracl_db": { - "url": { - "username": "", - "password": "" - } - }, - "hazard_def": { - "url": { - "username": "", - "password": "" - } - }, - "MIRACL_template": { - "url": { - "username": "", - "password": "" - } - } - } -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/project.json b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/project.json deleted file mode 100644 index 26a8a86..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/project.json +++ /dev/null @@ -1,576 +0,0 @@ -{ - "project": { - "version": 10, - "description": "", - "specifications": { - "Tool": [ - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/miracl2spineopt.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/apply_hazard.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/compute_metrics.json" - }, - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Tool/run_spineopt.json" - } - ], - "Importer": [ - { - "type": "path", - "relative": true, - "path": ".spinetoolbox/specifications/Importer/miracl_import.json" - } - ] - }, - "connections": [ - { - "name": "from user_input to import_system", - "from": [ - "user_input", - "right" - ], - "to": [ - "import_system", - "left" - ] - }, - { - "name": "from import_system to miracl_db", - "from": [ - "import_system", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 2 - } - }, - { - "name": "from miracl_db to MIRACL2SpineOpt", - "from": [ - "miracl_db", - "right" - ], - "to": [ - "MIRACL2SpineOpt", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@miracl_db": { - "scenario_filter": { - "no_tornado": false, - "no_winter_storm": false, - "tornado": false, - "winter_storm": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from MIRACL2SpineOpt to SpineOptdb", - "from": [ - "MIRACL2SpineOpt", - "right" - ], - "to": [ - "SpineOptdb", - "left" - ], - "options": { - "write_index": 2 - } - }, - { - "name": "from SpineOptdb to Run SpineOpt 1", - "from": [ - "SpineOptdb", - "bottom" - ], - "to": [ - "Run SpineOpt 1", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptdb": { - "scenario_filter": { - "no_tornado": true, - "no_winter_storm": true, - "tornado": true, - "winter_storm": true - }, - "tool_filter": { - "object_activity_control": true - } - } - }, - "auto_online": true - } - }, - { - "name": "from Run SpineOpt 1 to SpineOptOut", - "from": [ - "Run SpineOpt 1", - "bottom" - ], - "to": [ - "SpineOptOut", - "left" - ], - "options": { - "write_index": 2, - "purge_before_writing": false - } - }, - { - "name": "from merge_SpineOpt to SpineOptdb", - "from": [ - "merge_SpineOpt", - "right" - ], - "to": [ - "SpineOptdb", - "left" - ], - "options": { - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from SpineOpt_template to merge_SpineOpt", - "from": [ - "SpineOpt_template", - "right" - ], - "to": [ - "merge_SpineOpt", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOpt_template": { - "scenario_filter": {}, - "tool_filter": { - "object_activity_control": true - } - } - }, - "auto_online": true - } - }, - { - "name": "from apply_hazards to miracl_db", - "from": [ - "apply_hazards", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 3 - } - }, - { - "name": "from MIRACL_template to merge_miracl", - "from": [ - "MIRACL_template", - "right" - ], - "to": [ - "merge_miracl", - "left" - ] - }, - { - "name": "from merge_miracl to miracl_db", - "from": [ - "merge_miracl", - "right" - ], - "to": [ - "miracl_db", - "left" - ], - "options": { - "write_index": 1, - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from merge_SpineOpt to SpineOptOut", - "from": [ - "merge_SpineOpt", - "right" - ], - "to": [ - "SpineOptOut", - "left" - ], - "options": { - "purge_before_writing": true, - "purge_settings": null - } - }, - { - "name": "from user_input to apply_hazards", - "from": [ - "user_input", - "right" - ], - "to": [ - "apply_hazards", - "left" - ] - }, - { - "name": "from SpineOptOut to Merger 1", - "from": [ - "SpineOptOut", - "right" - ], - "to": [ - "Merger 1", - "bottom" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptOut": { - "tool_filter": { - "object_activity_control": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from SpineOptdb to Merger 1", - "from": [ - "SpineOptdb", - "right" - ], - "to": [ - "Merger 1", - "left" - ], - "filter_settings": { - "known_filters": { - "db_url@SpineOptdb": { - "scenario_filter": { - "no_tornado": false, - "no_winter_storm": false, - "tornado": false, - "winter_storm": false - }, - "tool_filter": { - "object_activity_control": false - } - } - }, - "auto_online": true - } - }, - { - "name": "from Merger 1 to SpineOptInOut", - "from": [ - "Merger 1", - "right" - ], - "to": [ - "SpineOptInOut", - "left" - ], - "options": { - "purge_before_writing": true - } - }, - { - "name": "from SpineOptInOut to compute_metrics", - "from": [ - "SpineOptInOut", - "bottom" - ], - "to": [ - "compute_metrics", - "left" - ] - }, - { - "name": "from compute_metrics to Metrics", - "from": [ - "compute_metrics", - "right" - ], - "to": [ - "Metrics", - "bottom" - ], - "options": { - "purge_before_writing": true - } - } - ], - "jumps": [] - }, - "items": { - "SpineOptdb": { - "type": "Data Store", - "description": "", - "x": 218.69172865094498, - "y": -137.97496859946125, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptdb/SpineOptdb.sqlite" - } - } - }, - "Run SpineOpt 1": { - "type": "Tool", - "description": "", - "x": 269.8612832690504, - "y": -3.2532080142197604, - "specification": "Run SpineOpt", - "execute_in_work": true, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@SpineOptdb" - }, - { - "type": "resource", - "arg": "db_url@SpineOptOut" - } - ], - "options": { - "julia_sysimage": "" - }, - "kill_completed_processes": false - }, - "SpineOptOut": { - "type": "Data Store", - "description": "", - "x": 322.4629095530751, - "y": 134.98995244261786, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptout/SpineOptOut.sqlite" - } - } - }, - "SpineOpt_template": { - "type": "Data Store", - "description": "", - "x": -65.32401527780792, - "y": 105.34259385444186, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineopt_template/SpineOpt_template.sqlite" - } - } - }, - "MIRACL2SpineOpt": { - "type": "Tool", - "description": "", - "x": 77.28798579743705, - "y": -134.09249179042615, - "specification": "MIRACL2SpineOpt", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@miracl_db" - }, - { - "type": "resource", - "arg": "db_url@SpineOptdb" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "apply_hazards": { - "type": "Tool", - "description": "", - "x": -176.42825139097758, - "y": 10.280281547580952, - "specification": "apply_hazard", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "/user_data.xlsx" - }, - { - "type": "resource", - "arg": "db_url@miracl_db" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "miracl_db": { - "type": "Data Store", - "description": "", - "x": -39.04665852663763, - "y": -133.4916649537613, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/miracl_db/miracl_db.sqlite" - } - } - }, - "import_system": { - "type": "Importer", - "description": "", - "x": -177.91725306421642, - "y": -132.88487768371849, - "specification": "Miracl Import", - "cancel_on_error": false, - "on_conflict": "merge", - "file_selection": [ - [ - "/user_data.xlsx", - true - ] - ] - }, - "MIRACL_template": { - "type": "Data Store", - "description": "", - "x": -291.7426023862861, - "y": -244.07960355784394, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/miracl_template/Miracl_Template.sqlite" - } - } - }, - "user_input": { - "type": "Data Connection", - "description": "", - "x": -290.4259337572682, - "y": -59.97951838339294, - "file_references": [], - "db_references": [] - }, - "compute_metrics": { - "type": "Tool", - "description": "", - "x": 553.1081711185861, - "y": 103.54283159529211, - "specification": "compute_metrics", - "execute_in_work": false, - "cmd_line_args": [ - { - "type": "resource", - "arg": "db_url@SpineOptInOut" - }, - { - "type": "resource", - "arg": "db_url@Metrics" - } - ], - "kill_completed_processes": false, - "group_id": "miracl" - }, - "merge_miracl": { - "type": "Merger", - "description": "", - "x": -180.0457556936171, - "y": -244.30793216015275, - "cancel_on_error": false - }, - "merge_SpineOpt": { - "type": "Merger", - "description": "", - "x": 37.950318297211346, - "y": 1.5723879686796005, - "cancel_on_error": false - }, - "Merger 1": { - "type": "Merger", - "description": "", - "x": 386.0502886819971, - "y": -135.70676702360254, - "cancel_on_error": false - }, - "SpineOptInOut": { - "type": "Data Store", - "description": "", - "x": 491.90682293891075, - "y": -26.27213046408856, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/spineoptinout/SpineOptInOut.sqlite" - } - } - }, - "Metrics": { - "type": "Data Store", - "description": "", - "x": 611.8267677079696, - "y": -24.067719640686192, - "url": { - "dialect": "sqlite", - "host": "", - "port": "", - "database": { - "type": "path", - "relative": true, - "path": ".spinetoolbox/items/metrics/Metrics.sqlite" - } - } - } - } -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Importer/miracl_import.json b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Importer/miracl_import.json deleted file mode 100644 index 97a1112..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Importer/miracl_import.json +++ /dev/null @@ -1,1143 +0,0 @@ -{ - "name": "Miracl Import", - "item_type": "Importer", - "mapping": { - "table_mappings": { - "thermal_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2, - 3 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 1, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 4": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__reserve" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 2, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_storage__thermal_unit" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 3 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 3, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "electricity_node": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 1 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 1 - } - ] - } - } - ], - "transmission_line": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "transmission_line__from_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "transmission_line__to_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 2 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "demand": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "demand__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "solar_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "solar_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "wind_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "wind_unit__electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_pipeline": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_pipeline__from_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 1 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "fuel_pipeline__to_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0 - }, - { - "map_type": "RelationshipObject", - "position": 2 - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "storage_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "model": [ - { - "start": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 1 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 1 - } - ] - } - }, - { - "end": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 2 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 2 - } - ] - } - }, - { - "resolution": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 3 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 3 - } - ] - } - }, - { - "window_duration": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 4 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 4 - } - ] - } - }, - { - "roll_forward": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header", - "value": 5 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": 5 - } - ] - } - } - ], - "time_series": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": -1 - }, - { - "map_type": "Object", - "position": -2 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": -3 - }, - { - "map_type": "Alternative", - "position": "hidden", - "value": "Base" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValueType", - "position": "hidden", - "value": "time_series" - }, - { - "map_type": "IndexName", - "position": "hidden" - }, - { - "map_type": "ParameterValueIndex", - "position": 0 - }, - { - "map_type": "ExpandedValue", - "position": "hidden" - } - ] - } - } - ], - "fuel_storage": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "hazard": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "hazard_component": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ] - }, - "selected_tables": [ - "thermal_unit", - "electricity_node", - "transmission_line", - "demand", - "solar_unit", - "wind_unit", - "fuel_pipeline", - "storage_unit", - "model", - "time_series", - "fuel_storage", - "hazard", - "hazard_component" - ], - "table_options": { - "thermal_unit": { - "max_rows": 5, - "header": true - }, - "electricity_node": { - "header": true - }, - "transmission_line": { - "header": true - }, - "demand": { - "header": true - }, - "solar_unit": { - "header": true - }, - "wind_unit": { - "header": true - }, - "fuel_pipeline": { - "header": true - }, - "storage_unit": { - "header": true - }, - "model": { - "header": true - }, - "time_series": {}, - "fuel_storage": {}, - "hazard": {}, - "hazard_component": {} - }, - "table_types": { - "thermal_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "float", - "5": "float", - "6": "float", - "7": "float", - "8": "float", - "9": "float", - "10": "float", - "11": "float", - "12": "float", - "13": "float", - "14": "float", - "15": "string" - }, - "electricity_node": { - "0": "string", - "1": "string" - }, - "transmission_line": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "float", - "6": "float" - }, - "demand": { - "0": "string", - "1": "string", - "2": "float", - "3": "float" - }, - "solar_unit": { - "0": "string", - "1": "string", - "2": "float", - "3": "float" - }, - "wind_unit": { - "0": "string", - "1": "float", - "2": "float", - "3": "float" - }, - "fuel_pipeline": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "duration" - }, - "storage_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string", - "5": "string", - "6": "string", - "7": "string" - }, - "model": { - "0": "string", - "1": "datetime", - "2": "datetime", - "3": "duration", - "4": "duration", - "5": "duration" - }, - "time_series": { - "0": "datetime", - "1": "float", - "2": "float", - "3": "float", - "4": "float" - } - }, - "table_default_column_type": {}, - "table_row_types": { - "time_series": { - "0": "string", - "1": "string", - "2": "string" - } - }, - "source_type": "ExcelConnector" - }, - "description": "" -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Importer/miracl_import.json.bak b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Importer/miracl_import.json.bak deleted file mode 100644 index d1cdfb5..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Importer/miracl_import.json.bak +++ /dev/null @@ -1,356 +0,0 @@ -{ - "name": "Miracl Import", - "item_type": "Importer", - "mapping": { - "table_mappings": { - "thermal_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "header", - "value": 0, - "skip_columns": [ - 1, - 2 - ] - }, - { - "map_type": "Object", - "position": 0 - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterDefinition", - "position": "header" - }, - { - "map_type": "Alternative", - "position": "hidden" - }, - { - "map_type": "ParameterValueMetadata", - "position": "hidden" - }, - { - "map_type": "ParameterValue", - "position": "hidden" - } - ] - } - }, - { - "Mapping 2": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__to_electricity_node" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 1 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 1, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - }, - { - "Mapping 3": { - "mapping": [ - { - "map_type": "RelationshipClass", - "position": "hidden", - "value": "thermal_unit__to_fuel_storage" - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 0 - }, - { - "map_type": "RelationshipClassObjectClass", - "position": "header", - "value": 2 - }, - { - "map_type": "Relationship", - "position": "hidden", - "value": "relationship" - }, - { - "map_type": "RelationshipObject", - "position": 0, - "import_objects": true - }, - { - "map_type": "RelationshipObject", - "position": 2, - "import_objects": true - }, - { - "map_type": "RelationshipMetadata", - "position": "hidden" - } - ] - } - } - ], - "electricity_node": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "transmission_line": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "demand": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "solar_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "wind_unit": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_strorage": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ], - "fuel_pipeline": [ - { - "Mapping 1": { - "mapping": [ - { - "map_type": "ObjectClass", - "position": "hidden" - }, - { - "map_type": "Object", - "position": "hidden" - }, - { - "map_type": "ObjectMetadata", - "position": "hidden" - } - ] - } - } - ] - }, - "selected_tables": [ - "thermal_unit", - "electricity_node", - "transmission_line", - "demand", - "solar_unit", - "wind_unit", - "fuel_strorage", - "fuel_pipeline" - ], - "table_options": { - "thermal_unit": { - "max_rows": 2, - "header": true - }, - "electricity_node": {}, - "transmission_line": {}, - "demand": {}, - "solar_unit": {}, - "wind_unit": {}, - "fuel_strorage": {}, - "fuel_pipeline": {} - }, - "table_types": { - "thermal_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "float", - "4": "float", - "5": "float", - "6": "float", - "7": "float", - "8": "float", - "9": "float", - "10": "float", - "11": "float", - "12": "float", - "13": "float", - "14": "float" - }, - "electricity_node": { - "0": "string" - }, - "transmission_line": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string", - "5": "string", - "6": "string" - }, - "demand": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "solar_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "wind_unit": { - "0": "string", - "1": "string", - "2": "string", - "3": "string" - }, - "fuel_strorage": { - "0": "string", - "1": "string", - "2": "string" - }, - "fuel_pipeline": { - "0": "string", - "1": "string", - "2": "string", - "3": "string", - "4": "string" - } - }, - "table_row_types": {}, - "source_type": "ExcelConnector" - }, - "description": "" -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/apply_hazard.json b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/apply_hazard.json deleted file mode 100644 index 7e198e4..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/apply_hazard.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "apply_hazard", - "tooltype": "julia", - "includes": [ - "apply_hazard.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/compute_metrics.json b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/compute_metrics.json deleted file mode 100644 index fbd6c0c..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/compute_metrics.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "compute_metrics", - "tooltype": "julia", - "includes": [ - "compute_metrics.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [ - "metrics.csv" - ], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/miracl2spineopt.json b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/miracl2spineopt.json deleted file mode 100644 index f9346ba..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/miracl2spineopt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "MIRACL2SpineOpt", - "tooltype": "julia", - "includes": [ - "miracl2spineopt.jl" - ], - "description": "", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/run_spineopt.json b/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/run_spineopt.json deleted file mode 100644 index b456fbd..0000000 --- a/app/spine/projects/Nathan_20231113200948/.spinetoolbox/specifications/Tool/run_spineopt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Run SpineOpt", - "tooltype": "julia", - "includes": [ - "run_spineopt.jl" - ], - "description": "Runs SpineOpt.", - "inputfiles": [], - "inputfiles_opt": [], - "outputfiles": [], - "cmdline_args": [], - "execute_in_work": false, - "includes_main_path": "../../.." -} \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/README.md b/app/spine/projects/Nathan_20231113200948/README.md deleted file mode 100644 index 0122a81..0000000 --- a/app/spine/projects/Nathan_20231113200948/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Spine - - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.software.inl.gov/miracle/Spine.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.software.inl.gov/miracle/Spine/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/app/spine/projects/Nathan_20231113200948/apply_hazard.jl b/app/spine/projects/Nathan_20231113200948/apply_hazard.jl deleted file mode 100644 index c93cf17..0000000 --- a/app/spine/projects/Nathan_20231113200948/apply_hazard.jl +++ /dev/null @@ -1,93 +0,0 @@ -using Revise -using SpineInterface -using SpineOpt -using XLSX -using DataFrames -using Distributions -using Dates - -user_input_fp, system_url = ARGS - -module System end - -using_spinedb(system_url, System) - -""" -Apply hazards into system. -Create one scenario per hazard. -""" -function apply_hazards() - hazard_df = DataFrame(XLSX.readtable(user_input_fp, "hazard")) - hazard_component_df = DataFrame(XLSX.readtable(user_input_fp, "hazard_component")) - hazards = [row[1] for row in eachrow(hazard_df)] - model_hazard = Dict() - for (hzrd, mtts, mtte, model) in eachrow(hazard_df) - push!(get!(model_hazard, Symbol(model), []), (hzrd, mtts, mtte)) - end - hazard_components = Dict() - for (hzrd, comp_type, name, percentage_affected, failure_avail_factor) in eachrow(hazard_component_df) - push!(get!(hazard_components, hzrd, []), (comp_type, name, percentage_affected, failure_avail_factor)) - end - pvals = [] - for m in System.model() - push!(pvals, ("model", string(m.name), "is_active", false, "Base")) - m_start = System.model_start(model=m, _strict=false) - m_end = System.model_end(model=m, _strict=false) - # Simulate hazard forced outages - # Simulate components failures - for (hzrd, mtts, mtte) in get(model_hazard, m.name, ()) - hzrd_alt = string(hzrd, "_alt") - no_hzrd_alt = string("no_", hzrd, "_alt") - push!(pvals, ("model", string(m.name), "is_active", true, hzrd_alt)) - push!(pvals, ("model", string(m.name), "is_active", true, no_hzrd_alt)) - hazard_fo = unparse_db_value( - forced_availability_factor_time_series( - m_start, - m_end, - parse_db_value(Dict("data" => mtts, "type" => "duration")), - parse_db_value(Dict("data" => mtte, "type" => "duration")) - ) - ) - affected_components = [] - for (comp_type, name, percentage_affected, failure_avail_factor) in get(hazard_components, hzrd, ()) - comp_type = Symbol(comp_type) - if !isempty(name) - push!(affected_components, (comp_type, Symbol(name), failure_avail_factor)) - elseif !isempty(percentage_affected) - component_class = getproperty(System, comp_type) - components = component_class() - uniform = DiscreteUniform(1, length(components)) - for i in rand(uniform, div(percentage_affected * length(components), 100)) - obj = components[i] - push!(affected_components, (comp_type, obj.name, failure_avail_factor)) - end - end - end - for (comp_type, comp_name, failure_avail_factor) in affected_components - # TODO: Apply failure_avail_factor to hazard_fo - forced_availability_factor = (comp_type, comp_name, "forced_availability_factor", hazard_fo, hzrd_alt) - push!(pvals, forced_availability_factor) - end - end - end - # Generate scenarios and alternatives - scens = [(string(prefix, h), true) for h in hazards for prefix in ("", "no_")] - alts = [] - scen_alts = [] - for (scen, active) in scens - alt = string(scen, "_alt") - push!(alts, alt) - push!(scen_alts, (scen, alt, nothing)) - push!(scen_alts, (scen, "Base", alt)) - end - # Import data - data = Dict( - :object_parameter_values => pvals, - :alternatives => alts, - :scenarios => scens, - :scenario_alternatives => scen_alts - ) - println(import_data(system_url, data, "Apply hazard")) -end - -apply_hazards() \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/compute_metrics.jl b/app/spine/projects/Nathan_20231113200948/compute_metrics.jl deleted file mode 100644 index edbf315..0000000 --- a/app/spine/projects/Nathan_20231113200948/compute_metrics.jl +++ /dev/null @@ -1,78 +0,0 @@ -using SpineInterface -using XLSX -using DataFrames -using CSV -using Dates - -function get_outages() - #println(io, "Outages") - #println(io, "demand, start, duration [hr], load not served [kWh], % of load served") - outages = [] - @show collect(indices(node_slack_pos)) - for ent in indices(node_slack_pos) - @show nsp = node_slack_pos(; ent...) - nsp === nothing && continue - n = ent.node - start = nothing - load_not_served = nothing - for (time_stamp, value) in nsp - if start === nothing - if value > 0 - start = time_stamp - load_not_served = value - end - else - if value > 0 - load_not_served += value - else - duration = Hour(time_stamp - start).value - total_load = sum(demand(node=node(n.name), t=t) for t in start:Hour(1):time_stamp) - load_served_percentage = 100 * (total_load - load_not_served) / total_load - push!( - outages, - (node=n, start=start, duration=duration, total_load=total_load, load_not_served=load_not_served) - ) - start = nothing - end - end - end - end - outages -end - -function _percentage_of_served_load(total_load, load_not_served) - if iszero(total_load) - 0 - else - 100 * (total_load - load_not_served) / total_load - end -end - -function compute_metrics(url_in, url_out) - filter_configs = run_request(url_in, "call_method", ("get_filter_configs",)) - hazard = first(cfg["scenario"] for cfg in filter_configs if cfg["type"] == "scenario_filter") - using_spinedb(url_in) - outages = get_outages() - if isempty(outages) - load_not_served = 0 - percentage_of_served_load = 0 - outage_duration = nothing - else - load_not_served = sum(out.load_not_served for out in outages) - total_load = sum(out.total_load for out in outages) - percentage_of_served_load = _percentage_of_served_load(total_load, load_not_served) - outage_duration = Map([x.start for x in outages], [x.duration for x in outages]) - end - params = Dict( - :value => Dict( - (hazard=Symbol(hazard), metrics=:load_not_served) => load_not_served, - (hazard=Symbol(hazard), metrics=:percentage_of_served_load) => percentage_of_served_load, - (hazard=Symbol(hazard), metrics=:outage_duration) => outage_duration - ) - ) - write_parameters(params, url_out; alternative="Base") -end - -url_in, url_out = ARGS - -compute_metrics(url_in, url_out) \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/design.md b/app/spine/projects/Nathan_20231113200948/design.md deleted file mode 100644 index 12cdf7d..0000000 --- a/app/spine/projects/Nathan_20231113200948/design.md +++ /dev/null @@ -1,159 +0,0 @@ -# Miracl-Spine implementation framework - - -## Purpose - -The purpose of this document is twofold: - -1. To present the requirements for the application of the Miracl framework in Spine. -2. To specify a Spine application that implements those requirements. - -If suited, this document might also be used as a base for the user manual of the resulting application. - -## Requirements - -TODO: Expand below - -### Use cases - -#### User defines and visualize an energy system - -#### User selects a hazard and applies the hazard to their system - -#### User runs the simulation for the selected hazard and collects the corresponding metrics - -## Spine system specification - -The specification consists of two parts: - -1. An energy system template that provides users with the basic building blocks for defining an energy system. -2. A hazard & metrics definition database where developers and users can define the different hazards that may affect the energy system, as well as metrics that reflect their consequences. - -The rationale is that hazard and metrics can be generally applied to *any* energy system regardless of its idiosyncrasies, and thus are better defined separately. - -### Energy system template - -The energy system template allows users to define an energy system to apply the Miracl framework on. The template provide classes, definitions, and alternatives that the user may use as it suits. - -To define a new system, the user must do the following: - -1. Enter the objects and relationships that compose the system in the appropriate classes. -2. Specify values for the appropriate parameters so as to characterize components' behavior under normal circumstances (no failure). -3. Specify any values that characterize the behavior under failure. - - -#### Alternatives - -| name | description | -|---|---| -| `Base` | The base alternative that describes the normal operation of the system. | -| `failure` | The alternative that describes the operation of the system under failure. | - -#### Object classes - -| name | description | -|----------------------|----------------------------------------------------------------------| -| `battery_storage_unit` | an electricity node that can store energy | -| `demand` | an electricty demand | -| `electricity_node` | null | -| `fuel_pipeline` | null | -| `fuel_storage` | a fuel that can be consumed to produce electricity | -| `model` | null | -| `reserve` | null | -| `solar_unit` | a generating unit that uses solar power power to produce electricity | -| `thermal_unit` | a generating unit that uses a fuel to produce electricity | -| `transmission_line` | an electricity transmission line | -| `wind_unit` | a generating unit that uses wind power to produce electricity | - -#### Relationship classes - -| name | member classes | -|---------------------------------------------|---------------------------------------| -| `battery_storage_unit__from_electricity_node` | `battery_storage_unit` - `electricity_node` | -| `battery_storage_unit__to_electricity_node` | `battery_storage_unit` - `electricity_node` | -| `demand__electricity_node` | `demand` - `electricity_node` | -| `fuel_pipeline__from_fuel_storage` | `fuel_pipeline` - `fuel_storage` | -| `fuel_pipeline__to_fuel_storage` | `fuel_pipeline` - `fuel_storage` | -| `fuel_storage__thermal_unit` | `fuel_storage` - `thermal_unit` | -| `solar_unit__electricity_node` | `solar_unit` - `electricity_node` | -| `thermal_unit__electricity_node` | `thermal_unit` - `electricity_node` | -| `thermal_unit__reserve` | `thermal_unit` - `reserve` | -| `transmission_line__from_electricity_node` | `transmission_line` - `electricity_node` | -| `transmission_line__to_electricity_node` | `transmission_line` - `electricity_node` | -| `wind_unit__electricity_node` | `wind_unit` - `electricity_node` | - -#### Parameter definitions - -| class | name | -|----------------------|---------------------------| -| `battery_storage_unit` | `charging_capacity` | -| `battery_storage_unit` | `discharge_rate` | -| `battery_storage_unit` | `generation_capacity` | -| `battery_storage_unit` | `round_trip_efficiency` | -| `battery_storage_unit` | `storage_volume` | -| `demand` | `absolute_demand` | -| `demand` | `load_participation_factor` | -| `fuel_pipeline` | `capacity_backward` | -| `fuel_pipeline` | `capacity_forward` | -| `fuel_storage` | `fuel_cost` | -| `fuel_storage` | `storage_capacity` | -| `fuel_storage` | `initial_level` | -| `solar_unit` | `availability_factor` | -| `solar_unit` | `max_capacity` | -| `thermal_unit` | `forced_outage_rate` | -| `thermal_unit` | `idle_heat_rate` | -| `thermal_unit` | `incremental_heat_rate` | -| `thermal_unit` | `max_capacity` | -| `thermal_unit` | `min_stable` | -| `thermal_unit` | `minimum_down_time` | -| `thermal_unit` | `minimum_up_time` | -| `thermal_unit` | `ramp_down_rate` | -| `thermal_unit` | `ramp_up_rate` | -| `thermal_unit` | `shutdown_cost` | -| `thermal_unit` | `start_up_cost` | -| `thermal_unit` | `start_up_fuel_use` | -| `transmission_line` | `capacity_backward` | -| `transmission_line` | `capacity_forward` | -| `transmission_line` | `reactance` | -| `transmission_line` | `resistance` | -| `wind_unit` | `availability_factor` | -| `wind_unit` | `max_capacity` | - - - -### Hazard & metrics definition database - -It provides a simple data structure for developers to characterize standard hazards and associated metrics. The structure is easy to extend so that advanced users can define their own hazards and metrics if needed. - -A new hazard is defined in three steps: - -1. Enter a corresponding object in the `hazard` class. -2. Enter the corresponding `hazard__component` relationships between the above `hazard` object and any `component` objects that are affected by it. -3. Specify `mean_time_to_failure` and `mean_time_to_repair` for each of the above relationships. - -Applying a hazard to an energy system is simply a matter of generating the parameter values that reflect the hazard for each affected component. First, we look at `mean_time_to_failure` and `mean_time_to_repair` to generate a time-series for the component status. Then, for each parameter value that has the `failure` alternative, we generate a new time-series that is a copy of the status time-series but has the values for `Base` and `failure` in the points where the component is on and off, respectively. The resulting time-series is then used as the value of the parameter for the hazard situation. - -TODO: Metrics - -#### Object classes - -| name | description | -|---|---| -| `hazard` | a hazard that may affect the energy system | -| `component` | an energy system component - corresponding to an object class from the System template above | -| `metrics` | a metrics that reflects a specific consequence of a hazard on the system | - -#### Relationship classes - - -| name | member classes | description | -|---|---|---| -| `hazard__component` | `hazard` - `component` | indicates that a certain hazard may affect a certain system component | -| `hazard__metrics` | `hazard` - `metrics` | indicates that a certain hazard may trigger the computation of a certain metrics | - -#### Parameter definitions - -| class | name | description | -|---|---|---| -| `hazard__component` | `mean_time_to_failure` | The average amount of time, counted from the beginning of the simulation period, until the component fails due to the hazard. A value of 0 is interpreted as immediate failure with no possibility of reparation. | -| `hazard__component` | `mean_time_to_repair` | The average amount of time before the component is back in operation (disregarded if `mean_time_to_failure` is 0) | diff --git a/app/spine/projects/Nathan_20231113200948/miracl2spineopt.jl b/app/spine/projects/Nathan_20231113200948/miracl2spineopt.jl deleted file mode 100644 index 102c3bd..0000000 --- a/app/spine/projects/Nathan_20231113200948/miracl2spineopt.jl +++ /dev/null @@ -1,271 +0,0 @@ -using SpineInterface -using Dates - -url_in, url_out = ARGS - -function _do_work() - scens = [x["name"] for x in run_request(url_in, "query", ("scenario_sq",))["scenario_sq"]] - alts = [x["name"] for x in run_request(url_in, "query", ("alternative_sq",))["alternative_sq"]] - scen_alts = [ - (x["scenario_name"], x["alternative_name"], x["before_alternative_name"]) - for x in run_request( - url_in, "query", ("ext_linked_scenario_alternative_sq",) - )["ext_linked_scenario_alternative_sq"] - ] - data = Dict(:alternatives => alts, :scenarios => scens, :scenario_alternatives => scen_alts) - import_data(url_out, data, "Create hazard scenarios and alternatives") - for alt in alts - _import_alt_data(alt) - end -end - -function _import_alt_data(alt) - M = Module() - using_spinedb(url_in, M; filters=Dict("alternatives" => [String(alt)])) - objects = [] # Tuples (class, object) - object_pvals = [] # Tuples (class, object, parameter, value, alternative) - relationships = [] # Tuples (class, tuple of (object1, object2, ...)) - relationship_pvals = [] # Tuples (class, tuple of (object1, object2, ...), parameter, value, alternative) - data = Dict( - :objects => objects, - :object_parameter_values => object_pvals, - :relationships => relationships, - :relationship_parameter_values => relationship_pvals, - ) - # Model stuff - push!(objects, ("temporal_block", "flat")) - push!(objects, ("stochastic_structure", "deterministic")) - push!(objects, ("stochastic_scenario", "realisation")) - push!(objects, ("report", "basic_report")) - push!(relationships, ("stochastic_structure__stochastic_scenario", ("deterministic", "realisation"))) - push!(relationships, ("report__output", ("basic_report", "node_slack_pos"))) # For load not served metrics - push!(relationships, ("report__output", ("basic_report", "node_state"))) - push!(relationships, ("report__output", ("basic_report", "unit_flow"))) - push!(relationships, ("report__output", ("basic_report", "connection_flow"))) - for m in M.model() - push!(objects, ("model", m.name)) - push!(relationships, ("model__temporal_block", (m.name, "flat"))) - push!(relationships, ("model__default_temporal_block", (m.name, "flat"))) - push!(relationships, ("model__stochastic_structure", (m.name, "deterministic"))) - push!(relationships, ("model__default_stochastic_structure", (m.name, "deterministic"))) - push!(relationships, ("model__report", (m.name, "basic_report"))) - resolution = M.resolution(model=m, _strict=false) - model_start = M.model_start(model=m, _strict=false) - model_end = M.model_end(model=m, _strict=false) - roll_fwd = M.roll_forward(model=m, _strict=false) - is_active = M.is_active(model=m, _strict=false) - resolution === nothing || push!( - object_pvals, ("temporal_block", "flat", "resolution", unparse_db_value(resolution), alt) - ) - model_start === nothing || push!(object_pvals, ("model", m.name, "model_start", unparse_db_value(model_start), alt)) - model_end === nothing || push!(object_pvals, ("model", m.name, "model_end", unparse_db_value(model_end), alt)) - roll_fwd === nothing || push!(object_pvals, ("model", m.name, "roll_forward", unparse_db_value(roll_fwd), alt)) - is_active === nothing || push!(object_pvals, ("model", m.name, "is_active", unparse_db_value(is_active), alt)) - end - for n in M.reserve() - push!(objects, ("node", n.name)) - abs_req = M.absolute_requirement(reserve=n, _strict=false) - abs_req === nothing || push!(object_pvals, ("node", n.name, "demand", unparse_db_value(abs_req), alt)) - end - for (u, n) in M.thermal_unit__reserve() - push!(relationships, ("unit__to_node", (u.name, n.name))) - end - for n in M.electricity_node() - push!(objects, ("node", n.name)) - demands = (M.absolute_demand(demand=d, _strict=false) for d in M.demand__electricity_node(electricity_node=n)) - total_demand = sum(d for d in demands if d !== nothing; init=0) - if !iszero(total_demand) - push!(object_pvals, ("node", n.name, "demand", unparse_db_value(total_demand), alt)) - push!(object_pvals, ("node", n.name, "node_slack_penalty", 1, alt)) - end - balance_type = M.balance_type(electricity_node=n, _strict=false) - if balance_type == :infinite_supply - push!(object_pvals, ("node", n.name, "nodal_balance_sense", "<=", alt)) - end - end - for n in M.fuel_storage() - push!(objects, ("node", n.name)) - push!(object_pvals, ("node", n.name, "has_state", true, alt)) - end - for u in M.thermal_unit() - push!(objects, ("unit", u.name)) - mut = M.minimum_up_time(thermal_unit=u, _strict=false) - mut === nothing || push!(object_pvals, ("unit", u.name, "min_up_time", unparse_db_value(Hour(mut)), alt)) - mdt = M.minimum_down_time(thermal_unit=u, _strict=false) - mdt === nothing || push!(object_pvals, ("unit", u.name, "min_down_time", unparse_db_value(Hour(mdt)), alt)) - suc = M.start_up_cost(thermal_unit=u, _strict=false) - suc === nothing || push!(object_pvals, ("unit", u.name, "start_up_cost", suc, alt)) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!(relationships, ("unit__to_node", (u.name, n_to.name))) - cap = M.max_capacity(thermal_unit=u, _strict=false) - cap === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n_to.name), "unit_capacity", cap, alt) - ) - ms = M.min_stable(thermal_unit=u, _strict=false) - if !(ms === nothing) - if cap === nothing - @warn( - "A value for min_stable has been defined for thermal_unit $u ", - "but no value for `max_capacity` was found. min_stable is ignored for this unit") - else - min_val = ms / cap - push!( - relationship_pvals, - ("unit__to_node", (u.name, n_to.name), "minimum_operating_point", min_val, alt) - ) - end - end - end - end - for u in M.wind_unit() - push!(objects, ("unit", u.name)) - avf = M.availability_factor(wind_unit=u, _strict=false) - avf === nothing || push!(object_pvals, ("unit", u.name, "unit_availability_factor", unparse_db_value(avf), alt)) - for n in M.wind_unit__electricity_node(wind_unit=u) - push!(relationships, ("unit__to_node", (u.name, n.name))) - maxc = M.max_capacity(wind_unit=u, _strict=false) - maxc === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n.name), "unit_capacity", maxc, alt) - ) - end - end - for u in M.solar_unit() - push!(objects, ("unit", u.name)) - avf = M.availability_factor(solar_unit=u, _strict=false) - avf === nothing || push!(object_pvals, ("unit", u.name, "unit_availability_factor", avf, alt)) - for n in M.solar_unit__electricity_node(solar_unit=u) - push!(relationships, ("unit__to_node", (u.name, n.name))) - maxc = M.max_capacity(solar_unit=u, _strict=false) - maxc === nothing || push!( - relationship_pvals, ("unit__to_node", (u.name, n.name), "unit_capacity", maxc, alt) - ) - end - end - for c in M.fuel_pipeline() - faf = M.forced_availability_factor(fuel_pipeline=c, _strict=false) - if faf !== nothing - push!(object_pvals, ("connection", c.name, "forced_availability_factor", unparse_db_value(faf), alt)) - end - push!(objects, ("connection", c.name)) - end - for (c, n) in M.fuel_pipeline__from_fuel_storage() - push!(relationships, ("connection__from_node", (c.name, n.name))) - cap_bwd = M.capacity_backward(fuel_pipeline=c, _strict=false) - if cap_bwd !== nothing - push!( - relationship_pvals, - ("connection__from_node", (c.name, n.name), "connection_capacity", unparse_db_value(cap_bwd), alt) - ) - end - end - for (c, n) in M.fuel_pipeline__to_fuel_storage() - push!(relationships, ("connection__to_node", (c.name, n.name))) - cap_fwd = M.capacity_forward(fuel_pipeline=c, _strict=false) - if cap_fwd !== nothing - push!( - relationship_pvals, - ("connection__to_node", (c.name, n.name), "connection_capacity", unparse_db_value(cap_fwd), alt) - ) - # FIXME: We add a small negative cost so that the pipeline fills the receiving storage. - # This is important in rolling optimizations that cannot see the full horizon at once. - push!( - relationship_pvals, - ("connection__to_node", (c.name, n.name), "connection_flow_cost", -1, alt) - ) - end - end - for c in M.transmission_line() - push!(objects, ("connection", c.name)) - react = M.reactance(transmission_line=c, _strict=false) - react === nothing || push!(object_pvals, ("connection", c.name, "connection_reactance", react, alt)) - resist = M.resistance(transmission_line=c, _strict=false) - resist === nothing || push!(object_pvals, ("connection", c.name, "connection_resistance", resist, alt)) - faf = M.forced_availability_factor(transmission_line=c, _strict=false) - if faf !== nothing - push!(object_pvals, ("connection", c.name, "forced_availability_factor", unparse_db_value(faf), alt)) - end - end - for (c, n_from) in M.transmission_line__from_electricity_node() - push!(relationships, ("connection__from_node", (c.name, n_from.name))) - push!(relationships, ("connection__to_node", (c.name, n_from.name))) - cap_fwd = M.capacity_forward(transmission_line=c, _strict=false) - cap_fwd === nothing || push!( - relationship_pvals, - ("connection__from_node", (c.name, n_from.name), "connection_capacity", cap_fwd, alt) - ) - cap_bwd = M.capacity_backward(transmission_line=c, _strict=false) - cap_bwd === nothing || push!( - relationship_pvals, - ("connection__to_node", (c.name, n_from.name), "connection_capacity", cap_bwd, alt) - ) - for n_to in M.transmission_line__to_electricity_node(transmission_line=c) - push!(relationships, ("connection__from_node", (c.name, n_to.name))) - push!(relationships, ("connection__to_node", (c.name, n_to.name))) - push!(relationships, ("connection__node__node", (c.name, n_from.name, n_to.name))) - push!(relationships, ("connection__node__node", (c.name, n_to.name, n_from.name))) - push!( - relationship_pvals, - ("connection__node__node", (c.name, n_from.name, n_to.name), "fix_ratio_out_in_connection_flow", 1, alt) - ) - push!( - relationship_pvals, - ("connection__node__node", (c.name, n_to.name, n_from.name), "fix_ratio_out_in_connection_flow", 1, alt) - ) - end - end - for (n_fuel, u) in M.fuel_storage__thermal_unit() - push!(relationships, ("unit__from_node", (u.name, n_fuel.name))) - for n_elec in M.thermal_unit__electricity_node(thermal_unit=u) - push!(relationships, ("unit__to_node", (u.name, n_elec.name))) - push!(relationships, ("unit__node__node", (u.name, n_fuel.name, n_elec.name))) - end - end - for u in indices(M.idle_heat_rate) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_idle_heat_rate", M.idle_heat_rate(thermal_unit=u), - alt - ) - ) - end - end - end - for u in indices(M.incremental_heat_rate) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_incremental_heat_rate", - M.incremental_heat_rate(thermal_unit=u), alt - ) - ) - end - end - end - for u in indices(M.start_up_fuel_use) - for n_from in M.fuel_storage__thermal_unit(thermal_unit=u) - for n_to in M.thermal_unit__electricity_node(thermal_unit=u) - push!( - relationship_pvals, - ( - "unit__node__node", - (u.name, n_from.name, n_to.name), - "unit_start_flow", - M.start_up_fuel_use(thermal_unit=u), alt - ) - ) - end - end - end - import_data(url_out, data, "Import data for alternative $alt") -end - -_do_work() \ No newline at end of file diff --git a/app/spine/projects/Nathan_20231113200948/run_spineopt.jl b/app/spine/projects/Nathan_20231113200948/run_spineopt.jl deleted file mode 100644 index a651113..0000000 --- a/app/spine/projects/Nathan_20231113200948/run_spineopt.jl +++ /dev/null @@ -1,20 +0,0 @@ -using SpineOpt - -run_spineopt(ARGS...) - -# The above uses the default solvers which are currently CLP for LP problems and Cbc for MIP problems -# The below is an example for using the CPLEX solver. Other solvers follow a similar form -#= -using SpineOpt -using CPLEX -using JuMP - -run_spineopt( - ARGS..., - mip_solver=optimizer_with_attributes( - CPLEX.Optimizer, - "CPX_PARAM_EPGAP" => 0.01 - ), - lp_solver=optimizer_with_attributes(CPLEX.Optimizer) -) -=# diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index b5717dc..61c8751 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -5,7 +5,7 @@ services: build: context: app dockerfile: Dockerfiles/Dockerfile.dev - command: "tail -f /dev/null" + entrypoint: ./entrypoint.local.sh ports: - 5000:5000 volumes: