Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General Development Updates #162

Merged
merged 85 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
6260163
Use global vars and os.path.join
willu47 Feb 16, 2021
79b271b
Encapsulate filter, add simple cli
willu47 Feb 16, 2021
6642c02
Treat src as a package
willu47 Feb 16, 2021
5765ca1
Extract methods
willu47 Feb 16, 2021
34272e9
Extract methods weo
willu47 Feb 16, 2021
a54f6e2
Extract method: final costs
willu47 Feb 16, 2021
3611c91
Extract method: averge iar
willu47 Feb 16, 2021
1cbdbfa
Extract method: residual capacity
willu47 Feb 16, 2021
d602c84
Extract method: generator table
willu47 Feb 17, 2021
76263c1
Remove unused aggregated capacity
willu47 Feb 17, 2021
22cc31b
Extract method: iar and oar
willu47 Feb 17, 2021
1195dbd
Linting and tidying
willu47 Feb 17, 2021
e8d0c27
Updated gitignore
willu47 Feb 22, 2021
753e7d2
Added packaging, documentation and test files
willu47 Feb 22, 2021
063a981
Added xlrd to deps, and put naming into docs
willu47 Feb 22, 2021
c0908dd
Remove all output data and duplicate files
willu47 Feb 22, 2021
3b498c2
Merge pull request #37 from OSeMOSYS/plexos_function
willu47 Mar 19, 2021
b1b51c1
Merge branch 'develop' into package
willu47 Mar 19, 2021
159a852
Merge pull request #38 from ClimateCompatibleGrowth/package
willu47 Mar 19, 2021
2339ad1
Merge branch 'zenodo' into develop
willu47 Mar 25, 2021
b1f26f4
refactor existing viz
trevorb1 Feb 17, 2023
73adbbb
dashboard with input data
trevorb1 Feb 28, 2023
ba3d656
update to otoole v1.0.0
trevorb1 Feb 28, 2023
0fc325d
merge main into develop
trevorb1 Mar 1, 2023
4c12da6
Merge branch 'develop' into otoole-version-bump
trevorb1 Mar 1, 2023
0acae2f
Merge pull request #148 from OSeMOSYS/otoole-version-bump
trevorb1 Mar 1, 2023
ffea8c5
result data done
trevorb1 Mar 1, 2023
3d2393a
transmission tab added
trevorb1 Mar 1, 2023
ce657bc
Merge branch 'develop' into dashboard
trevorb1 Mar 1, 2023
5b5f688
update envs
trevorb1 Mar 1, 2023
26bfd6d
added dashboard to workflow
trevorb1 Mar 2, 2023
fdb2794
removed outdated notebooks
trevorb1 Mar 2, 2023
5fff85e
fixed var costs
trevorb1 Mar 2, 2023
1b24a6c
added bar chart
trevorb1 Mar 2, 2023
466f8cb
removed saving options
trevorb1 Mar 2, 2023
110c4c0
updated envs
trevorb1 Mar 2, 2023
f9476be
fixed bug in env file
trevorb1 Mar 2, 2023
a42120a
removed i18n dependency
trevorb1 Mar 3, 2023
1539e4a
restore config
trevorb1 Mar 3, 2023
c7bfdb8
added dashboard script
trevorb1 Mar 5, 2023
d2e9f1c
added all option for result tab
trevorb1 Mar 5, 2023
2b6b265
added directional flow
trevorb1 Mar 6, 2023
74f6895
fixed options saving
trevorb1 Mar 6, 2023
fc91960
added docs
trevorb1 Mar 6, 2023
7434875
removed dashboard rule
trevorb1 Mar 6, 2023
373b45d
minor bug fixes
trevorb1 Mar 7, 2023
8faf05d
Merge pull request #149 from OSeMOSYS/dashboard
trevorb1 Mar 7, 2023
d1000b6
restored trade flow figs
trevorb1 Mar 7, 2023
2848269
Merge pull request #150 from OSeMOSYS/trad-fig
trevorb1 Mar 7, 2023
2efba96
project build workflow
trevorb1 Mar 7, 2023
c735d3d
update change log
trevorb1 Mar 7, 2023
ee08369
transmission capacity map update
trevorb1 Mar 14, 2023
28a28ce
transmission flow map update
trevorb1 Mar 14, 2023
6f56fbf
minor bug fix
trevorb1 Mar 14, 2023
76b811c
remove basemap
trevorb1 Mar 14, 2023
117cc3a
Merge branch 'develop' into add-github-build-action
trevorb1 Mar 14, 2023
076d5c9
update transmission oplife
trevorb1 Mar 14, 2023
ab4ed9d
Merge pull request #151 from OSeMOSYS/transmission-line-update
trevorb1 Mar 14, 2023
b1d340d
fixed dependencies
trevorb1 Mar 14, 2023
ced9de9
fixed cartopy install
trevorb1 Mar 14, 2023
b12a379
updated action
trevorb1 Mar 14, 2023
1f30bf5
Update build.yaml
trevorb1 Mar 14, 2023
cd941c9
Update build.yaml
trevorb1 Mar 14, 2023
cce612d
Update build.yaml
trevorb1 Mar 14, 2023
eadf822
Merge pull request #152 from OSeMOSYS/add-github-build-action
trevorb1 Mar 14, 2023
c430f6e
env update
trevorb1 Mar 14, 2023
e9c9814
added og pip install
trevorb1 Mar 14, 2023
1bac7ae
updated docs
trevorb1 Mar 15, 2023
fce7775
dashboard default update
trevorb1 Mar 16, 2023
6d7ac3e
Merge branch 'develop' of https://github.com/OSeMOSYS/osemosys_global…
trevorb1 Mar 16, 2023
0616a4e
docs typo
trevorb1 Apr 16, 2023
3edf6d0
Merge branch 'develop' of https://github.com/OSeMOSYS/osemosys_global…
trevorb1 Jun 5, 2023
c6368cf
Merge branch 'master' into develop
trevorb1 Sep 27, 2023
247e460
fix import issue
trevorb1 Sep 27, 2023
85fce91
update viz config paths
trevorb1 Sep 27, 2023
f3f688c
viz fixes
trevorb1 Sep 27, 2023
4be4896
fix paths in viz
trevorb1 Sep 27, 2023
6d398f5
remove testing rule
trevorb1 Sep 27, 2023
d938dfc
fix type issue in viz arguments
trevorb1 Sep 27, 2023
eaa9f3f
fix transmission plots
trevorb1 Sep 27, 2023
c2f4701
fix dashboard
trevorb1 Sep 27, 2023
f9b7e56
hardcode file ref issue
trevorb1 Sep 27, 2023
1b0bc6a
fix imports on dashboard
trevorb1 Sep 27, 2023
43f4506
restore notebooks
trevorb1 Sep 27, 2023
996e56e
fix versions
trevorb1 Sep 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python build

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:

- name: checkout repo
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install cartopy dependencies
run: sudo apt-get -y install libgeos-dev

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .

- name: Test with pytest
run: |
tox
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "OSeMOSYS_GNU_MathProg"]
path = resources/OSeMOSYS_GNU_MathProg
url = https://github.com/OSeMOSYS/OSeMOSYS_GNU_MathProg
[submodule "simplicity"]
path = resources/simplicity
url = https://github.com/OSeMOSYS/simplicity
26 changes: 0 additions & 26 deletions .zenodo.json

This file was deleted.

2 changes: 2 additions & 0 deletions dashboard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env python
python workflow/scripts/osemosys_global/dashboard/app.py
1 change: 0 additions & 1 deletion docs/_static/.gitignore

This file was deleted.

88 changes: 87 additions & 1 deletion docs/advanced-functionality.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,90 @@ Then run the workflow as normal from the root directory

```bash
snakemake -c
```
```

## Interactive Dashboard

If a user wishes to explore input and output data, OSeMOSYS Global includes
an interactive dashboard to do this. This dashboard can only be run
after a successful model run.

### 1. Ensure the OSeMOSYS Global scenario has been run

The dashboard is **not** integreated with the snakemake workflow, therefore,
it will not automatically look for missing input files. Ensure that the
workflow has been run and that input data CSVs (`results/<scenario>/data/`)
and result file CSVs (`results/<scenario>/results/`) exist. Moreover,
ensure the scenario name in the configuration file matches the paths to the
result data.

### 2. Run the dashboard

Run the file `dashboard.sh` to start the dashboard in a local host with the
following command. Either open the hyperlink from the command line or
copy/paste it into a web browser.

```bash
bash dashboard.sh
```

### 3. Explore the dashboard

The dashboard is to visualize the input and result data from an OSeMOSYS Global
model run. The dashboard consists of 5 tabs; tab 1 is a options tab, and the
remaining tabs are different visualization options (described below).

:::{warning}
For large models, the dashboard my be slow to respond. Especially for
parameters/varibales plotted over timeslices, rather than years; for example
the `ProductionByTechnologyAnnual` plot will respond much quicker than the
``ProductionByTechnology` plot.
:::

#### 3.1 Options Tab

Global plotting options for the dashboard. Of note is the Geographic Scope
radio buttons. If the option is set to System, the legend axis in graphs will
be by technology. If the option is set to Country or Region, the legend axis
will be country or region respectively.

#### 3.2 Geographic Overview Tab

Allows the user to visualize what nodes and transmission lines are (and are
not) included in the model. The user can hover over each node/line to get the
corresponding node and line name.

:::{warning}
Any custom nodes added are not included in this map, as latitudes and longitudes
are not added with custom nodes. All other tabs will correctly incorporate
custom node data.
:::

#### 3.3 Input Data Tab

Plots input data. The plot will take on the values described in the options tab.
The technology fuel dropdown is dynamic, based on the user parameter selection. This
means if a technology or fuel is not listed in the dropdown, there is no
associated data with it. The plotting options include Area, Line, Stacked Bar
and Grouped Bar.

#### 3.4 Result Data Tab

Plots result data. The plot will take on the values described in the options tab.
The technology fuel dropdown is dynamic, based on the user variable selection. This
means if a technology or fuel is not listed in the dropdown, there is no
associated data with it. The plotting options include Area, Line, Stacked Bar
and Grouped Bar.

#### 3.5 The Options Tab

Plots transmission line result data. The user can select between plotting
at a system level, or for individual lines. Moreover, the variables include
poltting options for either directional flow (inports vs. exports) over the
line, or total magnitdue of flow. The plotting options include Area, Line,
Stacked Bar and Grouped Bar.

### 4. Quit the dashboard

To exit the dashboard, close the tab/browser that has the dashboard open, and
press `ctrl+c` or `cmd+c` from the command line. This will stop the local host.
69 changes: 69 additions & 0 deletions docs/api/osemosys_global.dashboard.components.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
osemosys\_global.dashboard.components package
=============================================

Submodules
----------

osemosys\_global.dashboard.components.ids module
------------------------------------------------

.. automodule:: osemosys_global.dashboard.components.ids
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.components.input\_data\_tab module
-------------------------------------------------------------

.. automodule:: osemosys_global.dashboard.components.input_data_tab
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.components.map\_tab module
-----------------------------------------------------

.. automodule:: osemosys_global.dashboard.components.map_tab
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.components.options\_tab module
---------------------------------------------------------

.. automodule:: osemosys_global.dashboard.components.options_tab
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.components.result\_data\_tab module
--------------------------------------------------------------

.. automodule:: osemosys_global.dashboard.components.result_data_tab
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.components.shared module
---------------------------------------------------

.. automodule:: osemosys_global.dashboard.components.shared
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.components.transmission\_tab module
--------------------------------------------------------------

.. automodule:: osemosys_global.dashboard.components.transmission_tab
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: osemosys_global.dashboard.components
:members:
:undoc-members:
:show-inheritance:
45 changes: 45 additions & 0 deletions docs/api/osemosys_global.dashboard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
osemosys\_global.dashboard package
==================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

osemosys_global.dashboard.components

Submodules
----------

osemosys\_global.dashboard.app module
-------------------------------------

.. automodule:: osemosys_global.dashboard.app
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.constants module
-------------------------------------------

.. automodule:: osemosys_global.dashboard.constants
:members:
:undoc-members:
:show-inheritance:

osemosys\_global.dashboard.utils module
---------------------------------------

.. automodule:: osemosys_global.dashboard.utils
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: osemosys_global.dashboard
:members:
:undoc-members:
:show-inheritance:
Loading