Skip to content

Commit

Permalink
Merge pull request #102 from rl-institut/release/v0.1.0
Browse files Browse the repository at this point in the history
Release/v0.1.0
tests performed live on a windows computer
  • Loading branch information
Bachibouzouk authored Jan 29, 2020
2 parents f2804a1 + 1ecace0 commit 8edd286
Show file tree
Hide file tree
Showing 38 changed files with 4,050 additions and 3,701 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
source =
src
tests
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ before_install:

# command to install dependencies
install:
- pip install -e .
- pip install -r requirements.txt
- pip install -r tests/test_requirements.txt

# commands to run tests
script:
- pytest tests/tests.py
- black --check . --exclude docs/
- - black --check . --exclude docs/
- coverage run -m pytest

after_success:
- COVERALLS_REPO_TOKEN=${{ secrets.coverage_token }} coveralls
# - pylint */*.py
#jobs:
# include:
Expand Down
26 changes: 21 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,36 @@ Here is a template for new release sections
### Added
-
### Changed
### Changed
-
### Removed
-
```

## [unreleased]
## [Unreleased]

### Added
-

### Changed

### Removed



## [0.1.0] - 2020-01-30

### Added
- tests for the A0 module (#87)
- badge for coveralls.io (#90)
- tests for the parsing of arguments (#97)
- exceptions for missing input file/folder (#98)
### Changed
-
- removed unused class structure in all modules, execution stay the same (#86)
- link to build for this repository instead of previous one (#95)
- use argparser to parse the arguments from command line (#97)
- the full path of input folder containing csv is now required (#98)
### Removed
-
- argument parsing using sys.argv (#97)

## [0.0.3] - 2020-01-22

Expand Down
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# MVS - Multi-Vector Simulator of the E-Land toolbox

[![Documentation Status](https://readthedocs.org/projects/mvs-eland/badge/?version=latest)](https://mvs-eland.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/smartie2076/mvs_eland.svg?branch=dev)](https://travis-ci.org/smartie2076/mvs_eland)
[![Build Status](https://travis-ci.org/rl-institut/mvs_eland.svg?branch=dev)](https://travis-ci.org/rl-institut/mvs_eland.svg?branch=dev)
[![Coverage Status](https://coveralls.io/repos/github/rl-institut/mvs_eland/badge.svg?branch=dev)](https://coveralls.io/github/rl-institut/mvs_eland?branch=dev)

Rights: [Reiner Lemoine Institut (Berlin)](https://reiner-lemoine-institut.de/)

Expand All @@ -12,12 +13,12 @@ Firstly, an analysis of the current energy system, which can be set up automatic
The tool is being developed within the scope of the H2020 project E-LAND (Integrated multi-vector management system for Energy isLANDs, project homepage [HERE](https://elandh2020.eu/)). A graphical user interface for the MVS will be integrated.

*Latest release*
The latest release is [v.0.0.2](https://github.com/smartie2076/mvs_eland/releases), and includes the working code of the MVS using json as an input. It is not validated and test coverage is still 0%. Please check the [CHANGELOG.md](https://github.com/smartie2076/mvs_eland/blob/master/CHANGELOG.md) for past updates and changes.
Check the [latest release](https://github.com/rl-institut/mvs_eland/releases/latest), and includes the working code of the MVS using json as an input. It is not validated and test coverage is still 0%. Please check the [CHANGELOG.md](https://github.com/rl-institut/mvs_eland/blob/master/CHANGELOG.md) for past updates and changes.

*Upcoming*
As the MVS is still under development, many changes will still occur in the code as well as code structure. If you want to try the MVS, please make sure to check this project regularly. A new release is planned for end of January ([Issue](https://github.com/smartie2076/mvs_eland/issues/51), [Milestone](https://github.com/smartie2076/mvs_eland/milestone/1)).
As the MVS is still under development, many changes will still occur in the code as well as code structure. If you want to try the MVS, please make sure to check this project regularly. A new release is planned for end of January ([Issue](https://github.com/rl-institut/mvs_eland/issues/51), [Milestone](https://github.com/rl-institut/mvs_eland/milestone/1)).

For advanced programmers: You can also use the dev version that includes the latest updates and changes, but which in turn might not be tested. You find the changelog [HERE](https://github.com/smartie2076/mvs_eland/blob/dev/CHANGELOG.md).
For advanced programmers: You can also use the dev version that includes the latest updates and changes, but which in turn might not be tested. You find the changelog [HERE](https://github.com/rl-institut/mvs_eland/blob/dev/CHANGELOG.md).

# Getting started

Expand All @@ -31,9 +32,9 @@ To set up the MVS, follow the steps below:

* If python3 is not pre-installed: Install miniconda (for python 3.7: https://docs.conda.io/en/latest/miniconda.html)

* Clone or download the latest [MVS release](https://github.com/smartie2076/mvs_eland/releases)
* Clone or download the latest [MVS release](https://github.com/rl-institut/mvs_eland/releases)

`git clone https://github.com/smartie2076/mvs_eland.git`
`git clone https://github.com/rl-institut/mvs_eland.git`

and move to the `mvs_eland` folder

Expand Down Expand Up @@ -77,24 +78,28 @@ To set up the MVS, follow the steps below:
* Test if the MVS is running by executing
`python mvs_eland_tool.py`
`python mvs_eland_tool/mvs_eland_tool.py`
* You can also run all existing tests by executing
`pip install -r tests/test_requirements.txt`
`pytest tests/tests.py`
`pytest`
## Using the MVS
To run the MVS with custom inputs, edit the json input file and run
`python mvs_eland_tool.py path_input_file path_output_folder`
`python mvs_eland_tool/mvs_eland_tool.py -i path_input_file -o path_output_folder`
With `path_input_file`: path to json input file
and `path_output_folder`: path of the folder where simulation results should be stored
For more information about the possible command lines
`python mvs_eland_tool/mvs_eland_tool.py -h`
## Contributing
If you want to contribute to this project, please read [CONTRIBUTING.md](https://github.com/smartie2076/mvs_eland/blob/dev/CONTRIBUTING.md). For less experienced github users we propose a workflow [HERE](https://github.com/smartie2076/mvs_eland/wiki/Examplary-Workflow).
If you want to contribute to this project, please read [CONTRIBUTING.md](https://github.com/rl-institut/mvs_eland/blob/dev/CONTRIBUTING.md). For less experienced github users we propose a workflow [HERE](https://github.com/rl-institut/mvs_eland/wiki/Examplary-Workflow).
Empty file added mvs_eland_tool/__init__.py
Empty file.
47 changes: 20 additions & 27 deletions mvs_eland_tool.py → mvs_eland_tool/mvs_eland_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,16 @@
"""

import logging
import os

# Loading all child functions
try:
# for tests
from .src.A0_initialization import initializing
from .src.A1_csv_to_json import DataInputFromCsv
from .src.B0_data_input_json import data_input
from .src.C0_data_processing import data_processing
from .src.D0_modelling_and_optimization import modelling
from .src.E0_evaluation import evaluation
from .src.F0_output import output_processing

except ModuleNotFoundError:
# for terminal execution
from src.A0_initialization import initializing
from src.A1_csv_to_json import DataInputFromCsv
from src.B0_data_input_json import data_input
from src.C0_data_processing import data_processing
from src.D0_modelling_and_optimization import modelling
from src.E0_evaluation import evaluation
from src.F0_output import output_processing

import src.A0_initialization as initializing
import src.A1_csv_to_json as load_data_from_csv
import src.B0_data_input_json as data_input
import src.C0_data_processing as data_processing
import src.D0_modelling_and_optimization as modelling
import src.E0_evaluation as evaluation
import src.F0_output as output_processing


def main(**kwargs):
Expand All @@ -71,21 +59,26 @@ def main(**kwargs):
+ "\n Coded at: Reiner Lemoine Institute (Berlin) "
+ "\n Contributors: Martha M. Hoffmann \n \n "
)
# Parse the arguments from the command line
parser = initializing.create_parser()
args = vars(parser.parse_args())
kwargs.update(**args)

logging.debug("Accessing script: A0_initialization")
user_input = initializing.welcome(welcome_text, **kwargs)

# Read all inputs
# print("")
# # todo: is user input completely used?
# dict_values = data_input.get(user_input)
# dict_values = data_input.load_json(user_input["path_input_file"])

logging.debug("Accessing script: A1_csv_to_json")
path_to_json_from_csv = DataInputFromCsv.create_input_json()
user_input.update({"path_input_file": path_to_json_from_csv})
if not kwargs["path_input_file"].endswith("json"):
logging.debug("Accessing script: A1_csv_to_json")
path_to_json_from_csv = load_data_from_csv.create_input_json()
user_input.update({"path_input_file": path_to_json_from_csv})

logging.debug("Accessing script: B0_data_input_json")
dict_values = data_input.get(user_input)
dict_values = data_input.load_json(user_input["path_input_file"])

print("")
logging.debug("Accessing script: C0_data_processing")
Expand All @@ -108,8 +101,8 @@ def main(**kwargs):
filename=dict_values['simulation_settings']['oemof_file_name'])
results_main = model.results['main']
results_meta = model.results['meta']
"""
# """
print("")
logging.debug("Accessing script: E0_evaluation")
evaluation.evaluate_dict(dict_values, results_main, results_meta)
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# Arguments marked as "Required" below must be included for upload to PyPI.
# Fields marked as "Optional" may be commented out.


setup(
# This is the name of your project. The first time you publish this
# package, this name will be registered for you. It will determine how
Expand All @@ -30,14 +31,14 @@
# There are some restrictions on what makes a valid project name
# specification here:
# https://packaging.python.org/specifications/core-metadata/#name
name="mvs_eland", # Required
name="mvs_tool", # Required
# Versions should comply with PEP 440:
# https://www.python.org/dev/peps/pep-0440/
#
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version="0.0.3", # Required
version="0.1.0", # Required
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
# https://packaging.python.org/specifications/core-metadata/#summary
Expand Down Expand Up @@ -104,7 +105,7 @@
keywords="multi-vector local-energy-systems", # Optional
# When your source code is in a subdirectory under the project root, e.g.
# `src/`, it is necessary to specify the `package_dir` argument.
package_dir={"": "src"}, # Optional
# package_dir={"": "src"}, # Optional
# You can just specify package directories manually here if your project is
# simple. Or you can use find_packages().
#
Expand All @@ -114,7 +115,7 @@
#
# py_modules=["my_module"],
#
packages=find_packages(where="src"), # Required
packages=["src", "mvs_eland_tool"], # Required
# Specify which Python versions you support. In contrast to the
# 'Programming Language' classifiers above, 'pip install' will check this
# and refuse to install the project if the version does not match. If you
Expand Down
Loading

0 comments on commit 8edd286

Please sign in to comment.