Skip to content

Commit

Permalink
REV: Revert the qmflows.packages.registry deprecation
Browse files Browse the repository at this point in the history
This callback is required when working directly working with certain `noodles` functions
  • Loading branch information
Bas van Beek committed Sep 19, 2022
1 parent c6e8f46 commit 84bc0bb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/_packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Package-related Functions
.. currentmodule:: qmflows.packages
.. autosummary::
run
registry

The Package Class
-----------------
Expand Down
5 changes: 2 additions & 3 deletions src/qmflows/packages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
from typing import TYPE_CHECKING

from ._packages import (
Package, Result, run,
Package, Result, run, registry,
_load_properties as load_properties,
_registry as registry,
)
from ._serializer import (
_SerMolecule as SerMolecule,
Expand All @@ -19,7 +18,7 @@
from ._package_wrapper import PackageWrapper, ResultWrapper, JOB_MAP

__all__ = [
'Package', 'Result', 'run',
'Package', 'Result', 'run', 'registry',
'CP2K_Result', 'CP2K', 'cp2k',
'CP2KMM_Result', 'CP2KMM', 'cp2k_mm',
'ADF_Result', 'DFTB_Result', 'ADF', 'DFTB', 'adf', 'dftb',
Expand Down
15 changes: 5 additions & 10 deletions src/qmflows/packages/_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,20 +722,15 @@ def registry() -> Registry:
This *Registry* class contains hints that help Noodles to encode
and decode this Package object.
Returns
-------
:class:`dict[type, Serialiser] <dict>`
A dictionary mapping types to their respective noodles ``Serializer`` instance.
""" # noqa
return REGISTRY


@functools.wraps(registry)
def _registry() -> _Settings:
"""Deprecated alias for :func:`registry`."""
warnings.warn(
"`qmflows.packages.registry` is deprecated and will be removed in the future",
QMFlowsDeprecationWarning, stacklevel=2,
)
return registry()


def import_parser(
ds: Mapping[str, "None | str"],
module_root: str = "qmflows.parsers",
Expand Down
1 change: 0 additions & 1 deletion test/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def test_modules(self, name: str, alternative: "None | str") -> None:
),

# qmflows.packages
registry=("qmflows.packages.registry", None, {}),
load_properties=("qmflows.packages.load_properties", None, {"name": "CP2K"}),
SerMolecule=("qmflows.packages.SerMolecule", None, {}),
SerSettings=("qmflows.packages.SerSettings", None, {}),
Expand Down
2 changes: 1 addition & 1 deletion test/test_molecule.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test molecule serialization."""

from qmflows.packages._packages import registry
from qmflows.packages import registry
from qmflows.test_utils import PATH
from scm.plams import Molecule

Expand Down

0 comments on commit 84bc0bb

Please sign in to comment.