Energy Transition Engine
Calculation engine for the Energy Transition Model.
https://github.com/quintel/etengine
Category: Energy Systems
Sub Category: Energy System Modeling Frameworks
Keywords from Contributors
archiving measur transforms observation optimize generic animals compose projection conversion
Last synced: about 10 hours ago
JSON representation
Repository metadata
Calculation engine for the Energy Transition Model
- Host: GitHub
- URL: https://github.com/quintel/etengine
- Owner: quintel
- License: mit
- Created: 2011-05-03T08:55:40.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2025-04-25T08:31:34.000Z (3 days ago)
- Last Synced: 2025-04-25T08:43:16.115Z (3 days ago)
- Language: Ruby
- Homepage: https://energytransitionmodel.com/
- Size: 18.4 MB
- Stars: 16
- Watchers: 19
- Forks: 7
- Open Issues: 55
- Releases: 1
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE.txt
README.markdown
Energy Transition Engine (ETE)
This is the source code for the Calculation Engine that is used by the
Energy Transition Model and its various
interfaces (clients).
It is an online web app that lets you create a future energy scenario for
various countries. This software is open source, so you can
fork it and alter at your will.
ETEngine does not contain an easy-to-use frontend for creating and editing
these energy scenarios; that role is instead fulfilled by separate applications
such as ETModel, ETFlex, and the EnergyMixer,
which each use ETEngine's REST API for manipulating and calculating scenarios.
License
The ETE is released under the MIT License.
Installation with Docker
New users are recommended to use Docker to run ETEngine. Doing so will avoid the need to install additional dependencies.
-
Get a copy of ETEngine and ETSource; placing them in the same parent directory:
├─ parent_dir │ ├─ etengine │ └─ etsource
Place the ETSource decryption password in a file called
.password
in the ETSource directory. This is required to decrypt a small number of datasets for which we're not authorised to publicly release the source data.├─ parent_dir │ ├─ etengine │ └─ etsource │ ├─ .password # <- password goes here │ ├─ carriers │ ├─ config │ ├─ datasets │ ├─ ...
-
Build the ETEngine image:
docker-compose build
-
Install dependencies and seed the database:
docker-compose run --rm web bash -c 'bin/rails db:drop && bin/setup'
The command drops any existing ETEngine database; be sure only to run this during the initial setup! This step will also provide you with an e-mail address and password for an administrator account.
-
Launch the containers:
docker-compose up
After starting application will become available at http://localhost:3000 after a few seconds. This is indicated by the message "Listening on http://0.0.0.0:3000".
Before the application can start serving scenarios, it must calculate the default dataset (Netherlands). This process will begin the first time a scenario is requested and will take several seconds. Signing in to the administrator account will also begin the calculation. Please be patient! Further requests to ETEngine will happen much faster.
Installation without Docker
Installing ETEngine on a local machine can be a bit involved, owing to the
number of dependencies. Assuming you can run a 'normal' rails application on your local machine,
you have to follow these steps to run ETEngine.
-
Install the "Graphviz" library
- Mac users with Homebrew:
brew install graphviz
- Ubuntu:
sudo apt-get install graphviz libgraphviz-dev
- Mac users with Homebrew:
-
Install "MySQL" server
- Mac: Install latest version using the Native Package (choose the 64-bit DMG version), or install via brew:
brew install mysql
- Ubuntu:
sudo apt-get install mysql-server-5.5 libmysqlclient-dev
- Mac: Install latest version using the Native Package (choose the 64-bit DMG version), or install via brew:
-
Clone this repository with
git clone [email protected]:quintel/etengine.git
-
Run
bundle install
to install the dependencies required by ETEngine. -
Clone a copy of ETSource –– which contains the data for each
region:cd ..; git clone [email protected]:quintel/etsource.git
cd etsource; bundle install
-
Create the database you specified in your "database.yml" file, and
- run
bundle exec rake db:setup
to create the tables and add an
administrator account –– whose name and password will be output at the end –– OR - run
bundle exec rake db:create
to create your database and
contact the private Quintel slack channel to fill your database with records from staging server
- run
-
You're now ready-to-go! Fire up the Rails process with
rails s
or betterbin/dev
. -
If you run into an dataset error, check out this
explanation on CSV files
Technical Design
Caching
The ETEngine uses heavily caching of calculated values by using the
fetch
function that stores and retrieves calculated values. This has some drawbacks,
but is necessary to keep performance up.
Scenario
When the user starts a new scenario, the user has to choose the end_year
and the area
for which this scenario applies. This can/should not be
altered later.
Present and future
The ETEngine uses two graphs that store all the data: one for the present
year and one for the future year. In this sense, the ETengine is a 'two
state' model: everything is calculated twice: once for the start year, and
once for the end year. It is important to note that ETengine therefor does
not calculate intermediate years. An exception to this is
Merit, a module for ETengine (that can
also be used independently which contains time series at a one hour resolution
for one year.
Inputs
A user can alter the start scenario with the use of inputs. Every input has
a key and a value can be sent to ETEngine. For example a user can tell ETengine:
number_of_energy_power_nuclear_gen3_uranium_oxide = 2
This means that the user wants to 'set' the number of nuclear power plants to 2
in his/her current scenario.
The current set of inputs can be found on
ETSource.
Every times the user requests some output, all the inputs that have been
touched by that user for that scenario are applied again. The order in which
they are applied can be controlled if necessary.
The priority of every input defaults to 0, and can be set a manual value
(e.g. 100) on inputs which need to be executed first. For example, an input
with priority=100
gets executed before an input with priority=99
, etc...
This is someting to keep in mind when designing your input statements.
Competing inputs
For example, when you have two inputs:
- input
A
: update attributeX
to have value1
- input
B
: update attributeX
to have value2
The outcome of this X
will be 1
or 2
depending on the priority of
these inputs (if they both have no priority or the same priority), this will
be randomly determined.
Complementary inputs
For example, when you have two inputs:
- input
A
: update attributeX
to increase with1%
- input
B
: update attributeX
to increase with2%
Then the outcome of the X
will be 1.01 * 1.02.
Output
The user can request output from his/her scenario with the use of
gqueries. A gquery always returns the present and the future
output value, although there are exceptions to this.
E.g. when the user sends the dashboard_co2_emissions
query to
ETEngine, it will receive the following feedback:
- present: 123
- future: 456
- unit: MJ
A gquery is nothing more then a stored statement. These statements are
written in our own language called the Graph Query Language (GQL) and
a recent list can be found on ETSource.
Auto-reloading your changes to etsource
Sometimes you want to play around or tweak some gqueries. Then, you don't
want to create commits every time and import them. Because when you are
satisfied, you'll probably have 10 commits, that needs to be cleaned up,
squashed.
You can add the option etsource_live_reload: true
in your config.yml
file.
Change queries, inputs, datasets, gqueries, inputs or topology directory
in your et_source_export folder, and Etengine reloads your changes
automatically!
B.t.w. By default your etsource_export directory is not under version control.
In order to gain the advantages of Git, just point etsource_export to the
etsource directory, either by using a symbolic link or using the same directory
in your config.yml file. But be carefull NOT to use the interface's
'import' action on /etsource: that will delete/overwrite your etsource_export
directory!
GQL
Screencasts
Password for all the screencasts below is quintel
.
GQL Console
GQL Docs
How to use this documentation.
GQL Console and ETSource
How to work with different etsource directories, make changes and load them in
the gql console.
ETSource: Create a new basic etmodel
We build a new etmodel with 3 nodes from scratch. This helps you
understand how the etsource works.
The result you can find in: etsource/models/sample
Owner metadata
- Name: Quintel
- Login: quintel
- Email: [email protected]
- Kind: organization
- Description:
- Website: quintel.com
- Location: Amsterdam
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/2242291?v=4
- Repositories: 44
- Last ynced at: 2024-04-12T01:02:20.645Z
- Profile URL: https://github.com/quintel
GitHub Events
Total
- Create event: 67
- Release event: 1
- Issues event: 51
- Watch event: 1
- Delete event: 49
- Issue comment event: 107
- Push event: 195
- Pull request review comment event: 15
- Pull request review event: 53
- Pull request event: 99
Last Year
- Create event: 67
- Release event: 1
- Issues event: 51
- Watch event: 1
- Delete event: 49
- Issue comment event: 107
- Push event: 195
- Pull request review comment event: 15
- Pull request review event: 53
- Pull request event: 99
Committers metadata
Last synced: 7 days ago
Total Commits: 5,333
Total Committers: 47
Avg Commits per committer: 113.468
Development Distribution Score (DDS): 0.647
Commits in past year: 247
Committers in past year: 6
Avg Commits per committer in past year: 41.167
Development Distribution Score (DDS) in past year: 0.413
Name | Commits | |
---|---|---|
Anthony Williams | hi@a****v | 1881 |
Sebi Burkhard | s****d@g****m | 1213 |
Paolo Zaccagnini | p****c@g****m | 887 |
noracato | n****l@g****m | 296 |
Chael Kruip | c****p@q****m | 143 |
Dennis Schoenmakers | d****s@q****m | 137 |
Gerard Westerhof | g****d@g****l | 79 |
louispt1 | l****1@g****m | 66 |
Michiel den Haan | m****n@q****m | 64 |
wmeyers | w****s@q****m | 57 |
Mathijs Bijkerk | m****k@q****m | 56 |
marliekeverweij | m****j@q****m | 56 |
Robbert Dol | r****l@q****m | 49 |
Peter Lohmann | p****n@q****m | 46 |
dependabot[bot] | 4****] | 46 |
Wouter van Lelyveld | w****d@q****m | 32 |
Joris Berkhout | j****t@q****m | 29 |
Roos de Kok | r****k@q****m | 27 |
Rob Terwel | r****l@q****m | 26 |
Thomas | t****g@q****m | 26 |
Andre Medeiros | me@a****o | 14 |
Jesse Kerkhoven | j****n@z****l | 13 |
Kas Kranenburg | k****g@q****m | 12 |
Dorine van der Vlies | d****s@q****m | 11 |
Kyra de Haan | k****n@q****m | 10 |
Frans van Camp | f****p@x****l | 9 |
Wouter Terlouw | w****w@q****m | 7 |
cjlaumans | c****s@q****m | 5 |
Lotte van Vlimmeren | l****n@q****m | 4 |
Peter Lohmann | p****r@l****o | 4 |
and 17 more... |
Committer domains:
- quintel.com: 29
- jastix.biz: 1
- rooss-air.home: 1
- lohmann-online.info: 1
- xs4all.nl: 1
- zonnet.nl: 1
- andremedeiros.info: 1
- grdw.nl: 1
- antw.dev: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 1,064
Total pull requests: 527
Average time to close issues: 8 months
Average time to close pull requests: 14 days
Total issue authors: 45
Total pull request authors: 31
Average comments per issue: 2.91
Average comments per pull request: 0.64
Merged pull request: 447
Bot issues: 1
Bot pull requests: 69
Past year issues: 62
Past year pull requests: 98
Past year average time to close issues: 28 days
Past year average time to close pull requests: 16 days
Past year issue authors: 7
Past year pull request authors: 6
Past year average comments per issue: 1.42
Past year average comments per pull request: 0.7
Past year merged pull request: 66
Past year bot issues: 0
Past year bot pull requests: 20
Top Issue Authors
- dennisquintel (259)
- ChaelKruip (140)
- mabijkerk (67)
- WvanLelyveld (66)
- hasclass (65)
- wmeyers (51)
- antw (42)
- noracato (40)
- grdw (39)
- markquintel (37)
- AlexanderWirtz (32)
- pzac (28)
- michieldenhaan (24)
- cjlaumans (21)
- louispt1 (19)
Top Pull Request Authors
- antw (70)
- dependabot[bot] (69)
- grdw (50)
- louispt1 (45)
- noracato (44)
- marliekeverweij (38)
- ChaelKruip (31)
- michieldenhaan (28)
- mabijkerk (28)
- jorisberkhout (22)
- RobTerwel (17)
- redekok (11)
- thomas-qah (10)
- ploh (10)
- dennisquintel (9)
Top Issue Labels
- Bug (243)
- Clean up (169)
- New features (150)
- Admin interface (97)
- Priority (81)
- Stale (66)
- Pinned (57)
- On hold (46)
- airbrake (22)
- Enhancement (22)
- Tests (16)
- API (16)
- Question (15)
- effort:3 (9)
- effort:1 (8)
- effort:7 (7)
- Minor issue (6)
- effort:2 (4)
- Not ETEngine ಠ_ಠ (4)
- coupled-markets (3)
- compatibility (3)
- effort:13 (2)
- discussion (1)
Top Pull Request Labels
- dependencies (69)
- Stale (11)
- Pinned (5)
- Enhancement (4)
- ruby (4)
- Clean up (3)
- On hold (3)
- Minor issue (2)
Dependencies
- better_errors >= 0 development
- binding_of_caller >= 0 development
- factory_bot_rails >= 0 development
- listen >= 0 development
- pry-byebug >= 0 development
- pry-rails >= 0 development
- rails-controller-testing >= 0 development
- rspec-rails ~> 5.0 development
- rubocop ~> 1.27 development
- rubocop-performance >= 0 development
- rubocop-rails >= 0 development
- rubocop-rspec >= 0 development
- shoulda-matchers >= 0 development
- simplecov ~> 0.7.1 development
- watchr >= 0 development
- atlas >= 0
- bootsnap >= 0
- cancancan ~> 3.0
- coffee-rails >= 0
- dalli >= 0
- devise ~> 4.7
- dotenv-rails >= 0
- fever >= 0
- fnv >= 0
- gctools >= 0
- git >= 0
- haml ~> 5.0
- highline >= 0
- ice_nine >= 0
- jquery-rails ~> 4.0
- json >= 0
- kaminari >= 0
- mini_racer >= 0
- msgpack >= 0
- mysql2 >= 0
- newrelic_rpm >= 0
- numo-narray >= 0
- osmosis >= 0
- parallel >= 0
- puma >= 0
- quintel_merit >= 0
- rack-cors >= 0
- rails ~> 7.0.0
- rake >= 0
- refinery >= 0
- rest-client >= 0
- rubel >= 0
- ruby-graphviz >= 0
- ruby-progressbar >= 0
- ruby_deep_clone ~> 0.8
- sass-rails >= 0
- sentry-raven >= 0
- simple_form >= 0
- term-ansicolor = 1.0.7
- text-table >= 0
- turbine-graph >= 0.1
- 161 dependencies
- actions/stale v3 composite
- ruby 3.1-slim build
- mariadb 10
Score: 8.112827478751374