Skip to content

Commit

Permalink
Mark private API with an underscore
Browse files Browse the repository at this point in the history
The AiiDA public API has been defined in the documentation as every import that
can be done from a secondary level. This is however not transparent to users
and plugin developers as it is hidden in the doc resulting in a lot of misuse
of private functionalities. The widespread use of these private functionalities
blocks improvements in the code as we are more hesitant in changing
functionalities for wrong backwards compatibility.

This PR marks clearly the internal functioanlities with an underscore so a
misuse only can happen intentionally. This gives us the opportunity to improve
the public API as we can implement replacements for functionalities in the
private API that are widely used.
  • Loading branch information
agoscinski committed Nov 25, 2024
1 parent a863d1e commit 035b644
Show file tree
Hide file tree
Showing 607 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/aiida/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
More information at http://www.aiida.net
"""

from aiida.common.log import configure_logging # noqa: F401
from aiida.manage.configuration import get_config_option, get_profile, load_profile, profile_context # noqa: F401
from aiida.common._log import configure_logging # noqa: F401
from aiida.manage._configuration import get_config_option, get_profile, load_profile, profile_context # noqa: F401

__copyright__ = (
'Copyright (c), This file is part of the AiiDA platform. '
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
import sys

if __name__ == '__main__':
from aiida.cmdline.commands.cmd_verdi import verdi
from aiida.cmdline._commands.cmd_verdi import verdi

sys.exit(verdi())
2 changes: 1 addition & 1 deletion src/aiida/brokers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .broker import Broker
from ._broker import Broker

__all__ = ('Broker',)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/aiida/cmdline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

# fmt: off

from .groups import *
from .params import *
from .utils import *
from ._groups import *
from ._params import *
from ._utils import *

__all__ = (
'AbsolutePathParamType',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/aiida/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

# fmt: off

from .datastructures import *
from .exceptions import *
from .extendeddicts import *
from .links import *
from .log import *
from .progress_reporter import *
from ._datastructures import *
from ._exceptions import *
from ._extendeddicts import *
from ._links import *
from ._log import *
from ._progress_reporter import *

__all__ = (
'AIIDA_LOGGER',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions src/aiida/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

# fmt: off

from .daemon import *
from .exceptions import *
from .launch import *
from .persistence import *
from .processes import *
from .runners import *
from .utils import *
from ._daemon import *
from ._exceptions import *
from ._launch import *
from ._persistence import *
from ._processes import *
from ._runners import *
from ._utils import *

__all__ = (
'AiiDAPersister',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/aiida/manage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

# fmt: off

from .caching import *
from .configuration import *
from .external import *
from .manager import *
from ._caching import *
from ._configuration import *
from ._external import *
from ._manager import *

__all__ = (
'CURRENT_CONFIG_VERSION',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions src/aiida/orm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

# fmt: off

from .authinfos import *
from .comments import *
from .computers import *
from .entities import *
from .extras import *
from .fields import *
from .groups import *
from .logs import *
from .nodes import *
from .querybuilder import *
from .users import *
from .utils import *
from ._authinfos import *
from ._comments import *
from ._computers import *
from ._entities import *
from ._extras import *
from ._fields import *
from ._groups import *
from ._logs import *
from ._nodes import *
from ._querybuilder import *
from ._users import *
from ._utils import *

__all__ = (
'ASCENDING',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/aiida/parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# fmt: off

from .parser import *
from ._parser import *

__all__ = (
'Parser',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/aiida/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

# fmt: off

from .entry_point import *
from .factories import *
from .utils import *
from ._entry_point import *
from ._factories import *
from ._utils import *

__all__ = (
'BaseFactory',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/aiida/repository/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

# fmt: off

from .backend import *
from .common import *
from .repository import *
from ._backend import *
from ._common import *
from ._repository import *

__all__ = (
'AbstractRepositoryBackend',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 035b644

Please sign in to comment.