Ejemplo n.º 1
0
    # Load the database environment by first loading the profile and then loading the backend through the manager
    from aiida.manage.configuration import get_config, load_profile
    from aiida.manage.manager import get_manager
    config = get_config()
    load_profile(config.default_profile_name)
    get_manager().get_backend()
else:
    from aiida.manage import configuration
    from aiida.manage.configuration import load_profile, reset_config
    from aiida.manage.manager import get_manager

    # Set the global variable to trigger shortcut behavior in `aiida.manager.configuration.load_config`
    configuration.IN_RT_DOC_MODE = True

    # First need to reset the config, because an empty one will have been loaded when `aiida` module got imported
    reset_config()

    # Load the profile: this will first load the config, which will be the dummy one for RTD purposes
    load_profile()

    # Finally load the database backend but without checking the schema because there is no actual database
    get_manager()._load_backend(schema_check=False)

    # make sure all entry-points are detected, since readthedocs doesn't expose a way to do this
    # during post-install.
    import reentry
    reentry.manager.scan()

import aiida_strain

# -- General configuration ------------------------------------------------
Ejemplo n.º 2
0
        import sphinx_rtd_theme
        html_theme = 'sphinx_rtd_theme'
        html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
    except ImportError:
        # No sphinx_rtd_theme installed
        pass
    # Load the database environment by first loading the profile and then loading the backend through the manager
    config = configuration.get_config()
    configuration.load_profile(config.default_profile_name)
    get_manager().get_backend()
else:
    # Back-end settings for readthedocs online documentation.
    configuration.IN_RT_DOC_MODE = True
    configuration.BACKEND = "django"

    configuration.reset_config()  # empty config was created when importing aiida
    configuration.load_profile()  # load dummy config for RTD
    # load DB backend (no schema check since no DB)
    get_manager()._load_backend(schema_check=False)  # pylint: disable=protected-access

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.5'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.mathjax',