MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / _deviation

Function _deviation

Web/scripts/fluid_properties.IF97Conformance.py:192–207  ·  view source on GitHub ↗
(ref, test, kind)

Source from the content-addressed store, hash-verified

190
191
192def _deviation(ref, test, kind):
193 if ref is None or test is None:
194 return None
195 if not math.isfinite(ref) or not math.isfinite(test):
196 return None
197 if kind == 'rel':
198 if abs(ref) < 1e-30:
199 return None
200 # For density we report deviation of v = 1/rho; the table is
201 # built on v so flip the sign convention to match G13-15.
202 return 100.0 * (test - ref) / ref
203 if kind == 'abs_T':
204 return 1000.0 * (test - ref) # K -> mK
205 if kind == 'abs_s':
206 return 1000.0 * (test - ref) # J/(kg K) -> 10^-3 J/(kg K)
207 return test - ref
208
209
210def _safe_propssi(key, h, p, backend):

Callers 1

run_conformanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected