diff --git a/CHANGELOG.md b/CHANGELOG.md index 089aa83..42106ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -156,13 +156,20 @@ The version increments between 2.0.1 and 2.0.4 were primarily spent correcting i - Added O2, R1234ze to the multiphase collection - Corrected a number of minor bugs reported since the last release. These are documented on the PYroMat github issues page. -# Version 2.2.1 +## Version 2.2.1 - Issued bugfixes for github issues 41, 42, 43 - Corrected a boneheaded typo in igmix that should have been caught in testing. - Reverted to `_tditer()` in `mp1._T()` - Eliminated the upper 1% grace range in `Ts()` to prevent imaginary values past Tc. -# Version 2.2.2 +## Version 2.2.2 - Changed the call signature for `T_s`, `T_h` functions to address issue 52 *NOTE* inverse methods like `T_s` and `T_h` are now depricated. - Reassessed all multiphase `dlim` values in the core data. This addresses issues 44, 45, and 46. + +## Version 2.2.3 +- Updated the README to adopt recommendations made by the JOSS community - specifically to include recommendations for community involvement. +- Added the optional `pip install pyromat[dev]` option, which requires the `pytest` package. + +## Version 2.2.4 +- Corrected a bug reported in issue 64 where inverse routines were not returning the correct units. diff --git a/README.md b/README.md index 2195f6f..d76a8ba 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Thermodynamic tools for Python -Originally authored by [Chris Martin](https://sites.psu.edu/cmartin) [crm28@psu.edu](mailto:crm28@psu.edu) +Originally authored by [Chris Martin](https://sites.psu.edu/cmartin) [crm28@psu.edu](mailto:crm28@psu.edu) Now co-authored by [Joe Ranalli](https://github.com/jranalli) PYroMat is a flexible platform for conveniently working with thermodynamic data. The expanding collection of substances includes data for the properties people need most, exposed in an intuitively designed object interface [Come read more.](http://www.pyromat.org) diff --git a/src/pyromat/__init__.py b/src/pyromat/__init__.py index 7456f02..fb89900 100644 --- a/src/pyromat/__init__.py +++ b/src/pyromat/__init__.py @@ -40,7 +40,7 @@ # utility.load_config() checks this value to establish the read-only version # setup.py looks for this line to establish the version # MUST be unindented -__version__ = "2.2.3" +__version__ = "2.2.4" # loading the PYroMat utility functions diff --git a/src/pyromat/registry/ig.py b/src/pyromat/registry/ig.py index 83ce71e..0133bf6 100644 --- a/src/pyromat/registry/ig.py +++ b/src/pyromat/registry/ig.py @@ -1776,9 +1776,9 @@ def state(self, *varg, **kwarg): - def T_s(self,s,p=None, **kwarg): + def T_s(self,s,p=None, d=None): """Temperature as a function of entropy -** Depreciated - use T() ** +** Deprecated - use T() ** T = T_s(s) or @@ -1791,12 +1791,14 @@ def T_s(self,s,p=None, **kwarg): """ if p is not None: return self.T(s=s, p=p) - return self.T(s=s, **kwarg) + elif d is not None: + return self.T(s=s, d=d) + return self.T(s=s) - def T_h(self,h,p=None,**kwarg): + def T_h(self,h, p=None, d=None): """Temperature as a function of enthalpy -** Depreciated - use T() ** +** Deprecated - use T() ** T = T_h(h) or @@ -1812,12 +1814,14 @@ def T_h(self,h,p=None,**kwarg): """ if p is not None: return self.T(h=h, p=p) - return self.T(h=h, **kwarg) + elif d is not None: + return self.T(h=h, d=d) + return self.T(h=h) - def p_s(self,s,*varg, **kwarg): + def p_s(self,s,T=None): """Pressure as a function of entropy -** Depreciated - use p() ** +** Deprecated - use p() ** p = ig_instance.p_s(s) or @@ -1829,4 +1833,6 @@ def p_s(self,s,*varg, **kwarg): unit_temperature Returns unit_pressure """ - return self.p(*varg, s=s, **kwarg) + if T is not None: + return self.p(s=s,T=T) + return self.p(s=s) diff --git a/src/pyromat/registry/ig2.py b/src/pyromat/registry/ig2.py index 284597e..bd08fde 100644 --- a/src/pyromat/registry/ig2.py +++ b/src/pyromat/registry/ig2.py @@ -1245,11 +1245,11 @@ def state(self, *varg, **kwarg): return out - def T_s(self,s,p=None, **kwarg): + def T_s(self,s,p=None, d=None): """Temperature as a function of entropy -** Depreciated - use T() ** +** Deprecated - use T() ** - T = T_s(s) + T = T_s(s) or T = T_s(s,p) @@ -1260,12 +1260,14 @@ def T_s(self,s,p=None, **kwarg): """ if p is not None: return self.T(s=s, p=p) - return self.T(s=s, **kwarg) + elif d is not None: + return self.T(s=s, d=d) + return self.T(s=s) - def T_h(self,h,p=None,**kwarg): + def T_h(self,h, p=None, d=None): """Temperature as a function of enthalpy -** Depreciated - use T() ** +** Deprecated - use T() ** T = T_h(h) or @@ -1281,12 +1283,14 @@ def T_h(self,h,p=None,**kwarg): """ if p is not None: return self.T(h=h, p=p) - return self.T(h=h, **kwarg) + elif d is not None: + return self.T(h=h, d=d) + return self.T(h=h) - def p_s(self,s,*varg, **kwarg): + def p_s(self,s,T=None): """Pressure as a function of entropy -** Depreciated - use p() ** +** Deprecated - use p() ** p = ig_instance.p_s(s) or @@ -1298,4 +1302,6 @@ def p_s(self,s,*varg, **kwarg): unit_temperature Returns unit_pressure """ - return self.p(*varg, s=s, **kwarg) + if T is not None: + return self.p(s=s,T=T) + return self.p(s=s) diff --git a/src/pyromat/registry/igmix.py b/src/pyromat/registry/igmix.py index d77b7b2..33d1259 100644 --- a/src/pyromat/registry/igmix.py +++ b/src/pyromat/registry/igmix.py @@ -1031,10 +1031,10 @@ def Y(self): # Return the dictionary return self._y.copy() - - def T_s(self,s,p=None,**kwarg): + def T_s(self,s,p=None, d=None): """Temperature as a function of entropy -** Depreciated - use T() ** +** Deprecated - use T() ** + T = T_s(s) or T = T_s(s,p) @@ -1046,33 +1046,41 @@ def T_s(self,s,p=None,**kwarg): """ if p is not None: return self.T(s=s, p=p) - return self.T(s=s, **kwarg) + elif d is not None: + return self.T(s=s, d=d) + return self.T(s=s) - def T_h(self,h, p=None, **kwarg): + def T_h(self,h, p=None, d=None): """Temperature as a function of enthalpy -** Depreciated - use T() ** +** Deprecated - use T() ** + T = T_h(h) or - T = T_h(h,p) + T = T_h(h,...) -Returns the temperature as a function of enthalpy and pressure +Returns the temperature as a function of enthalpy and pressure. Ideal +gas enthalpy is not a function of pressure, so the p term is merely a +placeholder. -Accepts unit_energy / unit_matter +Accepts unit_energy / unit_matter / unit_temperature unit_pressure Returns unit_temperature """ if p is not None: return self.T(h=h, p=p) - return self.T(h=h, **kwarg) - - - def p_s(self, s, *varg, **kwarg): + elif d is not None: + return self.T(h=h, d=d) + return self.T(h=h) + + + def p_s(self,s,T=None): """Pressure as a function of entropy -** Depreciated - use p() ** - p = p_s(s) - OR - p = p_s(s,T) +** Deprecated - use p() ** + + p = ig_instance.p_s(s) + or + p = ig_instance.p_s(s,...) Returns the pressure as a function of entropy and temperature. @@ -1080,4 +1088,6 @@ def p_s(self, s, *varg, **kwarg): unit_temperature Returns unit_pressure """ - return self.p(s=s, *varg, **kwarg) + if T is not None: + return self.p(s=s,T=T) + return self.p(s=s) diff --git a/src/pyromat/registry/mp1.py b/src/pyromat/registry/mp1.py index bfaa0ed..c3d034f 100644 --- a/src/pyromat/registry/mp1.py +++ b/src/pyromat/registry/mp1.py @@ -4138,9 +4138,9 @@ def gam(self, *varg, quality=False, **kwarg): return cp/cv - def T_s(self, s, p=None, quality=False, **kwarg): + def T_s(self, s, p=None, d=None, quality=False, debug=False): """Temperature from entropy -** Depreciated - use T() ** +** Deprecated - use T() ** T = T_s(s, p=p) OR @@ -4155,17 +4155,16 @@ def T_s(self, s, p=None, quality=False, **kwarg): T,x = T_s(s, p=p, quality=True) """ if p is not None: - T,_,_,x,_ = self._argparse(s=s, p=p) - else: - T,_,_,x,_ = self._argparse(s=s, **kwarg) - if quality: - return T,x - return T + return self.T(s=s,p=p,quality=quality) + elif d is not None: + return self.T(s=s,d=d,quality=quality) + p = pm.config['def_p'] + return self.T(s=s, p=p) - def d_s(self, s, *varg, quality=False, **kwarg): + def d_s(self, s, T=None, quality=False, debug=False): """Density from entropy -** Depreciated - use d() ** +** Deprecated - use d() ** d = d_s(s,T=T) @@ -4175,19 +4174,16 @@ def d_s(self, s, *varg, quality=False, **kwarg): The optional keyword flag, quality, will cause quality to be returned along with pressure. """ - _,d1,d2,x,I = self._argparse(*varg, s=s, **kwarg) - d1[I] = 1./(x[I]/d2[I] + (1-x[I])/d1[I]) - - if quality: - return d1,x - return d1 + if T is not None: + return self.d(s=s, T=T, quality=quality) + return self.d(s=s, quality=quality) - def T_h(self, h, p=None, quality=False, **kwarg): + def T_h(self, h, p=None, d=None, quality=False, debug=False): """Temperature from entropy -** Depreciated - use T() ** +** Deprecated - use T() ** T = T_s(s, p=p) OR @@ -4202,9 +4198,8 @@ def T_h(self, h, p=None, quality=False, **kwarg): T,x = T_s(s, p=p, quality=True) """ if p is not None: - T,_,_,x,_ = self._argparse(h=h, p=p) - else: - T,_,_,x,_ = self._argparse(h=h, **kwarg) - if quality: - return T,x - return T + return self.T(h=h,p=p,quality=quality) + elif d is not None: + return self.T(h=h,d=d,quality=quality) + p = pm.config['def_p'] + return self.T(h=h, p=p)