2222 "S" : "Entropy" ,
2323}
2424
25+
2526class IsothermalPVStruct :
26- def __init__ (self , T : List [float ], V :List [float ],P : List [List [float ]]):
27+ def __init__ (self , T : List [float ], V : List [float ], P : List [List [float ]]):
2728 self .T = T
2829 self .V = V
2930 self .P = P
@@ -49,7 +50,7 @@ def __init__(
4950 self .compound = compound
5051 self .eosname = eosname
5152 self .eoseq = eoseq
52- self .isotherms : IsothermalPVStruct = isotherms
53+ self .isotherms : IsothermalPVStruct = isotherms
5354
5455 self .Tliq , self .Tvap = np .zeros (self .n ), np .zeros (self .n )
5556 self .Pliq , self .Pvap = np .zeros (self .n ), np .zeros (self .n )
@@ -70,7 +71,7 @@ def __init__(
7071 self .lnscale = False
7172 self .grid = True
7273 self .smooth = True
73- self .plotisotherms = False
74+ self .plotisotherms = False
7475
7576 for i in range (self .n ):
7677 self .Tliq [i ], self .Tvap [i ] = self .propsliq [i ].T , self .propsvap [i ].T
@@ -102,8 +103,15 @@ def __init__(
102103 else :
103104 self .has_isotherms = False
104105
105-
106- def plotPV (self , xunit : str , yunit : str , lnscale = True , smooth = True , grid = True , plotisothermals = False ):
106+ def plotPV (
107+ self ,
108+ xunit : str ,
109+ yunit : str ,
110+ lnscale = True ,
111+ smooth = True ,
112+ grid = True ,
113+ plotisothermals = False ,
114+ ):
107115 self .x_letter , self .y_letter = "V" , "P"
108116 self .xliq , self .yliq = self .Vliq , self .Pliq
109117 self .xvap , self .yvap = self .Vvap , self .Pvap
@@ -245,16 +253,22 @@ def _plot(self):
245253
246254 try :
247255 if self .plotisotherms and self .has_isotherms :
248- v = conv_unit (np .atleast_1d (self .isotherms .V ), SI_dict [self .x_letter ], self .xunit )
256+ v = conv_unit (
257+ np .atleast_1d (self .isotherms .V ), SI_dict [self .x_letter ], self .xunit
258+ )
249259 if self .lnscale :
250260 v = np .log (v )
251261 for i in range (len (self .isotherms .T )):
252262 t = self .isotherms .T [i ]
253- p = conv_unit (np .atleast_1d (self .isotherms .P [i ]), SI_dict [self .y_letter ], self .yunit )
263+ p = conv_unit (
264+ np .atleast_1d (self .isotherms .P [i ]),
265+ SI_dict [self .y_letter ],
266+ self .yunit ,
267+ )
254268 if self .lnscale :
255269 p = np .log (p )
256270 label = "isothermal at {:.3f} K" .format (t )
257- ax .plot (v , p , label = label , linestyle = '--' )
271+ ax .plot (v , p , label = label , linestyle = "--" )
258272 except Exception as e :
259273 print ("Error plotting isothermal data\n {}" .format (str (e )))
260274 raise
@@ -320,8 +334,8 @@ def helper_P_guess(_T):
320334 tmp .append (p )
321335 PV_isotherms .append (tmp )
322336
323- PV_isotherms = IsothermalPVStruct (isotherms , list (v_iso_space .tolist ()), PV_isotherms )
337+ PV_isotherms = IsothermalPVStruct (
338+ isotherms , list (v_iso_space .tolist ()), PV_isotherms
339+ )
324340
325341 return (retliq , retvap , critical_point , PV_isotherms )
326-
327-
0 commit comments