Skip to content

Commit

Permalink
Merge pull request #132 from oemof/release/v0.0.4
Browse files Browse the repository at this point in the history
Release v0.0.4
  • Loading branch information
nailend authored Sep 12, 2023
2 parents 747f2d5 + b8b1b31 commit c00ad89
Show file tree
Hide file tree
Showing 150 changed files with 12,646 additions and 3,480 deletions.
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Description

Please include a summary of the change and which issue is fixed.

Fixes # (issue)

## Type of change

Please tick or delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

# Checklist:

Please tick or delete options that are not relevant.

- [ ] New and adjusted code is formatted using the `pre-commit` hooks
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] If new packages are needed, I added them the [setup.py](https://github.com/oemof/oemof-tabular/blob/dev/setup.py#L67-L80)
- [ ] I have added new features/fixes to the [CHANGELOG](https://github.com/oemof/oemof-tabular/tree/dev/CHANGELOG.rst)
- [ ] I have added my name to [AUTHORS]((https://github.com/oemof/oemof-tabular/tree/dev/AUTHORS.rst)
)
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
python-version: [ '3.8', '3.9', '3.10' ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -44,7 +44,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install .[aggregation] # install extra requirement to pass all tests
python -m pip install pytest coverage docutils check-manifest flake8 readme-renderer pygments isort
python -m pip install pytest coverage docutils check-manifest flake8 readme-renderer pygments isort black
- name: Test with pytest
run: |
Expand All @@ -54,5 +54,6 @@ jobs:
run: |
python setup.py check --strict --metadata --restructuredtext
check-manifest .
black --check .
flake8 src tests
isort --verbose --check-only --diff src tests
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ docs/_build

# Mypy Cache
.mypy_cache/

docs/facade_attributes
docs/facades.rst
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
exclude: 'docs|node_modules|migrations|.git|.tox'
default_stages: [commit]
fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
files: (^|/)a/.+\.(py|html|sh|css|js)$

- repo: local
hooks:
- id: flake8
name: flake8
entry: flake8
language: python
types: [python]
args: ["src", "tests"]

- repo: local
hooks:
- id: isort
name: isort
entry: isort
language: python
types: [python]
args: ["--verbose", "src", "tests"]

- repo: local
hooks:
- id: black
name: black
entry: black
language: python
types: [python]
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Authors
* Francesco Witte
* Sarah Berendes
* Marie-Claire Gering
* Julian Endres
27 changes: 25 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,34 @@
Changelog
=========



Unreleased
------------------


0.0.4 Patch Release (2023-08-31)
-----------------------------------------------------

Features

* Add PR template `#129 <https://github.com/oemof/oemof-tabular/pull/129>`_
* Add deprecation warning for python3.8 `#125 <https://github.com/oemof/oemof-tabular/pull/125>`_
* Update to oemof.solph 0.5.1 latest changes `#123 <https://github.com/oemof/oemof-tabular/pull/123>`_
* Add multi-period deserialization `#112 <https://github.com/oemof/oemof-tabular/pull/112>`_
* Add multi-period investment `#108 <https://github.com/oemof/oemof-tabular/pull/108>`_
* Make oemof.solph 0.5.1 work `#107 <https://github.com/oemof/oemof-tabular/pull/107>`_
* Split facades into submodules `#92 <https://github.com/oemof/oemof-tabular/pull/92>`_
* Add postprocessing module `#102 <https://github.com/oemof/oemof-tabular/pull/102>`_

Fixes

* Update neglected CHANGELOG `#130 <https://github.com/oemof/oemof-tabular/pull/130>`_


0.0.3 (2022-01-26)
------------------
Fixes
#####

* Fix link by not setting constraints that limit direction `#38 <https://github.com/oemof/oemof-tabular/pull/38>`_
* Fix storage investment `#33 <https://github.com/oemof/oemof-tabular/pull/33>`_
Expand All @@ -14,7 +38,6 @@ Fixes
* Marginal cost `#23 <https://github.com/oemof/oemof-tabular/pull/23>`_

Features
########

* Adjust to new oemof.solph structure `#21 <https://github.com/oemof/oemof-tabular/pull/21>`_
* Allow to define custom foreign keys `#39 <https://github.com/oemof/oemof-tabular/pull/39>`_
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ graft tests
include .coveragerc
include .cookiecutterrc
include .editorconfig
include .pre-commit-config.yaml
include punch_config.py
include punch_version.py
include pytest.ini
Expand Down
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Overview
:alt: PyPI Package latest release
:target: https://pypi.org/project/oemof.tabular

.. |commits-since| image:: https://img.shields.io/badge/dynamic/json.svg?label=%2B&url=https%3A%2F%2Fapi.github.com%2Frepos%2Foemof%2Foemof-tabular%2Fcompare%2Fv0.0.3...dev&query=%24.total_commits&colorB=blue
.. |commits-since| image:: https://img.shields.io/badge/dynamic/json.svg?label=%2B&url=https%3A%2F%2Fapi.github.com%2Frepos%2Foemof%2Foemof-tabular%2Fcompare%2Fv0.0.5...dev&query=%24.total_commits&colorB=blue
:alt: Commits since latest release
:target: https://github.com/oemof/oemof-tabular/compare/v0.0.3...dev
:target: https://github.com/oemof/oemof-tabular/compare/v0.0.5...dev

.. |wheel| image:: https://img.shields.io/pypi/wheel/oemof.tabular.svg
:alt: PyPI Wheel
Expand Down Expand Up @@ -59,7 +59,16 @@ https://oemof-tabular.readthedocs.io/
Development
===========

To run the all tests run::
Please activate pre-commit hooks in order to follow our coding styles:

::

pip install pre-commit
pre-commit install

To run the all tests run:

::

pytest

Expand Down
49 changes: 49 additions & 0 deletions docs/code/get_facade_attributes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import dataclasses
import os

import pandas as pd

from oemof.tabular.facades import TYPEMAP


def get_facade_attrs(TYPEMAP):
facade_attrs = {}
for key, facade in TYPEMAP.items():
if dataclasses.is_dataclass(facade):
cls_name = facade.__name__
fields = dataclasses.fields(facade)
df = pd.DataFrame.from_dict(
{
"name": [field.name for field in fields],
"type": [field.type.__name__ if hasattr(field.type, "__name__") else field.type for field in fields ],
"default": [None if isinstance(field.default, dataclasses._MISSING_TYPE) else field.default for field in fields],
},
)
df = df.set_index("name")

facade_attrs[cls_name] = df

return facade_attrs


def write_table_rst(csv_directory, destination):
csv_files = sorted([file for file in os.listdir(csv_directory) if file.endswith(".csv")])
txt = ""
txt += \
"""
==========================
Facade attributes overview
==========================
"""
for csv_file in csv_files:
txt += \
f"""
:py:class:`~oemof.tabular.facades.{os.path.splitext(csv_file)[0]}`
.. csv-table::
:delim: ,
:header-rows: 1
:file: facade_attributes/{csv_file}
"""
with open(destination, "w") as file:
file.write(txt)
12 changes: 11 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
from __future__ import unicode_literals

import os
import sys

from oemof.tabular.facades import TYPEMAP

sys.path.append("code")
from get_facade_attributes import get_facade_attrs, write_table_rst

facade_attrs = get_facade_attrs(TYPEMAP)
for facade, attrs in facade_attrs.items():
attrs.to_csv(os.path.join("facade_attributes", facade + ".csv"))
write_table_rst("facade_attributes", "facades.rst")

extensions = [
'sphinx.ext.autodoc',
Expand Down Expand Up @@ -36,7 +46,7 @@
year = '2018'
author = 'Stephan Günther'
copyright = '{0}, {1}'.format(year, author)
version = release = '0.0.3'
version = release = '0.0.5dev'

pygments_style = 'trac'
templates_path = ['.']
Expand Down
Empty file added docs/facade_attributes/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Contents
readme
installation
usage
facades
reference/index
tutorials/index
contributing
Expand Down
74 changes: 71 additions & 3 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,75 @@
=============
API Reference
=============

.. toctree::
:glob:
oemof.tabular.datapackage package
=================================

.. automodule:: oemof.tabular.datapackage
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

oemof.tabular.datapackage.aggregation module
--------------------------------------------

.. automodule:: oemof.tabular.datapackage.aggregation
:members:
:undoc-members:
:show-inheritance:

oemof.tabular.datapackage.building module
-----------------------------------------

.. automodule:: oemof.tabular.datapackage.building
:members:
:undoc-members:
:show-inheritance:

oemof.tabular.datapackage.processing module
-------------------------------------------

.. automodule:: oemof.tabular.datapackage.processing
:members:
:undoc-members:
:show-inheritance:

oemof.tabular.datapackage.reading module
----------------------------------------

.. automodule:: oemof.tabular.datapackage.reading
:members:
:undoc-members:
:show-inheritance:

oemof.tabular.tools package
===========================

.. automodule:: oemof.tabular.tools
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

oemof.tabular.tools.geometry module
-----------------------------------

.. automodule:: oemof.tabular.tools.geometry
:members:
:undoc-members:
:show-inheritance:



oemof.tabular.facades module
=============================

oemof.tabular*
.. automodule:: oemof.tabular.facades
:members:
:undoc-members:
:show-inheritance:
44 changes: 0 additions & 44 deletions docs/reference/oemof.tabular.datapackage.rst

This file was deleted.

Loading

0 comments on commit c00ad89

Please sign in to comment.