_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q255500 | T_converter | validation | def T_converter(T, current, desired):
r'''Converts the a temperature reading made in any of the scales
'ITS-90', 'ITS-68','ITS-48', 'ITS-76', or 'ITS-27' to any of the other
scales. Not all temperature ranges can be converted to other ranges; for
instance, 'ITS-76' is purely for low temperatures, and 5 ... | python | {
"resource": ""
} |
q255501 | GWP | validation | def GWP(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's Global Warming
Potential, relative to CO2. Lookup is based on CASRNs. Will automatically
select a data source to use if no Method is provided; returns None if the
data is not available.
Retu... | python | {
"resource": ""
} |
q255502 | logP | validation | def logP(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's octanol-water
partition coefficient. Lookup is based on CASRNs. Will automatically
select a data source to use if no Method is provided; returns None if the
data is not available.
Parameter... | python | {
"resource": ""
} |
q255503 | VaporPressure.calculate | validation | def calculate(self, T, method):
r'''Method to calculate vapor pressure of a fluid at temperature `T`
with a given method.
This method has no exception handling; see `T_dependent_property`
for that.
Parameters
----------
T : float
Temperature at calcu... | python | {
"resource": ""
} |
q255504 | GCEOS.solve | validation | def solve(self):
'''First EOS-generic method; should be called by all specific EOSs.
For solving for `T`, the EOS must provide the method `solve_T`.
For all cases, the EOS must provide `a_alpha_and_derivatives`.
Calls `set_from_PT` once done.
'''
self.check_sufficient_inp... | python | {
"resource": ""
} |
q255505 | GCEOS.set_from_PT | validation | def set_from_PT(self, Vs):
'''Counts the number of real volumes in `Vs`, and determines what to do.
If there is only one real volume, the method
`set_properties_from_solution` is called with it. If there are
two real volumes, `set_properties_from_solution` is called once with
... | python | {
"resource": ""
} |
q255506 | GCEOS.solve_T | validation | def solve_T(self, P, V, quick=True):
'''Generic method to calculate `T` from a specified `P` and `V`.
Provides SciPy's `newton` solver, and iterates to solve the general
equation for `P`, recalculating `a_alpha` as a function of temperature
using `a_alpha_and_derivatives` each iteration.... | python | {
"resource": ""
} |
q255507 | PR.a_alpha_and_derivatives | validation | def a_alpha_and_derivatives(self, T, full=True, quick=True):
r'''Method to calculate `a_alpha` and its first and second
derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
`d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
documentation. Uses the set values of `T... | python | {
"resource": ""
} |
q255508 | PRSV.solve_T | validation | def solve_T(self, P, V, quick=True):
r'''Method to calculate `T` from a specified `P` and `V` for the PRSV
EOS. Uses `Tc`, `a`, `b`, `kappa0` and `kappa` as well, obtained from
the class's namespace.
Parameters
----------
P : float
Pressure, [Pa]
V... | python | {
"resource": ""
} |
q255509 | VDW.solve_T | validation | def solve_T(self, P, V):
r'''Method to calculate `T` from a specified `P` and `V` for the VDW
EOS. Uses `a`, and `b`, obtained from the class's namespace.
.. math::
T = \frac{1}{R V^{2}} \left(P V^{2} \left(V - b\right)
+ V a - a b\right)
Parameters
---... | python | {
"resource": ""
} |
q255510 | RK.solve_T | validation | def solve_T(self, P, V, quick=True):
r'''Method to calculate `T` from a specified `P` and `V` for the RK
EOS. Uses `a`, and `b`, obtained from the class's namespace.
Parameters
----------
P : float
Pressure, [Pa]
V : float
Molar volume, [m^3/mol]
... | python | {
"resource": ""
} |
q255511 | APISRK.solve_T | validation | def solve_T(self, P, V, quick=True):
r'''Method to calculate `T` from a specified `P` and `V` for the API
SRK EOS. Uses `a`, `b`, and `Tc` obtained from the class's namespace.
Parameters
----------
P : float
Pressure, [Pa]
V : float
Molar volume,... | python | {
"resource": ""
} |
q255512 | TWUSRK.a_alpha_and_derivatives | validation | def a_alpha_and_derivatives(self, T, full=True, quick=True):
r'''Method to calculate `a_alpha` and its first and second
derivatives for this EOS. Returns `a_alpha`, `da_alpha_dT`, and
`d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more
documentation. Uses the set values of `T... | python | {
"resource": ""
} |
q255513 | Tb | validation | def Tb(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[PSAT_DEFINITION]):
r'''This function handles the retrieval of a chemical's boiling
point. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
... | python | {
"resource": ""
} |
q255514 | Tm | validation | def Tm(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[]):
r'''This function handles the retrieval of a chemical's melting
point. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefered source... | python | {
"resource": ""
} |
q255515 | Clapeyron | validation | def Clapeyron(T, Tc, Pc, dZ=1, Psat=101325):
r'''Calculates enthalpy of vaporization at arbitrary temperatures using the
Clapeyron equation.
The enthalpy of vaporization is given by:
.. math::
\Delta H_{vap} = RT \Delta Z \frac{\ln (P_c/Psat)}{(1-T_{r})}
Parameters
----------
T : ... | python | {
"resource": ""
} |
q255516 | Watson | validation | def Watson(T, Hvap_ref, T_Ref, Tc, exponent=0.38):
'''
Adjusts enthalpy of vaporization of enthalpy for another temperature, for one temperature.
'''
Tr = T/Tc
Trefr = T_Ref/Tc
H2 = Hvap_ref*((1-Tr)/(1-Trefr))**exponent
return H2 | python | {
"resource": ""
} |
q255517 | Hfus | validation | def Hfus(T=298.15, P=101325, MW=None, AvailableMethods=False, Method=None, CASRN=''): # pragma: no cover
'''This function handles the calculation of a chemical's enthalpy of fusion.
Generally this, is used by the chemical class, as all parameters are passed.
Calling the function directly works okay.
E... | python | {
"resource": ""
} |
q255518 | Hsub | validation | def Hsub(T=298.15, P=101325, MW=None, AvailableMethods=False, Method=None, CASRN=''): # pragma: no cover
'''This function handles the calculation of a chemical's enthalpy of sublimation.
Generally this, is used by the chemical class, as all parameters are passed.
This API is considered experimental, and ... | python | {
"resource": ""
} |
q255519 | Tliquidus | validation | def Tliquidus(Tms=None, ws=None, xs=None, CASRNs=None, AvailableMethods=False,
Method=None): # pragma: no cover
'''This function handles the retrival of a mixtures's liquidus point.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more comp... | python | {
"resource": ""
} |
q255520 | solubility_parameter | validation | def solubility_parameter(T=298.15, Hvapm=None, Vml=None,
CASRN='', AvailableMethods=False, Method=None):
r'''This function handles the calculation of a chemical's solubility
parameter. Calculation is a function of temperature, but is not always
presented as such. No lookup values ar... | python | {
"resource": ""
} |
q255521 | solubility_eutectic | validation | def solubility_eutectic(T, Tm, Hm, Cpl=0, Cps=0, gamma=1):
r'''Returns the maximum solubility of a solute in a solvent.
.. math::
\ln x_i^L \gamma_i^L = \frac{\Delta H_{m,i}}{RT}\left(
1 - \frac{T}{T_{m,i}}\right) - \frac{\Delta C_{p,i}(T_{m,i}-T)}{RT}
+ \frac{\Delta C_{p,i}}{R}\ln\frac... | python | {
"resource": ""
} |
q255522 | Tm_depression_eutectic | validation | def Tm_depression_eutectic(Tm, Hm, x=None, M=None, MW=None):
r'''Returns the freezing point depression caused by a solute in a solvent.
Can use either the mole fraction of the solute or its molality and the
molecular weight of the solvent. Assumes ideal system behavior.
.. math::
\Delta T_m = \... | python | {
"resource": ""
} |
q255523 | Rackett | validation | def Rackett(T, Tc, Pc, Zc):
r'''Calculates saturation liquid volume, using Rackett CSP method and
critical properties.
The molar volume of a liquid is given by:
.. math::
V_s = \frac{RT_c}{P_c}{Z_c}^{[1+(1-{T/T_c})^{2/7} ]}
Units are all currently in m^3/mol - this can be changed to kg/m^... | python | {
"resource": ""
} |
q255524 | Yamada_Gunn | validation | def Yamada_Gunn(T, Tc, Pc, omega):
r'''Calculates saturation liquid volume, using Yamada and Gunn CSP method
and a chemical's critical properties and acentric factor.
The molar volume of a liquid is given by:
.. math::
V_s = \frac{RT_c}{P_c}{(0.29056-0.08775\omega)}^{[1+(1-{T/T_c})^{2/7}]}
... | python | {
"resource": ""
} |
q255525 | Townsend_Hales | validation | def Townsend_Hales(T, Tc, Vc, omega):
r'''Calculates saturation liquid density, using the Townsend and Hales
CSP method as modified from the original Riedel equation. Uses
chemical critical volume and temperature, as well as acentric factor
The density of a liquid is given by:
.. math::
Vs... | python | {
"resource": ""
} |
q255526 | COSTALD | validation | def COSTALD(T, Tc, Vc, omega):
r'''Calculate saturation liquid density using the COSTALD CSP method.
A popular and accurate estimation method. If possible, fit parameters are
used; alternatively critical properties work well.
The density of a liquid is given by:
.. math::
V_s=V^*V^{(0)}[1... | python | {
"resource": ""
} |
q255527 | Amgat | validation | def Amgat(xs, Vms):
r'''Calculate mixture liquid density using the Amgat mixing rule.
Highly inacurate, but easy to use. Assumes idea liquids with
no excess volume. Average molecular weight should be used with it to obtain
density.
.. math::
V_{mix} = \sum_i x_i V_i
or in terms of dens... | python | {
"resource": ""
} |
q255528 | COSTALD_mixture | validation | def COSTALD_mixture(xs, T, Tcs, Vcs, omegas):
r'''Calculate mixture liquid density using the COSTALD CSP method.
A popular and accurate estimation method. If possible, fit parameters are
used; alternatively critical properties work well.
The mixing rules giving parameters for the pure component COSTAL... | python | {
"resource": ""
} |
q255529 | VolumeLiquid.calculate | validation | def calculate(self, T, method):
r'''Method to calculate low-pressure liquid molar volume at tempearture
`T` with a given method.
This method has no exception handling; see `T_dependent_property`
for that.
Parameters
----------
T : float
Temperature a... | python | {
"resource": ""
} |
q255530 | VolumeLiquid.calculate_P | validation | def calculate_P(self, T, P, method):
r'''Method to calculate pressure-dependent liquid molar volume at
temperature `T` and pressure `P` with a given method.
This method has no exception handling; see `TP_dependent_property`
for that.
Parameters
----------
T : fl... | python | {
"resource": ""
} |
q255531 | VolumeLiquidMixture.calculate | validation | def calculate(self, T, P, zs, ws, method):
r'''Method to calculate molar volume of a liquid mixture at
temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
`ws` with a given method.
This method has no exception handling; see `mixture_property`
for that.
... | python | {
"resource": ""
} |
q255532 | VolumeGas.calculate_P | validation | def calculate_P(self, T, P, method):
r'''Method to calculate pressure-dependent gas molar volume at
temperature `T` and pressure `P` with a given method.
This method has no exception handling; see `TP_dependent_property`
for that.
Parameters
----------
T : float... | python | {
"resource": ""
} |
q255533 | VolumeGasMixture.calculate | validation | def calculate(self, T, P, zs, ws, method):
r'''Method to calculate molar volume of a gas mixture at
temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
`ws` with a given method.
This method has no exception handling; see `mixture_property`
for that.
... | python | {
"resource": ""
} |
q255534 | VolumeSolid.calculate | validation | def calculate(self, T, method):
r'''Method to calculate the molar volume of a solid at tempearture `T`
with a given method.
This method has no exception handling; see `T_dependent_property`
for that.
Parameters
----------
T : float
Temperature at whi... | python | {
"resource": ""
} |
q255535 | VolumeSolidMixture.calculate | validation | def calculate(self, T, P, zs, ws, method):
r'''Method to calculate molar volume of a solid mixture at
temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
`ws` with a given method.
This method has no exception handling; see `mixture_property`
for that.
... | python | {
"resource": ""
} |
q255536 | legal_status | validation | def legal_status(CASRN, Method=None, AvailableMethods=False, CASi=None):
r'''Looks up the legal status of a chemical according to either a specifc
method or with all methods.
Returns either the status as a string for a specified method, or the
status of the chemical in all available data sources, in th... | python | {
"resource": ""
} |
q255537 | economic_status | validation | def economic_status(CASRN, Method=None, AvailableMethods=False): # pragma: no cover
'''Look up the economic status of a chemical.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more complete object-oriented interface.
>>> pprint(economic_status(CA... | python | {
"resource": ""
} |
q255538 | Joback.estimate | validation | def estimate(self):
'''Method to compute all available properties with the Joback method;
returns their results as a dict. For the tempearture dependent values
Cpig and mul, both the coefficients and objects to perform calculations
are returned.
'''
# Pre-generate the coe... | python | {
"resource": ""
} |
q255539 | conductivity | validation | def conductivity(CASRN=None, AvailableMethods=False, Method=None, full_info=True):
r'''This function handles the retrieval of a chemical's conductivity.
Lookup is based on CASRNs. Will automatically select a data source to use
if no Method is provided; returns None if the data is not available.
Functio... | python | {
"resource": ""
} |
q255540 | ionic_strength | validation | def ionic_strength(mis, zis):
r'''Calculate the ionic strength of a solution in one of two ways,
depending on the inputs only. For Pitzer and Bromley models,
`mis` should be molalities of each component. For eNRTL models,
`mis` should be mole fractions of each electrolyte in the solution.
This will ... | python | {
"resource": ""
} |
q255541 | ion_balance_proportional | validation | def ion_balance_proportional(anion_charges, cation_charges, zs, n_anions,
n_cations, balance_error, method):
'''Helper method for balance_ions for the proportional family of methods.
See balance_ions for a description of the methods; parameters are fairly
obvious.
'''
... | python | {
"resource": ""
} |
q255542 | Permittivity.calculate | validation | def calculate(self, T, method):
r'''Method to calculate permittivity of a liquid at temperature `T`
with a given method.
This method has no exception handling; see `T_dependent_property`
for that.
Parameters
----------
T : float
Temperature at which ... | python | {
"resource": ""
} |
q255543 | SurfaceTensionMixture.calculate | validation | def calculate(self, T, P, zs, ws, method):
r'''Method to calculate surface tension of a liquid mixture at
temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
`ws` with a given method.
This method has no exception handling; see `mixture_property`
for that.
... | python | {
"resource": ""
} |
q255544 | load_group_assignments_DDBST | validation | def load_group_assignments_DDBST():
'''Data is stored in the format
InChI key\tbool bool bool \tsubgroup count ...\tsubgroup count \tsubgroup count...
where the bools refer to whether or not the original UNIFAC, modified
UNIFAC, and PSRK group assignments were completed correctly.
The subgroups and ... | python | {
"resource": ""
} |
q255545 | dipole_moment | validation | def dipole_moment(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's dipole moment.
Lookup is based on CASRNs. Will automatically select a data source to use
if no Method is provided; returns None if the data is not available.
Prefered source is 'CCCBDB... | python | {
"resource": ""
} |
q255546 | Pc | validation | def Pc(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[SURF]):
r'''This function handles the retrieval of a chemical's critical
pressure. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefere... | python | {
"resource": ""
} |
q255547 | Vc | validation | def Vc(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[SURF]):
r'''This function handles the retrieval of a chemical's critical
volume. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefered ... | python | {
"resource": ""
} |
q255548 | Zc | validation | def Zc(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[COMBINED]):
r'''This function handles the retrieval of a chemical's critical
compressibility. Lookup is based on CASRNs. Will automatically select a
data source to use if no Method is provided; returns None if the data is
not available.
... | python | {
"resource": ""
} |
q255549 | critical_surface | validation | def critical_surface(Tc=None, Pc=None, Vc=None, AvailableMethods=False,
Method=None):
r'''Function for calculating a critical property of a substance from its
other two critical properties. Calls functions Ihmels, Meissner, and
Grigoras, each of which use a general 'Critical surface' ty... | python | {
"resource": ""
} |
q255550 | third_property | validation | def third_property(CASRN=None, T=False, P=False, V=False):
r'''Function for calculating a critical property of a substance from its
other two critical properties, but retrieving the actual other critical
values for convenient calculation.
Calls functions Ihmels, Meissner, and
Grigoras, each of which... | python | {
"resource": ""
} |
q255551 | checkCAS | validation | def checkCAS(CASRN):
'''Checks if a CAS number is valid. Returns False if the parser cannot
parse the given string..
Parameters
----------
CASRN : string
A three-piece, dash-separated set of numbers
Returns
-------
result : bool
Boolean value if CASRN was valid. If par... | python | {
"resource": ""
} |
q255552 | mixture_from_any | validation | def mixture_from_any(ID):
'''Looks up a string which may represent a mixture in the database of
thermo to determine the key by which the composition of that mixture can
be obtained in the dictionary `_MixtureDict`.
Parameters
----------
ID : str
A string or 1-element list containing th... | python | {
"resource": ""
} |
q255553 | ChemicalMetadata.charge | validation | def charge(self):
'''Charge of the species as an integer. Computed as a property as most
species do not have a charge and so storing it would be a waste of
memory.
'''
try:
return self._charge
except AttributeError:
self._charge = charge_from_form... | python | {
"resource": ""
} |
q255554 | ChemicalMetadataDB.load_included_indentifiers | validation | def load_included_indentifiers(self, file_name):
'''Loads a file with newline-separated integers representing which
chemical should be kept in memory; ones not included are ignored.
'''
self.restrict_identifiers = True
included_identifiers = set()
with open(file_n... | python | {
"resource": ""
} |
q255555 | CoolProp_T_dependent_property | validation | def CoolProp_T_dependent_property(T, CASRN, prop, phase):
r'''Calculates a property of a chemical in either the liquid or gas phase
as a function of temperature only. This means that the property is
either at 1 atm or along the saturation curve.
Parameters
----------
T : float
Temperatu... | python | {
"resource": ""
} |
q255556 | Stockmayer | validation | def Stockmayer(Tm=None, Tb=None, Tc=None, Zc=None, omega=None,
CASRN='', AvailableMethods=False, Method=None):
r'''This function handles the retrieval or calculation a chemical's
Stockmayer parameter. Values are available from one source with lookup
based on CASRNs, or can be estimated from 7... | python | {
"resource": ""
} |
q255557 | molecular_diameter | validation | def molecular_diameter(Tc=None, Pc=None, Vc=None, Zc=None, omega=None,
Vm=None, Vb=None, CASRN='', AvailableMethods=False, Method=None):
r'''This function handles the retrieval or calculation a chemical's
L-J molecular diameter. Values are available from one source with lookup
based on CASRNs, or ... | python | {
"resource": ""
} |
q255558 | Tstar | validation | def Tstar(T, epsilon_k=None, epsilon=None):
r'''This function calculates the parameter `Tstar` as needed in performing
collision integral calculations.
.. math::
T^* = \frac{kT}{\epsilon}
Examples
--------
>>> Tstar(T=318.2, epsilon_k=308.43)
1.0316765554582887
Parameters
... | python | {
"resource": ""
} |
q255559 | Hf_g | validation | def Hf_g(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's gas heat of
formation. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefered sources are 'A... | python | {
"resource": ""
} |
q255560 | omega | validation | def omega(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=['LK', 'DEFINITION']):
r'''This function handles the retrieval of a chemical's acentric factor,
`omega`, or its calculation from correlations or directly through the
definition of acentric factor if possible. Requires a known boiling point,... | python | {
"resource": ""
} |
q255561 | omega_mixture | validation | def omega_mixture(omegas, zs, CASRNs=None, Method=None,
AvailableMethods=False):
r'''This function handles the calculation of a mixture's acentric factor.
Calculation is based on the omegas provided for each pure component. Will
automatically select a method to use if no Method is provided... | python | {
"resource": ""
} |
q255562 | StielPolar | validation | def StielPolar(Tc=None, Pc=None, omega=None, CASRN='', Method=None,
AvailableMethods=False):
r'''This function handles the calculation of a chemical's Stiel Polar
factor, directly through the definition of Stiel-polar factor if possible.
Requires Tc, Pc, acentric factor, and a vapor pressure ... | python | {
"resource": ""
} |
q255563 | ViswanathNatarajan2 | validation | def ViswanathNatarajan2(T, A, B):
'''
This function is known to produce values 10 times too low.
The author's data must have an error.
I have adjusted it to fix this.
# DDBST has 0.0004580 as a value at this temperature
>>> ViswanathNatarajan2(348.15, -5.9719, 1007.0)
0.00045983686956829517... | python | {
"resource": ""
} |
q255564 | _round_whole_even | validation | def _round_whole_even(i):
r'''Round a number to the nearest whole number. If the number is exactly
between two numbers, round to the even whole number. Used by
`viscosity_index`.
Parameters
----------
i : float
Number, [-]
Returns
-------
i : int
Rounded number, [-]... | python | {
"resource": ""
} |
q255565 | ViscosityLiquid.calculate | validation | def calculate(self, T, method):
r'''Method to calculate low-pressure liquid viscosity at tempearture
`T` with a given method.
This method has no exception handling; see `T_dependent_property`
for that.
Parameters
----------
T : float
Temperature at w... | python | {
"resource": ""
} |
q255566 | ViscosityLiquid.calculate_P | validation | def calculate_P(self, T, P, method):
r'''Method to calculate pressure-dependent liquid viscosity at
temperature `T` and pressure `P` with a given method.
This method has no exception handling; see `TP_dependent_property`
for that.
Parameters
----------
T : float... | python | {
"resource": ""
} |
q255567 | ViscosityLiquidMixture.calculate | validation | def calculate(self, T, P, zs, ws, method):
r'''Method to calculate viscosity of a liquid mixture at
temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
`ws` with a given method.
This method has no exception handling; see `mixture_property`
for that.
... | python | {
"resource": ""
} |
q255568 | ViscosityGas.calculate | validation | def calculate(self, T, method):
r'''Method to calculate low-pressure gas viscosity at
tempearture `T` with a given method.
This method has no exception handling; see `T_dependent_property`
for that.
Parameters
----------
T : float
Temperature of the ... | python | {
"resource": ""
} |
q255569 | ViscosityGas.calculate_P | validation | def calculate_P(self, T, P, method):
r'''Method to calculate pressure-dependent gas viscosity
at temperature `T` and pressure `P` with a given method.
This method has no exception handling; see `TP_dependent_property`
for that.
Parameters
----------
T : float
... | python | {
"resource": ""
} |
q255570 | ViscosityGasMixture.calculate | validation | def calculate(self, T, P, zs, ws, method):
r'''Method to calculate viscosity of a gas mixture at
temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
`ws` with a given method.
This method has no exception handling; see `mixture_property`
for that.
Pa... | python | {
"resource": ""
} |
q255571 | TWA | validation | def TWA(CASRN, AvailableMethods=False, Method=None): # pragma: no cover
'''This function handles the retrieval of Time-Weighted Average limits on worker
exposure to dangerous chemicals.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more complete o... | python | {
"resource": ""
} |
q255572 | STEL | validation | def STEL(CASRN, AvailableMethods=False, Method=None): # pragma: no cover
'''This function handles the retrieval of Short-term Exposure Limit on
worker exposure to dangerous chemicals.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more complete obj... | python | {
"resource": ""
} |
q255573 | Ceiling | validation | def Ceiling(CASRN, AvailableMethods=False, Method=None): # pragma: no cover
'''This function handles the retrieval of Ceiling limits on worker
exposure to dangerous chemicals.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more complete object-orie... | python | {
"resource": ""
} |
q255574 | Skin | validation | def Skin(CASRN, AvailableMethods=False, Method=None): # pragma: no cover
'''This function handles the retrieval of whether or not a chemical can
be absorbed through the skin, relevant to chemical safety calculations.
This API is considered experimental, and is expected to be removed in a
future releas... | python | {
"resource": ""
} |
q255575 | Carcinogen | validation | def Carcinogen(CASRN, AvailableMethods=False, Method=None):
r'''Looks up if a chemical is listed as a carcinogen or not according to
either a specifc method or with all methods.
Returns either the status as a string for a specified method, or the
status of the chemical in all available data sources, in... | python | {
"resource": ""
} |
q255576 | Tautoignition | validation | def Tautoignition(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval or calculation of a chemical's
autoifnition temperature. Lookup is based on CASRNs. No predictive methods
are currently implemented. Will automatically select a data source to use
if no Method is provi... | python | {
"resource": ""
} |
q255577 | LFL | validation | def LFL(Hc=None, atoms={}, CASRN='', AvailableMethods=False, Method=None):
r'''This function handles the retrieval or calculation of a chemical's
Lower Flammability Limit. Lookup is based on CASRNs. Two predictive methods
are currently implemented. Will automatically select a data source to use
if no Me... | python | {
"resource": ""
} |
q255578 | UFL | validation | def UFL(Hc=None, atoms={}, CASRN='', AvailableMethods=False, Method=None):
r'''This function handles the retrieval or calculation of a chemical's
Upper Flammability Limit. Lookup is based on CASRNs. Two predictive methods
are currently implemented. Will automatically select a data source to use
if no Me... | python | {
"resource": ""
} |
q255579 | Mixture.atom_fractions | validation | def atom_fractions(self):
r'''Dictionary of atomic fractions for each atom in the mixture.
Examples
--------
>>> Mixture(['CO2', 'O2'], zs=[0.5, 0.5]).atom_fractions
{'C': 0.2, 'O': 0.8}
'''
things = dict()
for zi, atoms in zip(self.zs, self.atomss):
... | python | {
"resource": ""
} |
q255580 | Mixture.mass_fractions | validation | def mass_fractions(self):
r'''Dictionary of mass fractions for each atom in the mixture.
Examples
--------
>>> Mixture(['CO2', 'O2'], zs=[0.5, 0.5]).mass_fractions
{'C': 0.15801826905745822, 'O': 0.8419817309425419}
'''
things = dict()
for zi, atoms in zi... | python | {
"resource": ""
} |
q255581 | Mixture.draw_2d | validation | def draw_2d(self, Hs=False): # pragma: no cover
r'''Interface for drawing a 2D image of all the molecules in the
mixture. Requires an HTML5 browser, and the libraries RDKit and
IPython. An exception is raised if either of these libraries is
absent.
Parameters
----------... | python | {
"resource": ""
} |
q255582 | Tt | validation | def Tt(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's triple temperature.
Lookup is based on CASRNs. Will automatically select a data source to use
if no Method is provided; returns None if the data is not available.
Returns data from [1]_, or a che... | python | {
"resource": ""
} |
q255583 | Pt | validation | def Pt(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's triple pressure.
Lookup is based on CASRNs. Will automatically select a data source to use
if no Method is provided; returns None if the data is not available.
Returns data from [1]_, or attempts... | python | {
"resource": ""
} |
q255584 | Parachor | validation | def Parachor(MW, rhol, rhog, sigma):
r'''Calculate Parachor for a pure species, using its density in the
liquid and gas phases, surface tension, and molecular weight.
.. math::
P = \frac{\sigma^{0.25} MW}{\rho_L - \rho_V}
Parameters
----------
MW : float
Molecular weight, [... | python | {
"resource": ""
} |
q255585 | Joule_Thomson | validation | def Joule_Thomson(T, V, Cp, dV_dT=None, beta=None):
r'''Calculate a real fluid's Joule Thomson coefficient. The required
derivative should be calculated with an equation of state, and `Cp` is the
real fluid versions. This can either be calculated with `dV_dT` directly,
or with `beta` if it is already ... | python | {
"resource": ""
} |
q255586 | Z_from_virial_pressure_form | validation | def Z_from_virial_pressure_form(P, *args):
r'''Calculates the compressibility factor of a gas given its pressure, and
pressure-form virial coefficients. Any number of coefficients is supported.
.. math::
Z = \frac{Pv}{RT} = 1 + B'P + C'P^2 + D'P^3 + E'P^4 \dots
Parameters
----------
P... | python | {
"resource": ""
} |
q255587 | zs_to_ws | validation | def zs_to_ws(zs, MWs):
r'''Converts a list of mole fractions to mass fractions. Requires molecular
weights for all species.
.. math::
w_i = \frac{z_i MW_i}{MW_{avg}}
MW_{avg} = \sum_i z_i MW_i
Parameters
----------
zs : iterable
Mole fractions [-]
MWs : iterable
... | python | {
"resource": ""
} |
q255588 | zs_to_Vfs | validation | def zs_to_Vfs(zs, Vms):
r'''Converts a list of mole fractions to volume fractions. Requires molar
volumes for all species.
.. math::
\text{Vf}_i = \frac{z_i V_{m,i}}{\sum_i z_i V_{m,i}}
Parameters
----------
zs : iterable
Mole fractions [-]
VMs : iterable
Molar volu... | python | {
"resource": ""
} |
q255589 | none_and_length_check | validation | def none_and_length_check(all_inputs, length=None):
r'''Checks inputs for suitability of use by a mixing rule which requires
all inputs to be of the same length and non-None. A number of variations
were attempted for this function; this was found to be the quickest.
Parameters
----------
all_in... | python | {
"resource": ""
} |
q255590 | mixing_simple | validation | def mixing_simple(fracs, props):
r'''Simple function calculates a property based on weighted averages of
properties. Weights could be mole fractions, volume fractions, mass
fractions, or anything else.
.. math::
y = \sum_i \text{frac}_i \cdot \text{prop}_i
Parameters
----------
fra... | python | {
"resource": ""
} |
q255591 | mixing_logarithmic | validation | def mixing_logarithmic(fracs, props):
r'''Simple function calculates a property based on weighted averages of
logarithmic properties.
.. math::
y = \sum_i \text{frac}_i \cdot \log(\text{prop}_i)
Parameters
----------
fracs : array-like
Fractions of a mixture
props: array-li... | python | {
"resource": ""
} |
q255592 | phase_select_property | validation | def phase_select_property(phase=None, s=None, l=None, g=None, V_over_F=None):
r'''Determines which phase's property should be set as a default, given
the phase a chemical is, and the property values of various phases. For the
case of liquid-gas phase, returns None. If the property is not available
for t... | python | {
"resource": ""
} |
q255593 | TDependentProperty.set_user_methods | validation | def set_user_methods(self, user_methods, forced=False):
r'''Method used to select certain property methods as having a higher
priority than were set by default. If `forced` is true, then methods
which were not specified are excluded from consideration.
As a side effect, `method` is remo... | python | {
"resource": ""
} |
q255594 | TDependentProperty.select_valid_methods | validation | def select_valid_methods(self, T):
r'''Method to obtain a sorted list of methods which are valid at `T`
according to `test_method_validity`. Considers either only user methods
if forced is True, or all methods. User methods are first tested
according to their listed order, and unless for... | python | {
"resource": ""
} |
q255595 | TDependentProperty.solve_prop | validation | def solve_prop(self, goal, reset_method=True):
r'''Method to solve for the temperature at which a property is at a
specified value. `T_dependent_property` is used to calculate the value
of the property as a function of temperature; if `reset_method` is True,
the best method is used at ea... | python | {
"resource": ""
} |
q255596 | TDependentProperty.T_dependent_property_derivative | validation | def T_dependent_property_derivative(self, T, order=1):
r'''Method to obtain a derivative of a property with respect to
temperature, of a given order. Methods found valid by
`select_valid_methods` are attempted until a method succeeds. If no
methods are valid and succeed, None is retur... | python | {
"resource": ""
} |
q255597 | TDependentProperty.calculate_integral | validation | def calculate_integral(self, T1, T2, method):
r'''Method to calculate the integral of a property with respect to
temperature, using a specified method. Uses SciPy's `quad` function
to perform the integral, with no options.
This method can be overwritten by subclasses who may per... | python | {
"resource": ""
} |
q255598 | TDependentProperty.T_dependent_property_integral | validation | def T_dependent_property_integral(self, T1, T2):
r'''Method to calculate the integral of a property with respect to
temperature, using a specified method. Methods found valid by
`select_valid_methods` are attempted until a method succeeds. If no
methods are valid and succeed, None is r... | python | {
"resource": ""
} |
q255599 | TDependentProperty.calculate_integral_over_T | validation | def calculate_integral_over_T(self, T1, T2, method):
r'''Method to calculate the integral of a property over temperature
with respect to temperature, using a specified method. Uses SciPy's
`quad` function to perform the integral, with no options.
This method can be overwritten ... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.