tespy 0.3.0__tar.gz → 0.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. {TESPy-0.3.0 → TESPy-0.3.1}/PKG-INFO +1 -1
  2. TESPy-0.3.1/docs/whats_new/v0-3-1.rst +11 -0
  3. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new.rst +1 -0
  4. {TESPy-0.3.0 → TESPy-0.3.1}/setup.py +1 -1
  5. {TESPy-0.3.0 → TESPy-0.3.1}/src/TESPy.egg-info/PKG-INFO +1 -1
  6. {TESPy-0.3.0 → TESPy-0.3.1}/src/TESPy.egg-info/SOURCES.txt +1 -0
  7. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/__init__.py +1 -1
  8. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/heat_exchangers.py +0 -2
  9. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/networks/networks.py +71 -89
  10. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/tools/logger.py +1 -2
  11. {TESPy-0.3.0 → TESPy-0.3.1}/.bumpversion.cfg +0 -0
  12. {TESPy-0.3.0 → TESPy-0.3.1}/.coveragerc +0 -0
  13. {TESPy-0.3.0 → TESPy-0.3.1}/.editorconfig +0 -0
  14. {TESPy-0.3.0 → TESPy-0.3.1}/.gitignore +0 -0
  15. {TESPy-0.3.0 → TESPy-0.3.1}/.pep8speaks.yml +0 -0
  16. {TESPy-0.3.0 → TESPy-0.3.1}/.readthedocs.yml +0 -0
  17. {TESPy-0.3.0 → TESPy-0.3.1}/.travis.yml +0 -0
  18. {TESPy-0.3.0 → TESPy-0.3.1}/CODE_OF_CONDUCT.md +0 -0
  19. {TESPy-0.3.0 → TESPy-0.3.1}/CONTRIBUTING.md +0 -0
  20. {TESPy-0.3.0 → TESPy-0.3.1}/LICENSE +0 -0
  21. {TESPy-0.3.0 → TESPy-0.3.1}/MANIFEST.in +0 -0
  22. {TESPy-0.3.0 → TESPy-0.3.1}/PULL_REQUEST_TEMPLATE.md +0 -0
  23. {TESPy-0.3.0 → TESPy-0.3.1}/README.rst +0 -0
  24. {TESPy-0.3.0 → TESPy-0.3.1}/ci/appveyor-with-compiler.cmd +0 -0
  25. {TESPy-0.3.0 → TESPy-0.3.1}/ci/bootstrap.py +0 -0
  26. {TESPy-0.3.0 → TESPy-0.3.1}/ci/requirements.txt +0 -0
  27. {TESPy-0.3.0 → TESPy-0.3.1}/ci/templates/.appveyor.yml +0 -0
  28. {TESPy-0.3.0 → TESPy-0.3.1}/ci/templates/.travis.yml +0 -0
  29. {TESPy-0.3.0 → TESPy-0.3.1}/ci/templates/tox.ini +0 -0
  30. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/basic.svg +0 -0
  31. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/basic_efficiency.svg +0 -0
  32. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/cc_bp.svg +0 -0
  33. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/chp.svg +0 -0
  34. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/chp_PQ.svg +0 -0
  35. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/combustion_chamber.svg +0 -0
  36. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/combustion_engine.svg +0 -0
  37. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/compressor.svg +0 -0
  38. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/condenser.svg +0 -0
  39. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/dhs.svg +0 -0
  40. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/dhs_closed.svg +0 -0
  41. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/dhs_forks.svg +0 -0
  42. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/dhs_open.svg +0 -0
  43. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/droplet_separator.svg +0 -0
  44. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/drum.svg +0 -0
  45. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/heat_exchanger.svg +0 -0
  46. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/heat_pump.svg +0 -0
  47. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/heat_pump_COP_air.svg +0 -0
  48. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/heat_pump_COP_water.svg +0 -0
  49. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/heat_pump_example.svg +0 -0
  50. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/intro_connections.svg +0 -0
  51. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/intro_district_heating_scheme.svg +0 -0
  52. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/logph_diagram_states.svg +0 -0
  53. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/merge.svg +0 -0
  54. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/node.svg +0 -0
  55. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/orc_evaporator.svg +0 -0
  56. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/parabolic_trough.svg +0 -0
  57. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/pipe.svg +0 -0
  58. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/pump.svg +0 -0
  59. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/solar_collector.svg +0 -0
  60. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/split.svg +0 -0
  61. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/subsys_interface.svg +0 -0
  62. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/subsystem_waste_heat_generator.svg +0 -0
  63. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/turbine.svg +0 -0
  64. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/tutorial_heat_pump.svg +0 -0
  65. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/valve.svg +0 -0
  66. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/_images/water_electrolyzer.svg +0 -0
  67. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/modules.rst +0 -0
  68. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/tespy.components.rst +0 -0
  69. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/tespy.networks.rst +0 -0
  70. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/tespy.rst +0 -0
  71. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api/tespy.tools.rst +0 -0
  72. {TESPy-0.3.0 → TESPy-0.3.1}/docs/api.rst +0 -0
  73. {TESPy-0.3.0 → TESPy-0.3.1}/docs/conf.py +0 -0
  74. {TESPy-0.3.0 → TESPy-0.3.1}/docs/developing_tespy.rst +0 -0
  75. {TESPy-0.3.0 → TESPy-0.3.1}/docs/first_steps.rst +0 -0
  76. {TESPy-0.3.0 → TESPy-0.3.1}/docs/index.rst +0 -0
  77. {TESPy-0.3.0 → TESPy-0.3.1}/docs/installation.rst +0 -0
  78. {TESPy-0.3.0 → TESPy-0.3.1}/docs/introduction.rst +0 -0
  79. {TESPy-0.3.0 → TESPy-0.3.1}/docs/references.bib +0 -0
  80. {TESPy-0.3.0 → TESPy-0.3.1}/docs/requirements.txt +0 -0
  81. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules/characteristics.rst +0 -0
  82. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules/components.rst +0 -0
  83. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules/connections.rst +0 -0
  84. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules/fluid_properties.rst +0 -0
  85. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules/networks.rst +0 -0
  86. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules/other.rst +0 -0
  87. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules/subsystems.rst +0 -0
  88. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tespy_modules.rst +0 -0
  89. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/clausius_rankine.rst +0 -0
  90. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/clausius_rankine_chp.rst +0 -0
  91. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/combined_cycle_chp.rst +0 -0
  92. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/combustion_engine.rst +0 -0
  93. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/district_heating.rst +0 -0
  94. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/heat_pump.rst +0 -0
  95. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/solar_collector.rst +0 -0
  96. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/tutorial_combustion_chamber.rst +0 -0
  97. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples/tutorial_heat_pump.rst +0 -0
  98. {TESPy-0.3.0 → TESPy-0.3.1}/docs/tutorials_examples.rst +0 -0
  99. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-0-1.rst +0 -0
  100. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-0-2.rst +0 -0
  101. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-0-3.rst +0 -0
  102. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-0-4.rst +0 -0
  103. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-0-5.rst +0 -0
  104. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-1-0.rst +0 -0
  105. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-1-1.rst +0 -0
  106. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-1-2.rst +0 -0
  107. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-1-3.rst +0 -0
  108. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-1-4.rst +0 -0
  109. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-2-0.rst +0 -0
  110. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-2-1.rst +0 -0
  111. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-2-2.rst +0 -0
  112. {TESPy-0.3.0 → TESPy-0.3.1}/docs/whats_new/v0-3-0.rst +0 -0
  113. {TESPy-0.3.0 → TESPy-0.3.1}/docs/zliterature.rst +0 -0
  114. {TESPy-0.3.0 → TESPy-0.3.1}/paper.bib +0 -0
  115. {TESPy-0.3.0 → TESPy-0.3.1}/paper.md +0 -0
  116. {TESPy-0.3.0 → TESPy-0.3.1}/pyproject.toml +0 -0
  117. {TESPy-0.3.0 → TESPy-0.3.1}/setup.cfg +0 -0
  118. {TESPy-0.3.0 → TESPy-0.3.1}/src/TESPy.egg-info/dependency_links.txt +0 -0
  119. {TESPy-0.3.0 → TESPy-0.3.1}/src/TESPy.egg-info/not-zip-safe +0 -0
  120. {TESPy-0.3.0 → TESPy-0.3.1}/src/TESPy.egg-info/requires.txt +0 -0
  121. {TESPy-0.3.0 → TESPy-0.3.1}/src/TESPy.egg-info/top_level.txt +0 -0
  122. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/__init__.py +0 -0
  123. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/basics.py +0 -0
  124. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/combustion.py +0 -0
  125. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/components.py +0 -0
  126. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/customs.py +0 -0
  127. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/nodes.py +0 -0
  128. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/piping.py +0 -0
  129. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/reactors.py +0 -0
  130. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/subsystems.py +0 -0
  131. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/components/turbomachinery.py +0 -0
  132. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/connections.py +0 -0
  133. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/data/__init__.py +0 -0
  134. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/data/char_lines.json +0 -0
  135. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/data/char_maps.json +0 -0
  136. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/networks/__init__.py +0 -0
  137. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/networks/network_reader.py +0 -0
  138. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/tools/__init__.py +0 -0
  139. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/tools/characteristics.py +0 -0
  140. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/tools/data_containers.py +0 -0
  141. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/tools/fluid_properties.py +0 -0
  142. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/tools/global_vars.py +0 -0
  143. {TESPy-0.3.0 → TESPy-0.3.1}/src/tespy/tools/helpers.py +0 -0
  144. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_busses.py +0 -0
  145. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_components/test_combustion.py +0 -0
  146. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_components/test_heat_exchangers.py +0 -0
  147. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_components/test_orc_evaporator.py +0 -0
  148. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_components/test_piping.py +0 -0
  149. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_components/test_reactors.py +0 -0
  150. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_components/test_turbomachinery.py +0 -0
  151. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_errors.py +0 -0
  152. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_models/test_gas_turbine_models.py +0 -0
  153. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_models/test_heat_pump_model.py +0 -0
  154. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_networks/test_network.py +0 -0
  155. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_tools/test_characteristics.py +0 -0
  156. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_tools/test_fluid_properties.py +0 -0
  157. {TESPy-0.3.0 → TESPy-0.3.1}/tests/test_tools/test_helpers.py +0 -0
  158. {TESPy-0.3.0 → TESPy-0.3.1}/tox.ini +0 -0
  159. {TESPy-0.3.0 → TESPy-0.3.1}/tutorial/step_1.py +0 -0
  160. {TESPy-0.3.0 → TESPy-0.3.1}/tutorial/step_2.py +0 -0
  161. {TESPy-0.3.0 → TESPy-0.3.1}/tutorial/step_3.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TESPy
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Thermal Engineering Systems in Python (TESPy)
5
5
  Home-page: https://github.com/oemof/tespy
6
6
  Author: Francesco Witte
@@ -0,0 +1,11 @@
1
+ v0.3.1 - Fix for Mayer's Merit (May, 29, 2020)
2
+ ++++++++++++++++++++++++++++++++++++++++++++++
3
+
4
+ Bug fixes
5
+ #########
6
+ - Remove a debugging printout in the kA_func of the
7
+ :py:class:`tespy.components.heat_exchangers.heat_exchanger_simple` class.
8
+
9
+ Contributors
10
+ ############
11
+ - Francesco Witte (`@fwitte <https://github.com/fwitte>`_)
@@ -8,6 +8,7 @@ Discover noteable new features and improvements in each release
8
8
  :local:
9
9
  :backlinks: top
10
10
 
11
+ .. include:: whats_new/v0-3-1.rst
11
12
  .. include:: whats_new/v0-3-0.rst
12
13
  .. include:: whats_new/v0-2-2.rst
13
14
  .. include:: whats_new/v0-2-1.rst
@@ -25,7 +25,7 @@ def read(*names, **kwargs):
25
25
 
26
26
  setup(
27
27
  name='TESPy',
28
- version='0.3.0',
28
+ version='0.3.1',
29
29
  license='MIT',
30
30
  description='Thermal Engineering Systems in Python (TESPy)',
31
31
  long_description='%s' % (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TESPy
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Thermal Engineering Systems in Python (TESPy)
5
5
  Home-page: https://github.com/oemof/tespy
6
6
  Author: Francesco Witte
@@ -108,6 +108,7 @@ docs/whats_new/v0-2-0.rst
108
108
  docs/whats_new/v0-2-1.rst
109
109
  docs/whats_new/v0-2-2.rst
110
110
  docs/whats_new/v0-3-0.rst
111
+ docs/whats_new/v0-3-1.rst
111
112
  src/TESPy.egg-info/PKG-INFO
112
113
  src/TESPy.egg-info/SOURCES.txt
113
114
  src/TESPy.egg-info/dependency_links.txt
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8
2
2
 
3
- __version__ = '0.3.0 - Mayer\'s Merit'
3
+ __version__ = '0.3.1 - Mayer\'s Merit'
4
4
 
5
5
  # tespy data and connection import
6
6
  from . import connections # noqa: F401
@@ -647,8 +647,6 @@ class heat_exchanger_simple(component):
647
647
  else:
648
648
  td_log = 0
649
649
 
650
- print(ttd_1, ttd_2)
651
-
652
650
  return i[0] * (o[2] - i[2]) + self.kA.val * td_log
653
651
 
654
652
  def kA_char_func(self):
@@ -305,11 +305,11 @@ class network:
305
305
  self.h_range_SI = np.array([1e3, 7e6])
306
306
 
307
307
  for prop in ['m', 'p', 'h']:
308
- msg = ('Default ' + self.props[prop] + ' limits, min: ' +
309
- str(self.__dict__[prop + '_range_SI'][0]) + ' ' +
310
- self.SI_units[prop] + ', max: ' +
311
- str(self.__dict__[prop + '_range_SI'][1]) + ' ' +
312
- self.SI_units[prop] + '.')
308
+ limits = self.get_attr(prop + '_range_SI')
309
+ msg = (
310
+ 'Default ' + self.props[prop] + ' limits, min: ' +
311
+ str(limits[0]) + ' ' + self.SI_units[prop] + ', max: ' +
312
+ str(limits[1]) + ' ' + self.SI_units[prop] + '.')
313
313
  logging.debug(msg)
314
314
 
315
315
  self.set_attr(**kwargs)
@@ -365,7 +365,7 @@ class network:
365
365
  logging.error(msg)
366
366
  raise ValueError(msg)
367
367
  else:
368
- self.__dict__[unit] = kwargs[unit]
368
+ self.__dict__.update({unit: kwargs[unit]})
369
369
  msg = ('Setting ' + self.props[prop] + ' unit: ' +
370
370
  kwargs[unit] + '.')
371
371
  logging.debug(msg)
@@ -382,13 +382,13 @@ class network:
382
382
  self.__dict__.update(
383
383
  {prop + '_range_SI':
384
384
  np.array(kwargs[prop + '_range']) *
385
- self.__dict__[prop][self.__dict__[prop + '_unit']]})
385
+ self.get_attr(prop)[self.get_attr(prop + '_unit')]})
386
386
 
387
- msg = ('Setting ' + self.props[prop] + ' limits, min: ' +
388
- str(self.__dict__[prop + '_range_SI'][0]) + ' ' +
389
- self.SI_units[prop] + ', max: ' +
390
- str(self.__dict__[prop + '_range_SI'][1]) + ' ' +
391
- self.SI_units[prop] + '.')
387
+ limits = self.get_attr(prop + '_range_SI')
388
+ msg = (
389
+ 'Setting ' + self.props[prop] + ' limits, min: ' +
390
+ str(limits[0]) + ' ' + self.SI_units[prop] + ', max: ' +
391
+ str(limits[1]) + ' ' + self.SI_units[prop] + '.')
392
392
  logging.debug(msg)
393
393
 
394
394
  # update non SI value ranges
@@ -438,18 +438,6 @@ class network:
438
438
  for c in subsys.conns.values():
439
439
  self.add_conns(c)
440
440
 
441
- def add_nwks(self, *args):
442
- """
443
- Add connections from a different network.
444
-
445
- :param args: network objects si :code:`add_subsys(s1, s2, s3, ...)`
446
- :type args: tespy.networks.network
447
- :returns: no return value
448
- """
449
- for nw in args:
450
- for c in nw.conns.index:
451
- self.add_conns(c)
452
-
453
441
  def add_conns(self, *args):
454
442
  r"""
455
443
  Add one or more connections to the network.
@@ -613,18 +601,18 @@ class network:
613
601
  num_o = (self.conns[['source', 'target']] == comp).sum().source
614
602
  num_i = (self.conns[['source', 'target']] == comp).sum().target
615
603
  if num_o != comp.num_o:
616
- msg = (comp.label + ' is missing ' + str(comp.num_o - num_o) +
617
- ' outgoing connections. Make sure all outlets are '
618
- ' connected and all connections have been added to the '
619
- 'network.')
604
+ msg = (
605
+ comp.label + ' is missing ' + str(comp.num_o - num_o) + ' '
606
+ 'outgoing connections. Make sure all outlets are connected'
607
+ ' and all connections have been added to the network.')
620
608
  logging.error(msg)
621
609
  # raise an error in case network check is unsuccesful
622
610
  raise hlp.TESPyNetworkError(msg)
623
611
  elif num_i != comp.num_i:
624
- msg = (comp.label + ' is missing ' + str(comp.num_i - num_i) +
625
- ' incoming connections. Make sure all inlets are '
626
- ' connected and all connections have been added to the '
627
- 'network.')
612
+ msg = (
613
+ comp.label + ' is missing ' + str(comp.num_i - num_i) + ' '
614
+ 'incoming connections. Make sure all inlets are connected '
615
+ 'and all connections have been added to the network.')
628
616
  logging.error(msg)
629
617
  # raise an error in case network check is unsuccesful
630
618
  raise hlp.TESPyNetworkError(msg)
@@ -679,10 +667,10 @@ class network:
679
667
 
680
668
  # check for duplicates in the component labels
681
669
  if len(labels) != len(list(set(labels))):
682
- duplicates = [item for item, count in
683
- Counter(labels).items() if count > 1]
684
- msg = ('All Components must have unique labels, duplicates are: '
685
- + str(duplicates) + '.')
670
+ duplicates = [
671
+ item for item, count in Counter(labels).items() if count > 1]
672
+ msg = ('All Components must have unique labels, duplicates are: ' +
673
+ str(duplicates) + '.')
686
674
  logging.error(msg)
687
675
  raise hlp.TESPyNetworkError(msg)
688
676
 
@@ -702,9 +690,9 @@ class network:
702
690
  - Switch from design/offdesign parameter specification.
703
691
  """
704
692
  if len(self.conns) == 0:
705
- msg = ('No connections have been added to the network, please '
706
- 'make sure to add your connections with the '
707
- '.add_conns() method.')
693
+ msg = (
694
+ 'No connections have been added to the network, please make '
695
+ 'sure to add your connections with the .add_conns() method.')
708
696
  logging.error(msg)
709
697
  raise hlp.TESPyNetworkError(msg)
710
698
 
@@ -818,11 +806,10 @@ class network:
818
806
  # read design point information
819
807
  path = hlp.modify_path_os(
820
808
  cp.design_path + '/components/' + c + '.csv')
821
- df = pd.read_csv(path, sep=';', decimal='.',
822
- converters={
823
- 'busses': ast.literal_eval,
824
- 'bus_P_ref': ast.literal_eval
825
- })
809
+ df = pd.read_csv(
810
+ path, sep=';', decimal='.', converters={
811
+ 'busses': ast.literal_eval,
812
+ 'bus_P_ref': ast.literal_eval})
826
813
  df.set_index('label', inplace=True)
827
814
  # write data
828
815
  self.init_comp_design_params(cp, df.loc[cp.label])
@@ -884,14 +871,15 @@ class network:
884
871
  (connections) handle the parameter specification.
885
872
  """
886
873
  # components without any parameters
887
- not_required = ['source', 'sink', 'node', 'merge', 'splitter',
888
- 'separator', 'drum', 'subsystem_interface']
874
+ not_required = [
875
+ 'source', 'sink', 'node', 'merge', 'splitter', 'separator', 'drum',
876
+ 'subsystem_interface', 'droplet_separator']
889
877
  # fetch all components, reindex with label
890
878
  cp_sort = self.comps.copy()
891
879
  # get class name
892
880
  cp_sort['cp'] = cp_sort.apply(network.get_class_base, axis=1)
893
- cp_sort['label'] = cp_sort.apply(network.get_props, axis=1,
894
- args=('label',))
881
+ cp_sort['label'] = cp_sort.apply(
882
+ network.get_props, axis=1, args=('label',))
895
883
  cp_sort['comp'] = cp_sort.index
896
884
  cp_sort.set_index('label', inplace=True)
897
885
 
@@ -931,7 +919,7 @@ class network:
931
919
  # write data to components
932
920
  self.init_comp_design_params(comp, data)
933
921
 
934
- msg = 'Read design point information for components.'
922
+ msg = 'Done reading design point information for components.'
935
923
  logging.debug(msg)
936
924
 
937
925
  # read connection design point information
@@ -952,8 +940,8 @@ class network:
952
940
  'Reading individual design point information for '
953
941
  'connection ' + c.label + ' from path ' + path_c + '.')
954
942
  logging.debug(msg)
955
- df_c = pd.read_csv(path_c, index_col=0,
956
- delimiter=';', decimal='.')
943
+ df_c = pd.read_csv(
944
+ path_c, index_col=0, delimiter=';', decimal='.')
957
945
 
958
946
  # write data
959
947
  self.init_conn_design_params(c, df_c)
@@ -962,7 +950,7 @@ class network:
962
950
  # write data
963
951
  self.init_conn_design_params(c, df)
964
952
 
965
- msg = 'Read design point information for connections.'
953
+ msg = 'Done reading design point information for connections.'
966
954
  logging.debug(msg)
967
955
 
968
956
  def init_comp_design_params(self, component, data):
@@ -1006,19 +994,13 @@ class network:
1006
994
  df['source_id'].isin([c.source_id]) &
1007
995
  df['target_id'].isin([c.target_id])]
1008
996
 
1009
- if len(conn.index) > 0:
997
+ try:
1010
998
  # read connection information
1011
999
  conn_id = conn.index[0]
1012
- c.m.design = (
1013
- df.loc[conn_id, 'm'] * self.m[df.loc[conn_id, 'm_unit']])
1014
- c.p.design = (
1015
- df.loc[conn_id, 'p'] * self.p[df.loc[conn_id, 'p_unit']])
1016
- c.h.design = (
1017
- df.loc[conn_id, 'h'] * self.h[df.loc[conn_id, 'h_unit']])
1018
- c.v.design = (
1019
- df.loc[conn_id, 'v'] * self.v[df.loc[conn_id, 'v_unit']])
1020
- c.x.design = (
1021
- df.loc[conn_id, 'x'] * self.x[df.loc[conn_id, 'x_unit']])
1000
+ for var in ['m', 'p', 'h', 'v', 'x']:
1001
+ c.get_attr(var).design = (
1002
+ df.loc[conn_id, var] *
1003
+ self.get_attr(var)[df.loc[conn_id, var + '_unit']])
1022
1004
  c.T.design = ((df.loc[conn_id, 'T'] +
1023
1005
  self.T[df.loc[conn_id, 'T_unit']][0]) *
1024
1006
  self.T[df.loc[conn_id, 'T_unit']][1])
@@ -1026,7 +1008,7 @@ class network:
1026
1008
  self.T[df.loc[conn_id, 'T_unit']][1])
1027
1009
  for fluid in self.fluids:
1028
1010
  c.fluid.design[fluid] = df.loc[conn_id, fluid]
1029
- else:
1011
+ except IndexError:
1030
1012
  # no matches in the connections of the network and the design files
1031
1013
  msg = (
1032
1014
  'Could not find connection ' + c.label + ' in design case. '
@@ -1123,9 +1105,9 @@ class network:
1123
1105
  # iterate over connectons, create ordered dicts
1124
1106
  for c in self.conns.index:
1125
1107
  c.conn_loc = self.conns.index.get_loc(c)
1126
- tmp = c.fluid.val.copy()
1127
- tmp0 = c.fluid.val0.copy()
1128
- tmp_set = c.fluid.val_set.copy()
1108
+ tmp = c.fluid.val
1109
+ tmp0 = c.fluid.val0
1110
+ tmp_set = c.fluid.val_set
1129
1111
  c.fluid.val = OrderedDict()
1130
1112
  c.fluid.val0 = OrderedDict()
1131
1113
  c.fluid.val_set = OrderedDict()
@@ -1375,7 +1357,7 @@ class network:
1375
1357
  c.get_attr(key).unit = self.get_attr('T_unit')
1376
1358
  else:
1377
1359
  c.get_attr(key).unit = self.get_attr(key + '_unit')
1378
- if (key not in ['T', 'x', 'v', 's', 'vol', 'Td_bp'] and
1360
+ if (key in ['m', 'p', 'h'] and
1379
1361
  c.get_attr(key).val_set is False):
1380
1362
  if c.good_starting_values is False:
1381
1363
  self.init_val0(c, key)
@@ -1412,7 +1394,10 @@ class network:
1412
1394
 
1413
1395
  # starting values for specified vapour content or temperature
1414
1396
  if c.x.val_set and not c.h.val_set:
1415
- c.h.val_SI = fp.h_mix_pQ(c.to_flow(), c.x.val_SI)
1397
+ try:
1398
+ c.h.val_SI = fp.h_mix_pQ(c.to_flow(), c.x.val_SI)
1399
+ except ValueError:
1400
+ pass
1416
1401
 
1417
1402
  if c.T.val_set and not c.h.val_set:
1418
1403
  try:
@@ -1500,7 +1485,7 @@ class network:
1500
1485
  df['target'].isin([c.target.label]) &
1501
1486
  df['source_id'].isin([c.source_id]) &
1502
1487
  df['target_id'].isin([c.target_id])]
1503
- if len(conn.index) > 0:
1488
+ try:
1504
1489
  conn_id = conn.index[0]
1505
1490
  # overwrite SI-values with values from init_file,
1506
1491
  # except user specified values
@@ -1523,7 +1508,7 @@ class network:
1523
1508
  c.h.val0 = c.h.val_SI / self.h[c.h.unit]
1524
1509
  c.fluid.val0 = c.fluid.val.copy()
1525
1510
  c.good_starting_values = True
1526
- else:
1511
+ except IndexError:
1527
1512
  msg = (
1528
1513
  'Could not find connection ' + c.label + ' in '
1529
1514
  'connections.csv of init_path ' + self.init_path + '.')
@@ -1575,18 +1560,18 @@ class network:
1575
1560
  For more information on the solution process have a look at the online
1576
1561
  documentation at tespy.readthedocs.io in the section "using TESPy".
1577
1562
  """
1563
+ self.new_design = False
1578
1564
  if self.design_path == design_path and design_path is not None:
1579
1565
  for c in self.conns.index:
1580
1566
  if c.new_design is True:
1581
1567
  self.new_design = True
1582
1568
  break
1569
+ if self.new_design is False:
1570
+ for cp in self.comps.index:
1571
+ if cp.new_design is True:
1572
+ self.new_design = True
1573
+ break
1583
1574
 
1584
- for cp in self.comps.index:
1585
- if cp.new_design is True:
1586
- self.new_design = True
1587
- break
1588
-
1589
- self.new_design = False
1590
1575
  else:
1591
1576
  self.new_design = True
1592
1577
 
@@ -1899,7 +1884,7 @@ class network:
1899
1884
  # keep mass fractions within [0, 1]
1900
1885
  if c.fluid.val[fluid] < err:
1901
1886
  c.fluid.val[fluid] = 0
1902
- if c.fluid.val[fluid] > 1 - err:
1887
+ elif c.fluid.val[fluid] > 1 - err:
1903
1888
  c.fluid.val[fluid] = 1
1904
1889
 
1905
1890
  j += 1
@@ -1922,7 +1907,7 @@ class network:
1922
1907
  # keep value within specified value range
1923
1908
  if var.val < var.min_val:
1924
1909
  var.val = var.min_val
1925
- if var.val > var.max_val:
1910
+ elif var.val > var.max_val:
1926
1911
  var.val = var.max_val
1927
1912
 
1928
1913
  sum_c_var += cp.num_vars
@@ -2059,10 +2044,12 @@ class network:
2059
2044
  """
2060
2045
  flow = c.to_flow()
2061
2046
  Tmin = max(
2062
- [fp.memorise.value_range[f][2] for f in flow[3].keys() if flow[3][f] > err]
2047
+ [fp.memorise.value_range[f][2] for
2048
+ f in flow[3].keys() if flow[3][f] > err]
2063
2049
  ) + 100
2064
2050
  Tmax = min(
2065
- [fp.memorise.value_range[f][3] for f in flow[3].keys() if flow[3][f] > err]
2051
+ [fp.memorise.value_range[f][3] for
2052
+ f in flow[3].keys() if flow[3][f] > err]
2066
2053
  ) - 100
2067
2054
  hmin = fp.h_mix_pT(flow, Tmin)
2068
2055
  hmax = fp.h_mix_pT(flow, Tmax)
@@ -2391,7 +2378,6 @@ class network:
2391
2378
  # equations and derivatives for specified primary variables are static
2392
2379
  if self.iter == 0:
2393
2380
  for c in self.conns.index:
2394
- flow = c.to_flow()
2395
2381
  col = c.conn_loc * self.num_conn_vars
2396
2382
 
2397
2383
  # specified mass flow, pressure and enthalpy
@@ -2422,15 +2408,12 @@ class network:
2422
2408
  if bus.P.is_set is True:
2423
2409
  P_res = 0
2424
2410
  for cp in bus.comps.index:
2425
- i = self.comps.loc[cp, 'inlets'].tolist()
2426
- o = self.comps.loc[cp, 'outlets'].tolist()
2427
2411
 
2428
- P_res += cp.calc_bus_value(bus)
2412
+ P_res -= cp.calc_bus_value(bus)
2429
2413
  deriv = -cp.bus_deriv(bus)
2430
2414
 
2431
2415
  j = 0
2432
- for c in i + o:
2433
- loc = self.conns.index.get_loc(c)
2416
+ for loc in cp.conn_loc:
2434
2417
  # start collumn index
2435
2418
  coll_s = loc * self.num_conn_vars
2436
2419
  # end collumn index
@@ -2438,8 +2421,7 @@ class network:
2438
2421
  self.jacobian[row, coll_s:coll_e] = deriv[:, j]
2439
2422
  j += 1
2440
2423
 
2441
- self.residual[row] = bus.P.val - P_res
2442
-
2424
+ self.residual[row] = bus.P.val + P_res
2443
2425
  row += 1
2444
2426
 
2445
2427
  def postprocessing(self):
@@ -196,8 +196,7 @@ def check_git_branch():
196
196
  <class 'str'>
197
197
  """
198
198
  path = os.path.join(os.path.dirname(
199
- os.path.realpath(__file__)), os.pardir,
200
- os.pardir, '.git')
199
+ os.path.realpath(__file__)), os.pardir, os.pardir, os.pardir, '.git')
201
200
 
202
201
  # Reads the name of the branch
203
202
  f_branch = os.path.join(path, 'HEAD')
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes