pyiron.base.settings package

Submodules

pyiron.base.settings.generic module

class pyiron.base.settings.generic.Settings(config=None)[source]

Bases: object

The settings object can either search for an configuration file and use the default configuration only when no other configuration file is found, or it can be forced to use the default configuration file.

Parameters:config (dict) – Provide a dict with the configuration.
close_connection()[source]

Internal function to close the connection to the database.

database
login_user

Get the username of the current user

Returns:username
Return type:str
open_connection()[source]

Internal function to open the connection to the database. Only after this function is called the database is accessable.

resource_paths

Get the path where the potentials for the individual Hamiltons are located

Returns:path of paths
Return type:list
switch_to_central_database()[source]
switch_to_local_database(file_name='pyiron.db', cwd=None)[source]
switch_to_user_mode()[source]

Switch from viewer mode to user mode - if viewer_mode is enable pyiron has read only access to the database.

switch_to_viewer_mode()[source]

Switch from user mode to viewer mode - if viewer_mode is enable pyiron has read only access to the database.

top_path(full_path)[source]

Validated that the full_path is a sub directory of one of the pyrion environments loaded.

Parameters:full_path (str) – path
Returns:path
Return type:str
class pyiron.base.settings.generic.Singleton[source]

Bases: type

Implemented with suggestions from

http://stackoverflow.com/questions/6760685/creating-a-singleton-in-python

pyiron.base.settings.generic.convert_path(path)[source]

pyiron.base.settings.install module

pyiron.base.settings.install.install_pyiron(config_file_name='~/.pyiron', zip_file='resources.zip', resource_directory='~/pyiron/resources', giturl_for_zip_file='https://github.com/pyiron/pyiron-resources/archive/master.zip', git_folder_name='pyiron-resources-master')[source]

pyiron.base.settings.logger module

pyiron.base.settings.logger.set_logging_level(level, channel=None)[source]

Set level for logger

Parameters:
  • level (str) – ‘DEBUG, INFO, WARN’
  • channel (int) – 0: file_log, 1: stream, None: both
pyiron.base.settings.logger.setup_logger()[source]

Setup logger - logs are written to pyiron.log

Returns:Logger
Return type:logging.getLogger

pyiron.base.settings.update module

pyiron.base.settings.update.database()[source]

Convenience function to update an existing (older) version of the database to the latest version, by modifying the database columns. This is only possible if no other pyiron session is accessing the database. Therefore the script might take some time to be executed successfully.

Module contents