Skip to content

Commit

Permalink
Merge pull request #2 from OpenEnergyPlatform/release/oedatamodel-v1.0.0
Browse files Browse the repository at this point in the history
Update fork to current state in oep oedatamodel
  • Loading branch information
jh-RLI authored Sep 24, 2020
2 parents caee2e6 + 70eab03 commit 1823c69
Show file tree
Hide file tree
Showing 16 changed files with 516 additions and 376 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is inspired from [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and the versioning aim to respect [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

Here is a template for new release sections

```
## Current
### Added
-
### Changed
-
### Removed
-
## [_._._] - 20XX-MM-DD
### Added
-
### Changed
-
### Removed
-
```
## Current

### Added
-

### Changed
-


## [1.0.0] Initial release

### Added
- ERM as pdf file format
- ERM as er file format
- datamodel is documented as ERM
- datamodel as joint table inheritance model and normalized
- datamodel as concrete table inheritance model and human readable
- datapackage for each datamodel

89 changes: 89 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
## Development

### Prerequisites

- [Git](https://git-scm.com/)

### Contributions of OEdatamodel
### Workflow

The development of a feature for this repository is inspired from the workflow described
by [Vincent Driessen](https://nvie.com/posts/a-successful-git-branching-model/):

1. Create [an issue](https://help.github.com/en/articles/creating-an-issue) on the github repository

Discussion about the implementation details should occur within this issue.

2. Checkout `develop` and pull the latest changes
```bash
git checkout develop
```
```bash
git pull
```
3. Create a branch from `develop` to work on your issue (see below, the "Branch name convention" section)
```bash
git checkout -b feature/myfeature
```
4. Push your local branch on the remote server `origin`
```bash
git push
```
If your branch does not exist on the remote server yet, git will provide you with instructions, simply follow them
5. Submit a pull request (PR)
- Follow the [steps](https://help.github.com/en/articles/creating-a-pull-request) of the github help to create the PR.
- Please note that you PR should be directed from your branch (for example `myfeature`) towards the branch `develop`
6. Describe briefly (i.e. in one or two lines) what you changed in the `CHANGELOG.md` file. End the description by the number in parenthesis `(#<your PR number>)`
7. Commit the changes to the `CHANGELOG.md` file
8. Write the PR number in the corresponding issue so that they are linked. Write it with one of the [special keywords](https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords) so that the issue will be automatically closed when the PR is merged (example: `Closes #<your issue number>`)
9. [Ask](https://help.github.com/en/github/managing-your-work-on-github/assigning-issues-and-pull-requests-to-other-github-users) for review of your PR
10. Check that, after this whole process, you branch does not have conflict with `develop` (github prevents you to merge if there are conflicts). In case of conflicts you are responsible to fix them on your branch before your merge (see below "Fixing merge conflicts" section)
11. (if approved) Merge the PR into `develop` and delete the branch on which you were working. In the merge message on github, you can notify people who are currently working on other branches that you just merged into `develop`, so they know they have to check for potential conflicts with `develop`
### Fixing merge conflicts
Avoid large merge conflict by merging the updated `develop` versions in your branch.
In case of conflicts between your branch and `develop` you must solve them locally.
1. Get the latest version of `develop`
```bash
git checkout develop
```
```bash
git pull
```
2. Switch to your branch
```bash
git checkout <your branch>
```
3. Merge `develop` into your branch
```bash
git merge develop
```
4. The conflicts have to be [manually](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line) resolved
### Branch name convention
The convention is to always have `feature/` in the branch name. The `myfeature` part should describe shortly what the feature is about (separate words with `_`).
Try to follow [these conventions](https://chris.beams.io/posts/git-commit) for commit messages:
- Keep the subject line [short](https://chris.beams.io/posts/git-commit/#limit-50) (i.e. do not commit more than a few changes at the time)
- Use [imperative](https://chris.beams.io/posts/git-commit/#imperative) for commit messages
- Do not end the commit message with a [period](https://chris.beams.io/posts/git-commit/#end)
You can use
```bash
git commit --amend
```
to edit the commit message of your latest commit (provided it is not already pushed on the remote server).
With `--amend` you can even add/modify changes to the commit.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# oedatamodel
[![Build Status](https://travis-ci.org/OpenEnergyPlatform/edatamodel.svg?branch=develop)](https://travis-ci.org/OpenEnergyPlatform/oedatamodel)

<a href="http://oep.iks.cs.ovgu.de/"><img align="right" width="200" height="200" src="https://avatars2.githubusercontent.com/u/37101913?s=400&u=9b593cfdb6048a05ea6e72d333169a65e7c922be&v=4" alt="OpenEnergyPlatform"></a>

# Open Energy Family - Datamodel
A common open energy data model (oedatamodel) and datapackage format for energy and scenario data.

# Introduction
Expand Down
Empty file removed oedatamodel/latest/README.md
Empty file.
21 changes: 10 additions & 11 deletions oedatamodel/latest/v100/OEDataModel-concrete.er
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Scenario] {bgcolor: "#c1d6c1"}
*'scenario id (int)'
'scenario (text)'
'region (text(json))'
'region (array(text))'
'year (int)'
'source (text)'
'comment (text)'
Expand All @@ -10,16 +10,17 @@
[Scalar] {bgcolor: "#b9d3eb"}
*'scalar id (int)'
+'scenario id (int)'
'region (text (json))'
'region (array(text))'
'year(int)' <--- Ist das hier gut?
'input energy vector (text)'
'output energy vector (text)'
'parameter name (text)'
'technology (text)'
'technology type" (text)'
'technology type (text)'
'value (decimal/float)'
'unit (text)'
'tags (json/hstore)'
'method (json/hstore)'
'tags (json)'
'method (json)'
'source (text)'
'comment (text)'

Expand All @@ -28,7 +29,7 @@ Scenario 1--* Scalar
[Timeseries] {bgcolor: "#b9d3eb"}
*'timeseries id (int)'
+'scenario id (int)'
'region (text (json))'
'region (array(text))'
'input energy vector (text)'
'output energy vector (text)'
'parameter name (text)'
Expand All @@ -37,14 +38,12 @@ Scenario 1--* Scalar
'timeindex start (timestamp)'
'timeindex stop (timestamp)'
'timeindex resolution (intervall)'
'series ([decimal/float])'
'series (array(decimal/float))'
'unit (text)'
'tags (json/hstore)'
'method (json/hstore)'
'tags (json)'
'method (json)'
'source (text)'
'comment (text)'

Scenario 1--* Timeseries



13 changes: 7 additions & 6 deletions oedatamodel/latest/v100/OEDataModel-normalization.er
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Scenario] {bgcolor: "#c1d6c1"}
*'scenario id (int)'
'scenario (text)'
'region (text(json))'
'region (array(text))'
'year (int)'
'source (text)'
'comment (text)'
Expand All @@ -11,23 +11,24 @@ Scenario 1--* Data
[Data] {bgcolor: "#b9d3eb"}
*'data id (int)'
+'scenario id (int)'
'region (text (json))'
'region (array(text))'
'input energy vector (text)'
'output energy vector (text)'
'parameter name (text)'
'technology (text)'
'technology_type (text)'
'technology type (text)'
'type (text ("scalar" | "timeseries"))'
'unit (text)'
'tags (json/hstore)'
'method (json/hstore)'
'tags (json)'
'method (json)'
'source (text)'
'comment (text)'

Data 1--1 Scalar

[Scalar] {bgcolor: "#b9d3eb"}
*+'data id (int)'
'year (int)' <--- Ist das hier gut?
'value (decimal/float)'

Data 1--1 Timeseries
Expand All @@ -37,5 +38,5 @@ Data 1--1 Timeseries
'timeindex start (timestamp)'
'timeindex stop (timestamp)'
'timeindex resolution (intervall)'
'series ([decimal/float])'
'series (array(decimal/float))'

Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
{"title": "", "email": "", "date": "", "object": "", "comment": ""} ],
"resources": [
{"profile": "tabular-data-resource",
"name": "oed-readable_scenario",
"path": "oedatamodel-readable_scenario.csv",
"name": "model_draft.oed_concrete_scenario",
"path": "oedatamodel-concrete_scenario.csv",
"format": "csv",
"encoding" : "UTF-8",
"schema": {
"fields": [
{"name": "scenario_id", "description": "Unique identifier", "type": "bigint", "unit": null},
{"name": "scenario", "description": "Scenario name", "type": "text", "unit": null},
{"name": "region", "description": "Country or region", "type": "json", "unit": null},
{"name": "region", "description": "Country or region", "type": "text array", "unit": null},
{"name": "year", "description": "Year", "type": "integer", "unit": null},
{"name": "source", "description": "Source", "type": "text", "unit": null},
{"name": "comment", "description": "Comment", "type": "text", "unit": null} ],
Expand All @@ -78,64 +78,64 @@
"decimalSeparator": "."} },

{"profile": "tabular-data-resource",
"name": "oed-readable_scalar",
"path": "oedatamodel-readable_scalar.csv",
"name": "model_draft.oed_concrete_scalar",
"path": "oedatamodel-concrete_scalar.csv",
"format": "csv",
"encoding" : "UTF-8",
"schema": {
"fields": [
{"name": "scalar_id", "description": "Unique identifier", "type": "bigint", "unit": null},
{"name": "scenario_id", "description": "Scenario name", "type": "text", "unit": null},
{"name": "region", "description": "Country or region", "type": "json", "unit": null},
{"name": "scenario_id", "description": "Scenario name", "type": "bigint", "unit": null},
{"name": "region", "description": "Country or region", "type": "text array", "unit": null},
{"name": "input_energy_vector", "description": "", "type": "integer", "unit": null},
{"name": "output_energy_vector", "description": "", "type": "text", "unit": null},
{"name": "parameter_name", "description": "", "type": "text", "unit": null},
{"name": "technology", "description": "", "type": "text", "unit": null},
{"name": "technology_type", "description": "", "type": "text", "unit": null},
{"name": "value", "description": "Parameter value", "type": "decimal", "unit": "kW"},
{"name": "unit", "description": "Parameter unit", "type": "text", "unit": null},
{"name": "tags", "description": "Free classification with key-value pairs", "type": "hstore", "unit": null},
{"name": "tags", "description": "Free classification with key-value pairs", "type": "json", "unit": null},
{"name": "method", "description": "Method type (sum, mean, median)", "type": "json", "unit": null},
{"name": "source", "description": "Source", "type": "text", "unit": null},
{"name": "comment", "description": "Comment", "type": "text", "unit": null} ],
"primaryKey": ["scalar_id"],
"foreignKeys": [{
"fields": ["scenario_id"],
"reference": {
"resource": "oed_scenario",
"resource": "model_draft.oed_concrete_scenario",
"fields": ["scenario_id"] } } ] },
"dialect":
{"delimiter": ";",
"decimalSeparator": "."} },
{"profile": "tabular-data-resource",
"name": "oed-readable_timeseries",
"path": "oedatamodel-readable_timeseries.csv",
"name": "model_draft.oed_concrete_timeseries",
"path": "oedatamodel-concrete_timeseries.csv",
"format": "csv",
"encoding" : "UTF-8",
"schema": {
"fields": [
{"name": "scalar_id", "description": "Unique identifier", "type": "bigint", "unit": null},
{"name": "scenario_id", "description": "Scenario name", "type": "text", "unit": null},
{"name": "region", "description": "Country or region", "type": "json", "unit": null},
{"name": "scenario_id", "description": "Scenario name", "type": "bigint", "unit": null},
{"name": "region", "description": "Country or region", "type": "text array", "unit": null},
{"name": "input_energy_vector", "description": "", "type": "integer", "unit": null},
{"name": "output_energy_vector", "description": "", "type": "text", "unit": null},
{"name": "parameter_name", "description": "", "type": "text", "unit": null},
{"name": "technology", "description": "", "type": "text", "unit": null},
{"name": "technology_type", "description": "", "type": "text", "unit": null},
{"name": "timeindex_start", "description": "Start timestemp", "type": "timestamp", "unit": null},
{"name": "timeindex_stop", "description": "Stop timestemp", "type": "timestamp", "unit": null},
{"name": "timeindex_resolution", "description": "Timesteps", "type": "intervall", "unit": null},
{"name": "series", "description": "Timesteps", "type": "array[decimal]", "unit": null},
{"name": "timeindex_resolution", "description": "Timesteps", "type": "interval", "unit": null},
{"name": "series", "description": "Timesteps", "type": "float array", "unit": null},
{"name": "unit", "description": "Parameter unit", "type": "text", "unit": null},
{"name": "tags", "description": "Free classification with key-value pairs", "type": "hstore", "unit": null},
{"name": "tags", "description": "Free classification with key-value pairs", "type": "json", "unit": null},
{"name": "method", "description": "Method type (sum, mean, median)", "type": "json", "unit": null},
{"name": "source", "description": "Source", "type": "text", "unit": null},
{"name": "comment", "description": "Comment", "type": "text", "unit": null} ],
"primaryKey": ["scalar_id"],
"foreignKeys": [{
"fields": ["scenario_id"],
"reference": {
"resource": "oed_scenario",
"resource": "model_draft.oed_concrete_scenario",
"fields": ["scenario_id"] } } ] },
"dialect":
{"delimiter": ";",
Expand Down
Loading

0 comments on commit 1823c69

Please sign in to comment.