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.

publication
publication_add(pub_dict)[source]

Add a publication to the list of publications

Parameters

pub_dict (dict) – The key should be the name of the code used and the value a list of publications to cite.

publication_lst

List of publications currently in use.

Returns

list of publications

Return type

list

queue_adapter
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 central database

switch_to_local_database(file_name='pyiron.db', cwd=None)[source]

Swtich to an local SQLite based database.

Parameters
  • file_name (str) – SQLite database file name

  • cwd (str/None) – directory where the SQLite database file is located in

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]

Convert path to POSIX path

Parameters

path (str) – input path

Returns

absolute path in POSIX format

Return type

str

pyiron.base.settings.install module

pyiron.base.settings.install.command_line(argv)[source]

Parse the command line arguments.

Parameters

argv – Command line arguments

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

Function to configure the pyiron installation.

Parameters
  • config_file_name (str) – configuration file name - usually ~/.pyiron

  • zip_file (str) – name of the compressed file

  • project_path (str) – the location where pyiron is going to store the pyiron projects

  • resource_directory (str) – the location where the resouces (executables, potentials, …) for pyiron are stored.

  • giturl_for_zip_file (str) – url for the zipped resources file on github

  • git_folder_name (str) – name of the extracted folder

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