Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# `aiida.manage`

## Package Contents

### Classes

`Config` |
`Option` |
`Postgres` |
`ProcessLauncher` |
`Profile` |
`RabbitmqManagementClient` |

### Functions

`check_and_migrate_config` |
`config_needs_migrating` |
`config_schema` |
`disable_caching` |
`downgrade_config` |
`enable_caching` |
`get_current_version` |
`get_launch_queue_name` |
`get_manager` |
`get_message_exchange_name` |
`get_option` |
`get_option_names` |
`get_rmq_url` |
`get_task_exchange_name` |
`get_use_cache` |
`parse_option` |
`upgrade_config` |

### Data

`BROKER_DEFAULTS` |
`CURRENT_CONFIG_VERSION` |
`MIGRATIONS` |
`OLDEST_COMPATIBLE_CONFIG_VERSION` |

### External

`DEFAULT_DSN` |
`PostgresConnectionMode` |

### API

aiida.manage.BROKER_DEFAULTS = None

aiida.manage.CURRENT_CONFIG_VERSION = 9

class aiida.manage.Config(filepath: str, config: dict, validate: bool = True)

  Initialization

  KEY_VERSION = 'CONFIG_VERSION'
  KEY_VERSION_CURRENT = 'CURRENT'
  KEY_VERSION_OLDEST_COMPATIBLE = 'OLDEST_COMPATIBLE'
  KEY_DEFAULT_PROFILE = 'default_profile'
  KEY_PROFILES = 'profiles'
  KEY_OPTIONS = 'options'
  KEY_SCHEMA = '$schema'
  classmethod from_file(filepath)
  classmethod _backup(filepath)
  static validate(config: dict, filepath: Optional[str] = None)
  __eq__(other)
  __ne__(other)
  handle_invalid(message)
  property dictionary: dict
  property version
  property version_oldest_compatible
  property version_settings
  property filepath
  property dirpath
  property default_profile_name
  property profile_names
  property profiles
  validate_profile(name)
  get_profile(name: Optional[str] = None) → aiida.manage.configuration.profile.Profile
  add_profile(profile)
  update_profile(profile)
  remove_profile(name)
  delete_profile(name: str, include_database: bool = True, include_database_user: bool = False, include_repository: bool = True)
  set_default_profile(name, overwrite=False)
  property options
  set_option(option_name, option_value, scope=None, override=True)
  unset_option(option_name: str, scope=None)
  get_option(option_name, scope=None, default=True)
  get_options(scope: Optional[str] = None) → Dict[str, Tuple[aiida.manage.configuration.options.Option, str, Any]]
  store()
  _atomic_write(filepath=None)

exception aiida.manage.ConfigValidationError(message: str, keypath: Sequence[Any] = (), schema: Optional[dict] = None, filepath: Optional[str] = None)

  Bases: `aiida.common.exceptions.ConfigurationError`

  Initialization

  __str__() → str

aiida.manage.MIGRATIONS = ()

exception aiida.manage.ManagementApiConnectionError

  Bases: `aiida.common.exceptions.AiidaException`

  Initialization

aiida.manage.OLDEST_COMPATIBLE_CONFIG_VERSION = 9

class aiida.manage.Option(name: str, schema: Dict[str, Any])

  Initialization

  __str__() → str
  property name: str
  property schema: Dict[str, Any]
  property valid_type: Any
  property default: Any
  property description: str
  property global_only: bool
  validate(value: Any, cast: bool = True) → Any

class aiida.manage.Postgres(dbinfo=None, **kwargs)

  Bases: `pgsu.PGSU`

  Initialization

  classmethod from_profile(profile: aiida.manage.configuration.Profile, **kwargs)
  dbuser_exists(dbuser)
  create_dbuser(dbuser, dbpass, privileges='')
  drop_dbuser(dbuser)
  check_dbuser(dbuser)
  db_exists(dbname)
  create_db(dbuser, dbname)
  drop_db(dbname)
  copy_db(src_db, dest_db, dbuser)
  check_db(dbname)
  create_dbuser_db_safe(dbname, dbuser, dbpass)
  property host_for_psycopg2
  property port_for_psycopg2
  property dbinfo

class aiida.manage.ProcessLauncher

  Bases: `plumpy.ProcessLauncher`

  static handle_continue_exception(node, exception, message)
  async _continue(communicator, pid, nowait, tag=None)

class aiida.manage.Profile(name: str, config: Mapping[str, Any], validate=True)

  Initialization

  KEY_UUID = 'PROFILE_UUID'
  KEY_DEFAULT_USER_EMAIL = 'default_user_email'
  KEY_STORAGE = 'storage'
  KEY_PROCESS = 'process_control'
  KEY_STORAGE_BACKEND = 'backend'
  KEY_STORAGE_CONFIG = 'config'
  KEY_PROCESS_BACKEND = 'backend'
  KEY_PROCESS_CONFIG = 'config'
  KEY_OPTIONS = 'options'
  KEY_TEST_PROFILE = 'test_profile'
  REQUIRED_KEYS = ()
  __repr__() → str
  copy()
  property uuid: str
  property default_user_email: Optional[str]
  property storage_backend: str
  property storage_config: Dict[str, Any]
  set_storage(name: str, config: Dict[str, Any]) → None
  property storage_cls: Type[aiida.orm.implementation.StorageBackend]
  property process_control_backend: str
  property process_control_config: Dict[str, Any]
  set_process_controller(name: str, config: Dict[str, Any]) → None
  property options
  get_option(option_key, default=None)
  set_option(option_key, value, override=True)
  unset_option(option_key)
  property name
  property dictionary: Dict[str, Any]
  property is_test_profile: bool
  property repository_path: pathlib.Path
  property rmq_prefix: str
  get_rmq_url() → str
  property filepaths

class aiida.manage.RabbitmqManagementClient(username: str, password: str, hostname: str, virtual_host: str)

  Initialization

  format_url(url: str, url_params: dict[str, str] | None = None) → str
  request(url: str, url_params: dict[str, str] | None = None, method: str = 'GET', params: dict[str, Any] | None = None) → requests.Response
  property is_connected: bool

aiida.manage.check_and_migrate_config(config, filepath: Optional[str] = None)

aiida.manage.config_needs_migrating(config, filepath: Optional[str] = None)

aiida.manage.config_schema() → Dict[str, Any]

aiida.manage.disable_caching(*, identifier=None)

aiida.manage.downgrade_config(config: aiida.manage.configuration.migrations.migrations.ConfigType, target: int, migrations: Iterable[Type[aiida.manage.configuration.migrations.migrations.SingleMigration]] = MIGRATIONS) → aiida.manage.configuration.migrations.migrations.ConfigType

aiida.manage.enable_caching(*, identifier=None)

aiida.manage.get_current_version(config)

aiida.manage.get_launch_queue_name(prefix=None)

aiida.manage.get_manager() → Manager

aiida.manage.get_message_exchange_name(prefix)

aiida.manage.get_option(name: str) → aiida.manage.configuration.options.Option

aiida.manage.get_option_names() → List[str]

aiida.manage.get_rmq_url(protocol=None, username=None, password=None, host=None, port=None, virtual_host=None, **kwargs)

aiida.manage.get_task_exchange_name(prefix)

aiida.manage.get_use_cache(*, identifier=None)

aiida.manage.parse_option(option_name: str, option_value: Any) → Tuple[aiida.manage.configuration.options.Option, Any]

aiida.manage.upgrade_config(config: aiida.manage.configuration.migrations.migrations.ConfigType, target: int = CURRENT_CONFIG_VERSION, migrations: Iterable[Type[aiida.manage.configuration.migrations.migrations.SingleMigration]] = MIGRATIONS) → aiida.manage.configuration.migrations.migrations.ConfigType