The goal of drem is to:
- Download Dublin energy-related data (from SEAI, the CSO etc.)
- Transform this data into a bottom-up energy demand model for Dublin
drem uses open-source software and open-access data to enable:
- Reproducibility
- Usage of 'Live'/up-to-date data sources
-
To install
drem:Warning: you must accept all permissions-related requests made by
VSCodeand docker (to unblock your firewall and grant access to your C-Drive)-
Install
dockerdremneedsDocker Desktopto be running. You should see a small docker whale in your toolbar after installation!If you have trouble installing
dockerplease see FAQ -
Download
dremas a ZIP (by selecting the greenCodebutton at the top of thedremgithub page) and unzip itIf you are familiar with
gitsee Setup development environment -
Open the
dremfolder inVSCodeby selecting 'File > Open Folder' -
Select 'Extensions' on the side-bar and install the “Remote - Containers” extension (or install directly from here)
-
Reopen the
dremfolder in a container by selecting 'Reopen in Container' in the popup menu or by opening the Command Palette (via View > Command Palette or by Ctrl + Shft + P) and searching 'Remote-Containers: Reopen in Container'If you want to view the installation progress click on 'Starting Dev Container (show log)' and once the installation is complete (files will appear in the left sidebar) click the + symbol in your Terminal window.
-
-
To run
drem(and consequently download & transform alldremrelated data):-
Launch
Jupyter Notebook:-
Enter
jnbookin theVSCodeTerminal -
Copy and paste the resulting URL to your browser (or Ctrl + Click)
It should look like http://127.0.0.1:8888/?token=aa69433d1370ab87a15436c27cd3f6948f77539a6bbeb6ee
-
-
Open
run-drem.ipynband ...-
Register your email address with SEAI at https://ndber.seai.ie/BERResearchTool/Register/Register.aspx
-
Fill in your email address in the notebook
-
Run all cells by selecting Cell > Run (or by manually running each cell via the Run button or by clicking each cell followed by Shft + Enter)
-
-
-
To update your local
dremcode:- Re-download
dremas a ZIP - (Optional) Copy & paste the files in drem/data/external across from the old version to the new version to skip redownloading of files
- Re-download
prefectto orchestrate alldremtasks via a data pipelinepandasto transform columnar datageopandasto transform columnar geospatial datarequeststo download datapypostalto standardise and parse address string columnsdockerto create a reproducible build environment that runs on Windows, OSX and Linuxgitto track code changes
-
Residential buildings:
-
SEAI's 2016 Census Small Area Statistics, Geometries & Glossary.
-
SEAI's BER Public Search: dwelling fabric information.
-
Dublin Postcodes Geometries (created by Shane McGuinness of Trinity College Dublin).
-
CRU Smart Meter Trials 2009-10: 15-minute resolution demands & participant surveys ... available upon request.
-
-
Commercial:
-
Valuation Office data: commercial building floor areas etc.
-
SEAI Dublin Measurement & Verification data: annual gas/electricity demands for Public sector buildings ... available upon request.
-
See energy-modelling-ireland/energy-data-sources for more Irish-specific energy sources.
Here's a brief overview of what each file and directory in drem does:
│
├── .github <- Scripts to run Github Actions CI
├── src <- Source code for use in this project.
│ ├── extract/ <- Scripts to download data
│ ├── transform/ <- "" clean data
│ ├── load/ <- "" load data to files or databases
│ └── etl.py <- Orchestrates Extract, Transform, Load via prefect
│
├── tests <- Scripts to test src code via pytest
│
├── data
│ ├── external <- Data from third party sources
│ ├── interim <- Intermediate data that has been transformed
│ ├── processed <- Final, canonical data sets for modeling
│ └── raw <- Original, immutable data dump (closed source)
│
├── externals <- External libraries used by drem
├── .gitignore <- Specifies files and folders to be ignored by source control
├── .pre-commit-config.yaml <- pre-commit hooks
├── LICENSE <- Terms & conditions for library usage etc.
├── README.md <- Executive Summary of library
├── poetry.lock <- Used by Poetry to store dependencies
├── pyproject.toml <- "" to setup library
├── Dockerfile <- Used by docker to create the drem development environment
└── setup.cfg <- Used by flake8 for linting style
Inspired by cookiecutter-data-science
For more information see:
- Extract, Transform, Load with Prefect
- Pytest
- Github Actions for Continuous Integration (CI)
- Pre-commit hooks
- Poetry for library setup
- flake8, we-make-python-style-guide for checking style issues
- externals
- libpostal enables fuzzy address matching
- nominatim-docker enables creation of local Nominatim server for geocoding at scale via OpenStreetMaps
If you've never contributed to an open-source project before checkout (or are new to
git) first-contributions. They even have aVSCode-specific section
-
Clone
dreminstead of downloading a zip file asgitlets you updatedremwithout having to manually redownload it: -
Set your local
VSCodePython Interpretor to your localpoetryvirtualenvPython- Run
poetry shell(to entervirtualenv) followed bywhich python(to get the filepath tovirtualenvPython) - Set your Python Interpretor by opening the Command Palette (via View > Command Palette or by Ctrl + Shft + P), searching “Python: Select Interpreter” and copying & pasting the resulting filepath
- Run
-
Change your local
VSCodesettings tocodema-devby creating a local.vscodefolder and copying & pasting this settings.json -
Install local dev dependencies via
poetry install -
To update your local
dremwith the latest code:If you change any file
git pullmay result in merge conflicts, seefirst-contributions or theVSCodedocs
For more information see Developing inside a Container guide
-
Install WSL2 for
Docker Desktopon Windows:As of 10/11/2020
Docker Desktopraises the following pop-up on Windows:-
Following the pop-up instructions:
-
Restart
docker -
'Docker Desktop' should raise the following pop-up, follow link to complete installation
-
The 'Docker Desktop' whale should indicate that 'Docker Desktop' is running next time you launch it 😃
-



