UI.viewComponents module¶
Module with widgets for view/edit component properties in database
View_Component: Dialog to view/edit compounds of database
DIPPR_widget: DIPPR equation composite widget
Parametric_widget: Parametric equation composite widget
API reference¶
- class UI.viewComponents.DIPPR_widget(title, unit, index=0, prop='', coef=None, parent=None)[source]¶
Bases:
QGroupBoxComposite widget to edit/view a DIPPR coefficients
- Attributes:
valueReturn the DIPPR equation parameters in the format:
Methods
changeId(index)Common action to do when the component index change, change from user to system compound, editable to readOnly compound
clear()Clear widget contents
fill(coef)Populate the widgets with the DIPPR coefficient in format [eq, A, B, C, D, E, Tmin, Tmax]
fit()Fit experimental data to a DIPPR equation
formula_DIPPR(eq, args)Calculate the formula of DIPPR equation in a latex format
plot([r])Plot the current DIPPR correlation equation r correlation coefficient, optional parameter for reuse the code in the fit data procedure
setReadOnly(boolean)Set widget readOnly state
valueChanged
- valueChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- dict_proptex = {'Hv': 'H_v', 'Pv': 'P_v', 'cpG': 'Cp_g', 'cpL': 'Cp_l', 'cpS': 'Cp_s', 'kG': '\\lambda_v', 'kL': '\\lambda_l', 'muG': '\\mu_g', 'muL': '\\mu_l', 'rhoL': '\\rho_l', 'rhoS': '\\rho_s', 'sigma': '\\sigma'}¶
- latex = {1: 'A + BT + CT^2 + DT^3 + ET^4', 2: 'e^{A + BT + C\\ln(T) + DT^E}', 3: '\\frac{AT^B}{1+\\frac{C}{T}+\\frac{D}{T^2}}', 4: 'A+B e^{-\\frac{C}{T^D}}', 5: 'A + BT + CT^3 + DT^8 + ET^9', 6: '\\frac{A}{B^{1+(1-T/C)^D}}', 7: 'A(1-T_r)^{B+CT_r+dT_r^2+ET_r^3}', 8: 'A+B\\frac{C/T}{\\sinh(C/T)}+D\\frac{E/T}{\\cosh(E/T)}', 9: 'A^2/Tr+B-2ACTr-ADTr^2-C^2Tr^3/3-CDTr^4/2-D^2Tr^5/5'}¶
- __init__(title, unit, index=0, prop='', coef=None, parent=None)[source]¶
Constructor of widget
- Parameters:
- titlestring
Title so show of qgroupbox
- unitstring
Aditional string with unit representation
- indexinteger
Index of compound in database to show
- propstring
Latex representation of property to show in matplotlib
- coeflist
List of DIPPR equation representation in format [eq, A, B, C, D, E, Tmin, Tmax]
- changeId(index)[source]¶
Common action to do when the component index change, change from user to system compound, editable to readOnly compound
- fill(coef)[source]¶
Populate the widgets with the DIPPR coefficient in format [eq, A, B, C, D, E, Tmin, Tmax]
- property value¶
Return the DIPPR equation parameters in the format: [eq, A, B, C, D, E, Tmin, Tmax]
- formula_DIPPR(eq, args)[source]¶
Calculate the formula of DIPPR equation in a latex format
- Parameters:
- eqinteger
Index of DIPPR equation
- argslist
Coefficient of DIPPR equation
- class UI.viewComponents.Parametric_widget(title, unit, index=0, prop='', coef=None, parent=None)[source]¶
Bases:
QGroupBoxComposite widget to edit/view a Parametric equation
- Attributes:
advancedValueReturn list with advances values for Antoine vapour pressure if
valueReturn list with coeff of array
Methods
changeId(index)Common action to do when the component index change, change from user to system compound, editable to readOnly compound
clear()Clear widget contents
fill(coef)Populate the widgets with the parametric coefficient
fit()Fit experimental data to a parametric equation
formula_Parametric(eq[, args])Calculate the formula of a parametric equation in a latex format
function(prop)Define functions of widget
plot([r])Plot the current parametric correlation equation r correlation coefficient, optional parameter for reuse the code in the fit data procedure
setReadOnly(boolean)Set widget readOnly state
valueChanged
- valueChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- dict_latex = {'antoine': '$P_v=e^{A-\\frac{B}{C+T}}$', 'henry': '$\\ln H = \\frac{A}{T}+B\\ln T+CT+D$', 'tension': '$\\sigma=A(1-T_r)^B$', 'viscosity': '$\\mu=e^{A\\left(\\frac{1}{T}-\\frac{1}{B}\\right)}$', 'wagner': '$P_v=\\frac{P_c}{Tr}e^{a\\tau+b\\tau^{1.5}+c\\tau^3+d\\tau^6}$'}¶
- dict_prop = {'antoine': 'P_v', 'henry': 'K_H', 'tension': '\\sigma', 'viscosity': '\\mu_g', 'wagner': 'P_v'}¶
- dict_count = {'antoine': 3, 'henry': 4, 'tension': 2, 'viscosity': 2, 'wagner': 4}¶
- __init__(title, unit, index=0, prop='', coef=None, parent=None)[source]¶
Constructor of widget
- Parameters:
- titlestring
Title so show of qgroupbox
- unitstring
Aditional string with unit representation
- indexinteger
Index of compound in database to show
- propstring
code name of property to show
- coeflist
List of DIPPR equation representation in format [eq, A, B, C, D, E, Tmin, Tmax]
- changeId(index)[source]¶
Common action to do when the component index change, change from user to system compound, editable to readOnly compound
- property value¶
Return list with coeff of array
- property advancedValue¶
Return list with advances values for Antoine vapour pressure if available
- formula_Parametric(eq, args=None)[source]¶
Calculate the formula of a parametric equation in a latex format
- Parameters:
- eqstring
Name of property to calculate
- argslist
Coefficient of parametric equation
- class UI.viewComponents.SelectPropertyDialog(parent=None)[source]¶
Bases:
QDialogDialog to select propertis to plot
- class UI.viewComponents.PlotPropertiesDialog(cmp, prop, parent=None)[source]¶
Bases:
PlotDialogDialog with plot for temperature dependence properties of pure compounds
- f = {'H_Henry': <function Henry>, 'Mu_Parametric': <function MuL_Parametric>, 'Pv_Antoine': <function Pv_Antoine>, 'Pv_Wagner': <function Pv_Wagner>, 'Tension_Parametric': <function Tension_Parametric>}¶
- data = {'DIPPR_CpG': '_dipprCpG', 'DIPPR_CpL': '_dipprCpL', 'DIPPR_Hv': '_dipprHv', 'DIPPR_KG': '_dipprKG', 'DIPPR_KL': '_dipprKL', 'DIPPR_MuG': '_dipprMuG', 'DIPPR_MuL': '_dipprMuL', 'DIPPR_Pv': '_dipprPv', 'DIPPR_RhoL': '_dipprRhoL', 'DIPPR_Tension': '_dipprSigma', 'DIPPR_cpS': '_dipprCpS', 'DIPPR_rhoS': '_dipprRhoS', 'H_Henry': 'henry', 'Mu_Parametric': '_parametricMu', 'Pv_Antoine': 'antoine', 'Pv_Wagner': 'wagner', 'Tension_Parametric': '_parametricSigma'}¶
- unitDIPPR = {'DIPPR_CpG': 'cpG', 'DIPPR_CpL': 'cpL', 'DIPPR_Hv': 'Hv', 'DIPPR_KG': 'kG', 'DIPPR_KL': 'kL', 'DIPPR_MuG': 'muG', 'DIPPR_MuL': 'muL', 'DIPPR_Pv': 'Pv', 'DIPPR_RhoL': 'rhoL', 'DIPPR_Tension': 'sigma', 'DIPPR_cpS': 'cpS', 'DIPPR_rhoS': 'rhoS'}¶
- class UI.viewComponents.View_Component(index=0, parent=None)[source]¶
Bases:
QDialogDialog to view the properties of compounds in pychemqt database in user friendly format. This dialog can be used too to edit a user component, or define a new component
- Attributes:
- index
Methods
buttonClicked(boton)Buttonbox functions management
change(index)Actions to be done when change index of compound
clear()Clear childer widget
fill(index)Populate widget with compound properties
Get compound data
help(page)Open help page in documentation
setDirty()Set dirty state
setReadOnly(boolean)Set readOnly for all child widgets
- cmp = <lib.compuestos.Componente object>¶
- index = None¶