pyiron.base.settings.generic module

class pyiron.base.settings.generic.Settings(*args, **kwargs)[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.

static convert_database_config(config)[source]
property database
property database_is_disabled
static get_config_from_environment(environment, config)[source]
property 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.

property project_check_enabled
property 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.

property publication_lst

List of publications currently in use.

Returns

list of publications

Return type

list

property queue_adapter
property 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