-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed setup, updated readme, added tests
- Loading branch information
Showing
9 changed files
with
95 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,9 @@ | ||
name: topotherm | ||
name: topotherm> | ||
channels: | ||
- defaults | ||
- conda-forge | ||
- defaults | ||
dependencies: | ||
- python>=3.9 | ||
- numpy<2.0 | ||
- pandas | ||
- scipy | ||
- networkx | ||
- matplotlib | ||
- pyomo | ||
- pyarrow>=14.0.1 | ||
- Pillow>=10.2.0 | ||
- pytest | ||
- pydantic | ||
- pyyaml | ||
- pip | ||
- pip: | ||
- -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[build-system] | ||
requires = ["setuptools >= 64"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
|
||
name = "topotherm" | ||
version = "0.2.0" | ||
description = "A package to design district heating networks" | ||
readme = "README.md" | ||
|
||
authors = [ | ||
{ name = "Jerry Lambert", email = "jerry.lambert@tum.de"}, | ||
{ name = "Amedeo Ceruti", email = "amedeo.ceruti@tum.de"} | ||
] | ||
|
||
classifiers=[ | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Scientific/Engineering :: District Heating", | ||
] | ||
|
||
keywords = [ | ||
"district heating", | ||
"optimization", | ||
"Linear Programming", | ||
"Mixed Integer Linear Programming" | ||
] | ||
|
||
license = {file = "LICENSE"} | ||
|
||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"numpy", | ||
"pandas", | ||
"scipy", | ||
"networkx", | ||
"matplotlib", | ||
"pyomo > 6.0", | ||
"pyarrow >= 14.0.1", | ||
"Pillow >= 10.2.0", | ||
"pyyaml", | ||
"pydantic", | ||
] | ||
|
||
[tool.setuptools] | ||
packages = { find = { where = ["topotherm"], exclude = ["tests", "docs"] } } | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest", | ||
] | ||
docs = [ | ||
"sphinx", | ||
"sphinx-rtd-theme", | ||
"sphinx-autodoc", | ||
"sphinx-viewcode" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
numpy<2.0 | ||
numpy | ||
pandas | ||
scipy | ||
networkx | ||
matplotlib | ||
pyomo | ||
pyomo>6.0 | ||
pyarrow>=14.0.1 | ||
Pillow>=10.2.0 | ||
pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,5 @@ | ||
"""Set up topotherm from requirements.""" | ||
from setuptools import setup | ||
|
||
import os | ||
from setuptools import setup, find_packages | ||
|
||
|
||
# The directory containing this file | ||
here = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
# The text of the README file | ||
with open(os.path.join(here, "README.md"), encoding='utf-8') as fid: | ||
readme = fid.read() | ||
|
||
with open(os.path.join(here, "requirements.txt"), encoding='utf-8') as fid: | ||
reqs = fid.read().splitlines() | ||
|
||
# This call to setup() does all the work | ||
setup( | ||
name="topotherm", | ||
version="0.1.0", | ||
description="A package to design district heating networks", | ||
long_description=readme, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/jylambert/topotherm", | ||
author="Jerry Lambert, Amedeo Ceruti", | ||
author_email="jerry.lambert@tum.de, amedeo.ceruti@tum.de", | ||
license="MIT", | ||
classifiers=[ | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Scientific/Engineering :: District Heating", | ||
], | ||
packages=find_packages(exclude=("tests", "docs")), | ||
include_package_data=True, | ||
install_requires=reqs, | ||
keywords=["district heating", "optimization", "Linear Programming", | ||
"Mixed Integer Linear Programming"] | ||
) | ||
if __name__ == "__main__": | ||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://stackoverflow.com/questions/54895002/modulenotfounderror-with-pytest | ||
import sys | ||
sys.path.append('.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""test_setup.py tests the correct setup of topotherm.""" | ||
|
||
from pytest import approx | ||
|
||
def test_import(): | ||
import topotherm | ||
|
||
|
||
def test_functionality(): | ||
from topotherm import single_timestep | ||
assert single_timestep.annuity(c_i=0.01, n=10) == approx(0.1055820766, rel=1e-2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters