lib.config module

Module with global configuration of pychemqt

Variables:

  • conf_dir: User configuration path

  • Preferences: ConfigParser instance with pychemqt preferences

  • currentConfig: ConfigParser instance with the configuration of current pychemqt project open or the last open project

Configuration tools

lib.config.getComponents(solidos=False, config=None, name=True)[source]

Procedure to get index of component in current project

Parameters:
solidosbool

Return too solids components

configConfigParser

It’s possible use a custom config instance

namebool

Return too the name and molecular weight of components

Returns:
idlist

List of index of components

namelist

List of name of components

Mlist

List of molecular weight of components

lib.config.getMainWindowConfig()[source]

Return config of current project

lib.config.setMainWindowConfig(config=None)[source]

Set config as current project

class lib.config.Entity(**kwargs)[source]

Bases: object

General class for model object, with basic functionality:

  • clear object

  • definition of boolean characteristic of object

  • input used for definition

  • note properties with description

  • save/load from file

  • properties for report, tooltip

Child class include:

  • Corriente, Mezcla, Solids

  • equipment

Attributes:
numInputs

Input count in kwargs

Methods

__call__(**kwargs)

Add callable functionality, so it can be possible add kwargs, advanced functionality can be added in subclass

cleanOldValues(**kwargs)

Update kwargs with new input kwargs, defined in child class, here can be implemented kwarg incompatibiity input and more

clear()

Clear entity and stay as new instance

popup(preferences[, exception])

Return a list with properties of entity to show in a puput preferences: ConfigParser instance with selected properties to show

propertiesListTitle(index)

Define titles for list properties in popup

propertiesNames()

List with properties availables for show in poput

propertiesToText([index, linesep, suffix, ...])

Return a string representation of properties for report index: Index of properties in propertiesList None: Return all properties array: Return the selected properties int: Return only the indexed property linesep: Boolean to add a linesep at end line suffix: Optional suffix text

readFromJSON(data)

Read entity from file

readListFromJSON(data, key)

Read list from file, customize in entities with complex list

show()

General function to show entity properties as key: value text

writeListtoJSON(data, key, value)

Write list to file, Customize in entities with complex list

writeToJSON(data)

Save kwargs properties of entity to file

properties

propertiesAttribute

propertiesTitle

propertiesUnit

readStatefromJSON

setNotas

writeStatetoJSON

_bool = False
kwargs_forbidden = ['entrada']
notas = ''
notasPlain = ''
_dependence = ''
__init__(**kwargs)[source]

Class constructor, copy kwargs for child class, it can be customize for child class to add functionality

cleanOldValues(**kwargs)[source]

Update kwargs with new input kwargs, defined in child class, here can be implemented kwarg incompatibiity input and more

clear()[source]

Clear entity and stay as new instance

show()[source]

General function to show entity properties as key: value text

setNotas(html, txt)[source]
property numInputs

Input count in kwargs

writeToJSON(data)[source]

Save kwargs properties of entity to file

writeListtoJSON(data, key, value)[source]

Write list to file, Customize in entities with complex list

readFromJSON(data)[source]

Read entity from file

readListFromJSON(data, key)[source]

Read list from file, customize in entities with complex list

writeStatetoJSON(data)[source]
readStatefromJSON(data)[source]
classmethod propertiesNames()[source]

List with properties availables for show in poput

properties()[source]
_prop(attr)[source]
propertiesListTitle(index)[source]

Define titles for list properties in popup

propertiesTitle()[source]
propertiesAttribute()[source]
propertiesUnit()[source]
popup(preferences, exception=[])[source]

Return a list with properties of entity to show in a puput preferences: ConfigParser instance with selected properties to show

propertiesToText(index=None, linesep=True, suffix='', kwCheck=False, kwKey='', kwSuffix='', kwValue='')[source]

Return a string representation of properties for report index: Index of properties in propertiesList

None: Return all properties array: Return the selected properties int: Return only the indexed property

linesep: Boolean to add a linesep at end line suffix: Optional suffix text