Skip to content

Commit

Permalink
Preserve existing API and add FutureWarning.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfreissmann committed Jun 14, 2024
1 parent 5010924 commit 7d29505
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/tespy/components/nodes/drum.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
SPDX-License-Identifier: MIT
"""

import warnings

import numpy as np

from tespy.components.component import component_registry
Expand Down Expand Up @@ -422,8 +424,25 @@ def get_plotting_data(self):
the keys :code:`3` and :code:`4` connect the (superheated) gas of
'in2' with the same.
"""
msg = (
"""
For now the dict entry of key '1' will contain the old isoline
between saturated liquid and saturated vapor. This entry will be
dropped in future versions of this method.
"""
)
warnings.warn(msg, FutureWarning)
return {
1: {
'isoline_property': 'p',
'isoline_value': self.outl[0].p.val,
'isoline_value_end': self.outl[1].p.val,
'starting_point_property': 'v',
'starting_point_value': self.outl[0].vol.val,
'ending_point_property': 'v',
'ending_point_value': self.outl[1].vol.val
},
2: {
'isoline_property': 'p',
'isoline_value': self.inl[0].p.val,
'isoline_value_end': self.outl[0].p.val,
Expand All @@ -432,7 +451,7 @@ def get_plotting_data(self):
'ending_point_property': 'v',
'ending_point_value': self.outl[0].vol.val
},
2: {
3: {
'isoline_property': 'p',
'isoline_value': self.inl[0].p.val,
'isoline_value_end': self.outl[1].p.val,
Expand All @@ -441,7 +460,7 @@ def get_plotting_data(self):
'ending_point_property': 'v',
'ending_point_value': self.outl[1].vol.val
},
3: {
4: {
'isoline_property': 'p',
'isoline_value': self.inl[1].p.val,
'isoline_value_end': self.outl[0].p.val,
Expand All @@ -450,7 +469,7 @@ def get_plotting_data(self):
'ending_point_property': 'v',
'ending_point_value': self.outl[0].vol.val
},
4: {
5: {
'isoline_property': 'p',
'isoline_value': self.inl[1].p.val,
'isoline_value_end': self.outl[1].p.val,
Expand Down

0 comments on commit 7d29505

Please sign in to comment.