Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Features/cli app #1

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4cfe141
Add script to build and compute package
simnh Dec 19, 2018
a6564c1
Pepify with black
simnh Dec 19, 2018
f0d7095
Update cli tools for compute and construct command
simnh Dec 19, 2018
5e7fed7
Update commandline script
simnh Dec 19, 2018
5c2940f
Add option to construct datapackage
simnh Dec 19, 2018
27a9a70
Add option to construct datapackage
simnh Dec 19, 2018
00ed260
Merge branch 'features/cli-app' of github.com:znes/fuchur into featur…
simnh Dec 19, 2018
f83c64a
Adapt fuchur to postprocessing function
simnh Dec 19, 2018
16ab250
Adapt fuchur to toml file
simnh Jan 3, 2019
d87de60
Fix bugs from json to toml changes
simnh Jan 7, 2019
33dc1de
Fix scripts from restructuring and toml config
simnh Jan 7, 2019
4fb29c0
Fix hydro model of reservoir
simnh Jan 7, 2019
97278ec
Fix linter warnings
simnh Jan 8, 2019
c3b091d
Fix linter warnings
simnh Jan 8, 2019
853324e
Merge branch 'features/cli-app' of https://github.com/znes/fuchur int…
simnh Jan 8, 2019
06bcc89
Merge branch 'features/cli-app' of https://github.com/znes/fuchur int…
simnh Jan 8, 2019
840a711
Merge branch 'features/cli-app' of https://github.com/znes/fuchur int…
simnh Jan 8, 2019
0ae8e54
Fix data processing for GB country
simnh Jan 8, 2019
eabb0bc
Update scenarios
simnh Jan 8, 2019
a608336
Add temporal resolution and emission limit to model stats
simnh Jan 8, 2019
81ecf6b
Fix bugs for all countries with potentials and offshore
simnh Jan 8, 2019
17d0c8d
Fix offhsore technologies
simnh Jan 9, 2019
a1c8887
Add heat script
simnh Jan 9, 2019
4a32998
Merge branch 'features/cli-app' of github.com:znes/fuchur into featur…
simnh Jan 9, 2019
0dbea3e
Move Download data to cli script
simnh Jan 11, 2019
2382bc8
Fix test scenario
simnh Jan 11, 2019
4fd90f1
Make cli options more flexible with kwargs
simnh Jan 11, 2019
23f2905
Update src/fuchur/scripts/__init__.py
gnn Jan 11, 2019
7ffe821
Update src/fuchur/scripts/bus.py
gnn Jan 11, 2019
0501f3e
Update src/fuchur/scripts/electricity.py
gnn Jan 11, 2019
369cda0
Update src/fuchur/scripts/electricity.py
gnn Jan 11, 2019
7d12783
Update src/fuchur/scripts/electricity.py
gnn Jan 11, 2019
97ae673
Update src/fuchur/scripts/electricity.py
gnn Jan 11, 2019
856e326
Fix compute script
simnh Jan 11, 2019
ef1552b
Merge branch 'features/cli-app' of https://github.com/znes/fuchur int…
simnh Jan 11, 2019
4a72da5
Add heat script
simnh Jan 14, 2019
4e81bda
Wrap overly long line
gnn Jan 15, 2019
89d67c2
Drop unsupported Python versions
gnn Jan 15, 2019
b888e08
Add `oemof.tabular` as a dependency
gnn Jan 15, 2019
6a40aa6
Update `Development Status`
gnn Jan 15, 2019
6f1b171
Add the API RST file for `fuchur.scripts`
gnn Jan 15, 2019
054edbc
Fix `cli` test
gnn Jan 16, 2019
db40e79
Remove unsupported Python versions from CI
gnn Jan 16, 2019
86350a6
Remove unsupported implementations
gnn Jan 16, 2019
d8b4705
Limit line length to 79 characters
gnn Jan 16, 2019
2f9b550
Remove Python 2.7 from `setup.cfg`
gnn Jan 16, 2019
666694f
Allow Python 3.7 to fail
gnn Jan 16, 2019
ea0ec21
Change some import sorting options
gnn Jan 16, 2019
e4214e2
Make the style checker happy
gnn Jan 16, 2019
6d58051
Fix `.travis.yml`
gnn Jan 16, 2019
1d21ed8
Allow Python 3.7 windows CI jobs to fail
gnn Jan 16, 2019
bc62c21
Don't send emails on CI failures
gnn Jan 16, 2019
7c2b09c
Make travis be more lenient with timeouts
gnn Jan 16, 2019
bf51441
Fix `appveyor.yml`
gnn Jan 16, 2019
f02e6ef
Try fixing `appveyor.yml` differently
gnn Jan 16, 2019
4d7f018
Test Travis' patience even more
gnn Jan 16, 2019
afab758
Still trying to fix `appveyor.yml`
gnn Jan 16, 2019
efe2330
Add scenarios
simnh Jan 17, 2019
9850e2f
Update scenarios and move biomass to other script
simnh Jan 17, 2019
bd81578
Make the linter happy
gnn Jan 23, 2019
2ba30a3
Blacken `fuchur/__init__.py`
gnn Jan 23, 2019
16c1d43
Add a dictionary containing built in scenarios
gnn Jan 23, 2019
bae3b81
Move load profile to own function
simnh Jan 23, 2019
b657408
Add heat to test.toml
simnh Jan 23, 2019
cc0b876
Allow specifying built in scenarios by name
gnn Jan 24, 2019
6d280b5
Implement hierarchical scenarios
gnn Jan 24, 2019
51a6b4c
Merge improved config handling into features/cli-app
gnn Jan 24, 2019
a9e4c0b
Resolve merge conflict
simnh Jan 24, 2019
b0eb52a
Add tyndp script
simnh Jan 24, 2019
72b33fa
Add extra script for german dispatchables
simnh Jan 28, 2019
61590dd
Fix dispatchable_de
Jan 31, 2019
814e998
Exclude DE dispatchable from tyndp
simnh Feb 2, 2019
0b744bd
Remove dispachable de
simnh Feb 6, 2019
8eff0cb
Restructure functions, add docstrings, and arguments for generic usage
simnh Feb 6, 2019
1852c0c
Move tyndp to electricity.py, adapt cli and add scenario file
simnh Feb 6, 2019
7599f32
Remove scenarios file
simnh Feb 8, 2019
0da04e4
Make scenarios work in the way with parents being used as template an…
simnh Feb 8, 2019
86af240
Add raw data path argument to hydro generation
simnh Feb 8, 2019
7c0746a
Remove obsolete print statement
simnh Feb 8, 2019
0e8b832
Remove moved code from cli for tyndp / nep dispatch model
simnh Feb 11, 2019
02e4cf2
Adapt scripts for carrier tech consistency
simnh Feb 11, 2019
5a16a91
Restructure scripts for easier maintainability
simnh Feb 11, 2019
9073496
Move nep2019 to electrictiy script
simnh Feb 11, 2019
b457ba9
Update fuchur
simnh Feb 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ env:
- TOXENV=docs
matrix:
include:
- python: '2.7'
env:
- TOXENV=py27-cover,report,coveralls,codecov
- python: '2.7'
env:
- TOXENV=py27-nocov
- python: '3.4'
env:
- TOXENV=py34-cover,report,coveralls,codecov
Expand Down Expand Up @@ -44,18 +38,9 @@ matrix:
sudo: required
env:
- TOXENV=py37-nocov
- python: 'pypy'
env:
- TOXENV=pypy-cover,report,coveralls,codecov
- python: 'pypy'
env:
- TOXENV=pypy-nocov
- python: 'pypy3'
env:
- TOXENV=pypy3-cover,report,coveralls,codecov
- python: 'pypy3'
env:
- TOXENV=pypy3-nocov
allow_failures:
- python: '3.7'

before_install:
- python --version
- uname -a
Expand Down Expand Up @@ -88,11 +73,11 @@ install:
fi
set +x
script:
- tox -v
- travis_wait 60 tox -v
after_failure:
- more .tox/log/* | cat
- more .tox/*/log/* | cat
notifications:
email:
on_success: never
on_failure: always
on_failure: never
27 changes: 4 additions & 23 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,6 @@ environment:
PYTHON_HOME: C:\Python27
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '32'
- TOXENV: 'py27-cover,report,codecov'
TOXPYTHON: C:\Python27\python.exe
PYTHON_HOME: C:\Python27
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '32'
- TOXENV: 'py27-cover,report,codecov'
TOXPYTHON: C:\Python27-x64\python.exe
WINDOWS_SDK_VERSION: v7.0
PYTHON_HOME: C:\Python27-x64
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '64'

- TOXENV: 'py27-nocov'
TOXPYTHON: C:\Python27\python.exe
PYTHON_HOME: C:\Python27
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '32'
- TOXENV: 'py27-nocov'
TOXPYTHON: C:\Python27-x64\python.exe
WINDOWS_SDK_VERSION: v7.0
PYTHON_HOME: C:\Python27-x64
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '64'

- TOXENV: 'py34-cover,report,codecov'
TOXPYTHON: C:\Python34\python.exe
Expand Down Expand Up @@ -125,6 +102,10 @@ environment:
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'

matrix:
allow_failures:
- PYTHON_VERSION: '3.7'

init:
- ps: echo $env:TOXENV
- ps: ls C:\Python*
Expand Down
62 changes: 62 additions & 0 deletions docs/reference/fuchur.scripts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
fuchur.scripts package
======================

Submodules
----------

fuchur.scripts.bus module
-------------------------

.. automodule:: fuchur.scripts.bus
:members:
:undoc-members:
:show-inheritance:

fuchur.scripts.capacity\_factors module
---------------------------------------

.. automodule:: fuchur.scripts.capacity_factors
:members:
:undoc-members:
:show-inheritance:

fuchur.scripts.compute module
-----------------------------

.. automodule:: fuchur.scripts.compute
:members:
:undoc-members:
:show-inheritance:

fuchur.scripts.electricity module
---------------------------------

.. automodule:: fuchur.scripts.electricity
:members:
:undoc-members:
:show-inheritance:

fuchur.scripts.grid module
--------------------------

.. automodule:: fuchur.scripts.grid
:members:
:undoc-members:
:show-inheritance:

fuchur.scripts.heat module
--------------------------

.. automodule:: fuchur.scripts.heat
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: fuchur.scripts
:members:
:undoc-members:
:show-inheritance:
11 changes: 5 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = 1


[flake8]
max-line-length = 140
max-line-length = 79
exclude = */migrations/*

[tool:pytest]
Expand Down Expand Up @@ -31,13 +31,15 @@ addopts =
--tb=short

[isort]
force_single_line = True
line_length = 120
force_single_line = False
line_length = 79
known_first_party = fuchur
default_section = THIRDPARTY
forced_separate = test_fuchur
not_skip = __init__.py
skip = migrations
from_first = True
ignore_whitespace = True

[matrix]
# This is the configuration for the `./bootstrap.py` script.
Expand All @@ -61,13 +63,10 @@ skip = migrations
# - can use as many you want

python_versions =
py27
py34
py35
py36
py37
pypy
pypy3

dependencies =
# 1.4: Django==1.4.16 !python_versions[py3*]
Expand Down
95 changes: 50 additions & 45 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,83 +1,88 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import absolute_import, print_function

from glob import glob
from os.path import basename, dirname, join, splitext
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext

from setuptools import find_packages
from setuptools import setup
from setuptools import find_packages, setup


def read(*names, **kwargs):
with io.open(
join(dirname(__file__), *names),
encoding=kwargs.get('encoding', 'utf8')
encoding=kwargs.get("encoding", "utf8"),
) as fh:
return fh.read()


setup(
name='fuchur',
version='0.0.0',
license='BSD 3-Clause License',
description='An optimizaton model for Europe based on oemof.',
long_description='%s\n%s' % (
re.compile('^.. start-badges.*^.. end-badges', re.M | re.S).sub('', read('README.rst')),
re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst'))
name="fuchur",
version="0.0.0",
license="BSD 3-Clause License",
description="An optimizaton model for Europe based on oemof.",
long_description="%s\n%s"
% (
re.compile("^.. start-badges.*^.. end-badges", re.M | re.S).sub(
"", read("README.rst")
),
re.sub(":[a-z]+:`~?(.*?)`", r"``\1``", read("CHANGELOG.rst")),
),
author='Simon Hilpert',
author_email='[email protected]',
url='https://github.com/znes/fuchur',
packages=find_packages('src'),
package_dir={'': 'src'},
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
author="Simon Hilpert",
author_email="[email protected]",
url="https://github.com/znes/fuchur",
packages=find_packages("src"),
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
include_package_data=True,
zip_safe=False,
classifiers=[
# complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 1 - Planning',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
# complete classifier list:
#
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
#
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: Unix",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
# uncomment if you test on these interpreters:
# 'Programming Language :: Python :: Implementation :: IronPython',
# 'Programming Language :: Python :: Implementation :: Jython',
# 'Programming Language :: Python :: Implementation :: Stackless',
'Topic :: Utilities',
"Topic :: Utilities",
],
keywords=[
# eg: 'keyword1', 'keyword2', 'keyword3',
],
install_requires=[
'click',
"click",
"oemof.tabular==0.0.1.dev0",
"setuptools",
# eg: 'aspectlib==1.1.1', 'six>=1.7',
],
extras_require={
# eg:
# 'rst': ['docutils>=0.11'],
# ':python_version=="2.6"': ['argparse'],
},
entry_points={
'console_scripts': [
'fuchur = fuchur.cli:main',
dependency_links=(
[
(
"git+https://[email protected]/oemof/oemof-tabular.git"
"@features/postprocessing"
"#egg=oemof.tabular-0.0.1.dev0"
)
]
},
),
entry_points={"console_scripts": ["fuchur = fuchur.cli:main"]},
)
23 changes: 22 additions & 1 deletion src/fuchur/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
__version__ = '0.0.0'
import os

import pkg_resources as pkg
import toml

__version__ = "0.0.0"
__RAW_DATA_PATH__ = os.path.join(os.path.expanduser("~"), "fuchur-raw-data")

if not os.path.exists(__RAW_DATA_PATH__):
os.makedirs(__RAW_DATA_PATH__)

scenarios = {
scenario["name"]: scenario
for resource in pkg.resource_listdir("fuchur", "scenarios")
for scenario in [
toml.loads(
pkg.resource_string(
"fuchur", os.path.join("scenarios", resource)
).decode("UTF-8")
)
]
}
Loading