Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: pbl-nl
  • License: apache-2.0
  • Language: Svelte
  • Default Branch: main
  • Size: 1.96 MB
Statistics
  • Stars: 1
  • Watchers: 4
  • Forks: 1
  • Open Issues: 25
  • Releases: 0
Created over 2 years ago · Last pushed 10 months ago
Metadata Files
Readme License Citation

README.md

Carbon Budget Explorer (CABE)

CI

Web application to explore carbon budgets

The web application is written with SveltKit.

Data requirements and configuration

Should have the following data files:

  1. {CABE_DATA_DIR} / "ne_110m_admin_0_countries.geojson" - can be downloaded with npm run download:borders and move downloaded file to CABEDATADIR directory.
  2. {CABE_DATA_DIR} / "xr_policyscen.nc"- Policy scenario data
  3. {CABE_DATA_DIR} / {CABE_START_YEAR} / "xr_dataread.nc" - Global data
  4. {CABE_DATA_DIR} / {CABE_START_YEAR} / {CABE_ASSUMPTIONSET} / "Allocations" / "xr_alloc_{REGION}.nc" - Region specific data
  5. {CABE_DATA_DIR} / {CABE_START_YEAR} / {CABE_ASSUMPTIONSET} / "Aggregated_files" / "xr_alloc_{YEAR}.nc" - Aggregated data

The CABE_DATA_DIR variable is the path to the data directory. The CABE_START_YEAR variable is the start year of the allocation. The CABE_ASSUMPTIONSET variable encodes assumptions on which gases are included (GHG or CO2_only) and land use (included/excluded). The REGION variable is the 3 letter ISO code of the region. The YEAR variable is the year of the allocation.

The CABE_ variables are defined in the .env file. See .env.example file for an example. To run the application the .env file is required.

Software requirements

You should have Node.js (v22 or greater) and Python 3.12 installed.

Dependencies can be installed with

```bash

From the root of the repository

To install Node.js dependencies

npm install

To install Python dependencies

pip install -r requirements.txt ```

Software installation on Windows

Use miniforge to setup Python and Node.js.

  1. From https://conda-forge.org/download download the latest Miniforge3 Windows 64-bit installer and install it.
  2. Open a PowerShell
  3. Create environment with mamba create --name cabe python=3.12 nodejs=22
  4. Activate environment with mamba activate cabe
  5. Change the current working directory to the location where you want to clone the repository. For example cd C:\Users\username\Documents.
  6. Clone repo with git clone https://github.com/pbl-nl/website-carbon-budget-explorer.git or use Visual Studio Code to clone repository.
  7. Change the current working directory to the repository with cd website-carbon-budget-explorer.
  8. Install Python dependencies with pip install -r requirements.txt
  9. Install Node.js dependencies with npm install

If git executable is not installed, then install with mamba install git.

If mamba executable is not available, use conda instead.

Do not forget to activate the environment with mamba activate cabe before running the commands below.

API service

The API web service reads the NetCDF files and returns the data as JSON which is used in the web application.

It is written in Python using Flask and xarray.

On Linux and MacOS the web service can be started with

bash gunicorn --bind 0.0.0.0:5000 --workers 4 'ws:app'

(Add --reload argumment to reload on Python file changes)

On Windows, use flask built-in developer server.

shell flask --app ws:app run -p 5000

If an error occurs here, try out different ports (e.g. 5001, 5005 etc). Also adjust the changed port in the .env file. To see the routes of the web service use

bash flask --app ws:app routes -s rule

Developing

Start a development server:

```bash npm run dev

or start the server and open the app in a new browser tab

npm run dev -- --open ```

Formatting & linting

The code is formatted with Prettier using

bash npm run format

The code can be linted, using Prettier and eslint, with

bash npm run lint

The code can be checked with

bash npm run check

The Python web service (ws.py) can be formatted and linted with Ruff

bash pip install ruff ruff check ruff format

Testing

The unit test can be run with

bash npm run test:unit

For coverage, run

bash npm run test:unit -- run --coverage

The end-to-end test can be run with

bash npm run test

Building

To create a production version of your app:

bash npm run build

You can run the production build with

bash node --env-file=.env build/index.js

The web application server expects the Python web service to be running on http://127.0.0.1:5000.

Caching

The web application (aka the backend for the frontend aka SvelteKit server) caches the web service requests aggressively. It will use up to 1GB of memory for caching api requests made directly by browser and another 1Gb of memory for caching api requests made by the backend for the frontend.

If you changed the data then the web service and the web application server must be restarted.

Owner

  • Name: PBL Planbureau voor de Leefomgeving
  • Login: pbl-nl
  • Kind: organization
  • Location: Netherlands

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Carbon Budget Explorer
message: >-
  Web application to visualize countries' carbon emission
  pathways under various views on fairness.
type: software
authors:
  - given-names: Peter
    family-names: Kalverla
    email: p.kalverla@esciencecenter.nl
    affiliation: Netherlands eScience Center
    orcid: 'https://orcid.org/0000-0002-5025-7862'
  - given-names: Stefan
    family-names: Verhoeven
    email: s.verhoeven@esciencecenter.nl
    affiliation: Netherlands eScience Center
    orcid: 'https://orcid.org/0000-0002-5821-2060'
  - given-names: Mark
    family-names: Dekker
    email: mark.dekker@pbl.nl
    affiliation: Netherlands Environmental Assessment Agency
    orcid: 'https://orcid.org/0000-0002-3543-6889'
repository-code: 'https://github.com/pbl-nl/website-carbon-budget-explorer'
url: 'https://www.carbonbudgetexplorer.eu'
abstract: >-
  Many countries commit to rapid climate action, but their
  ambitions don't add up to reach the Paris goals. It is not
  trivial to define which countries should do more. This is
  a matter of fairness. But what is fair in this context?
  Should rich countries mitigate more, because they have the
  means to do so? Or the countries that have emitted a lot
  in the past? Clearly, there is no single answer, because
  it depends on what you think is fair. However, these
  principles can be quantified. The Carbon Budget Explorer
  allows navigating through the implications of different
  views on fairness.
keywords:
  - Climate change
  - Carbon budget
  - Fair shares
  - Climate policy
license: Apache-2.0

GitHub Events

Total
  • Issues event: 61
  • Delete event: 20
  • Member event: 1
  • Issue comment event: 112
  • Push event: 102
  • Pull request review event: 45
  • Pull request review comment event: 30
  • Pull request event: 57
  • Fork event: 1
  • Create event: 20
Last Year
  • Issues event: 61
  • Delete event: 20
  • Member event: 1
  • Issue comment event: 112
  • Push event: 102
  • Pull request review event: 45
  • Pull request review comment event: 30
  • Pull request event: 57
  • Fork event: 1
  • Create event: 20

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 30
  • Total pull requests: 31
  • Average time to close issues: 5 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 1.17
  • Average comments per pull request: 0.97
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 26
  • Pull requests: 31
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 19 days
  • Issue authors: 4
  • Pull request authors: 4
  • Average comments per issue: 0.96
  • Average comments per pull request: 0.97
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sverhoeven (12)
  • MarkMDekker (8)
  • chantalwuer (6)
  • Peter9192 (3)
Pull Request Authors
  • sverhoeven (23)
  • chantalwuer (3)
  • Peter9192 (3)
  • MarkMDekker (1)
Top Labels
Issue Labels
enhancement (4) urgent (1) documentation (1) question (1) bug (1)
Pull Request Labels
enhancement (1) urgent (1)