{"id":20612608,"url":"https://github.com/pypsa/whobs-server","last_synced_at":"2025-08-21T13:32:54.298Z","repository":{"id":84861549,"uuid":"163748548","full_name":"PyPSA/whobs-server","owner":"PyPSA","description":"Online optimisation tool for wind+solar+storage systems","archived":false,"fork":false,"pushed_at":"2024-11-16T14:06:43.000Z","size":565,"stargazers_count":36,"open_issues_count":9,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-18T20:22:56.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PyPSA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-01T15:58:29.000Z","updated_at":"2024-11-16T14:06:46.000Z","dependencies_parsed_at":"2023-09-21T19:15:47.098Z","dependency_job_id":"35e4030d-45d2-4ab6-948f-6c896829c411","html_url":"https://github.com/PyPSA/whobs-server","commit_stats":{"total_commits":161,"total_committers":2,"mean_commits":80.5,"dds":"0.037267080745341574","last_synced_commit":"dbc6726e600dce7dbd62f7b7f0ac2871df0990c5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fwhobs-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fwhobs-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fwhobs-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fwhobs-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyPSA","download_url":"https://codeload.github.com/PyPSA/whobs-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230516191,"owners_count":18238353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T11:05:50.403Z","updated_at":"2024-12-20T00:08:42.568Z","avatar_url":"https://github.com/PyPSA.png","language":"Python","readme":"\n# model.energy: online optimisation of energy systems\n\nThis is the code for the online optimisation of zero-direct-emission\nelectricity systems with wind, solar and storage (using batteries and\nelectrolysed hydrogen gas) to provide a baseload electricity demand,\nusing the cost and other assumptions of your choice. It uses only free\nsoftware and open data, including [Python for Power System Analysis\n(PyPSA)](https://github.com/PyPSA/PyPSA) for the optimisation\nframework, the European Centre for Medium-Range Weather Forecasts\n(ECMWF) [ERA5\ndataset](https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels)\nfor the open weather data, the [atlite\nlibrary](https://github.com/FRESNA/atlite) for converting weather data\nto generation profiles, [Clp](https://projects.coin-or.org/Clp) for\nthe solver, [D3.js](https://d3js.org/) for graphics,\n[Mapbox](https://www.mapbox.com/), [Leaflet](http://leafletjs.com/)\nand [Natural Earth](https://www.naturalearthdata.com/) for maps, and\nfree software for the server infrastructure (GNU/Linux, nginx, Flask,\ngunicorn, Redis).\n\nYou can find a live version at:\n\n\u003chttps://model.energy/\u003e\n\n\n## Requirements\n\n### Software\n\nThis software has only been tested on the Ubuntu distribution of GNU/Linux.\n\nUbuntu packages:\n\n`sudo apt install coinor-clp coinor-cbc redis-server`\n\nTo install, we recommend using [miniconda](https://docs.conda.io/en/latest/miniconda.html) in combination with [mamba](https://github.com/QuantStack/mamba).\n\n\tconda install -c conda-forge mamba\n\tmamba env create -f environment.yaml\n\nFor (optional) server deployment:\n\n\tsudo apt install nginx\n\tmamba install gunicorn\n\n\n### Automatic preparation\n\nAfter installing the dependencies above, run the following line of code:\n\n\tpython prepare.py\n\nThis helps you:\n\n1. Fetch the pre-processed wind and solar data for the globe (around 6.5 GB per weather year specified in `config.yaml`)\n1. Create folders for results\n1. Fetch static files not included in this repository\n\nNow you are ready to [run the server locally](#run-server-locally-on-your-own-computer).\n\n### Generating wind and solar data yourself\n\nThe script `prepare.py` will download everything you need to get\nstarted, including the pre-processed wind and solar data for the\nglobe. If you want to build this data from scratch from wind and solar\ndata, follow these instructions. Be warned that the global datasets\ntake space of 444 GB per weather year.\n\nFor the wind and solar generation time series, we use the European\nCentre for Medium-Range Weather Forecasts (ECMWF) [ERA5\ndataset](https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels).\n\nFirst you need to download the weather data (e.g. wind speeds, direct\nand diffuse solar radiation) as cutouts, then you need to convert them\nto power system data for particular wind turbines and solar\npanels. The weather data is in a 0.25 by 0.25 degree spatial\nresolution grid for the whole globe, but to save space, we downscale\nit to 0.5 by 0.5 degrees.\n\nData is downloaded from the European [Climate Data Store\n(CDS)](https://cds.climate.copernicus.eu/) using the [atlite\nlibrary](https://github.com/FRESNA/atlite) using the script:\n\n`python build_cutouts.py`\n\nNote that you need to register an account on the CDS first in order to\nget a CDS API key.\n\nAs of 19.03.2023 the atlite master cannot cope with such large\ncutouts, so you need to use the [monthly retrieval\nbranch](https://github.com/PyPSA/atlite/tree/feat/era5-monthly-retrieveal)\nof atlite. If you have shapely 2.0 you will need to backport [this bug\nfix](https://github.com/PyPSA/atlite/blob/ad6c9f5a076054e2b953666076447729e33c2fb0/atlite/gis.py#L150)\nby hand in the code.\n\n\nSet the `weather_years` you want to download in `config.yaml`. For\neach year it will download 4 quadrants cutouts (4 slices of 90 degrees\nof longitude) to cover the whole globe. Each quadrant takes up 111 GB,\nso you will need 444 GB per year.\n\nTo build the power system data, i.e. wind and solar generation time\nseries for each point on the globe, run the script:\n\n`python convert_and_downscale_cutout.py`\n\nEach quadrant is split into two octants, one for the northern half of\nthe quadrant with solar panels facing south, and the other for the\nsouthern half with solar panels facing north (with a slope of 35\ndegrees against the horizontal in both cases). The script downscales\nthe spatial resolution to 0.5 by 0.5 degrees to save disk space. Each\noctant takes up 820 MB for both technologies (solar and onshore wind),\nso in total for a year we have 820 MB times 8 octants, i.e. 6.5 GB.\n\n\n## Run without server\n\nSee the regular [WHOBS](https://github.com/PyPSA/WHOBS) repository.\n\n## Run server locally on your own computer\n\nTo run locally you need to start the Python Flask server in one terminal, and redis in another:\n\nStart the Flask server in one terminal with:\n\n`python server.py`\n\nThis will serve to local address:\n\nhttp://127.0.0.1:5002/\n\nIn the second terminal start Redis:\n\n`rq worker whobs`\n\nwhere `whobs` is the name of the queue. No jobs will be solved until\nthis is run. You can run multiple workers to process jobs in parallel.\n\n\n## Deploy on a publicly-accessible server\n\nUse nginx, gunicorn for the Python server, rq, and manage with supervisor.\n\nSee [nginx server configuration](nginx-configuration.txt).\n\n\n## License\n\nCopyright 2018-2023 Tom Brown \u003chttps://nworbmot.org/\u003e\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as\npublished by the Free Software Foundation; either [version 3 of the\nLicense](LICENSE.txt), or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the [GNU\nAffero General Public License](LICENSE.txt) for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fwhobs-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpypsa%2Fwhobs-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fwhobs-server/lists"}