Skip to content

Commit

Permalink
rename config to schemes and keep backward import compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Oct 16, 2024
1 parent 5734251 commit bcc4b70
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions idutils/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
"""Functions for detecting the persistent identifier."""

from . import validators
from .config import IDUTILS_PID_SCHEMES_CONFIG, IDUTILS_SCHEME_FILTER_CONFIG
from .proxies import custom_schemes_registry
from .schemes import IDUTILS_PID_SCHEMES as _IDUTILS_PID_SCHEMES
from .schemes import IDUTILS_SCHEME_FILTER as _IDUTILS_SCHEME_FILTER

IDUTILS_PID_SCHEMES = IDUTILS_PID_SCHEMES_CONFIG
IDUTILS_PID_SCHEMES = _IDUTILS_PID_SCHEMES
"""Definition of scheme name and associated test function.
Order of list is important, as identifier scheme detection will test in the
order given by this list."""


IDUTILS_SCHEME_FILTER = IDUTILS_SCHEME_FILTER_CONFIG
IDUTILS_SCHEME_FILTER = _IDUTILS_SCHEME_FILTER
"""(present_scheme, [list of schemes to remove if present_scheme found])."""


Expand Down
4 changes: 2 additions & 2 deletions idutils/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from importlib_metadata import entry_points

from .config import IDUTILS_PID_SCHEMES_CONFIG
from .schemes import IDUTILS_PID_SCHEMES


def _set_default_custom_scheme_config(scheme_config):
Expand Down Expand Up @@ -84,7 +84,7 @@ def pick_scheme_key(self, key):

def _load_entry_points(self, ep_name):
"""Load entry points into the internal registry."""
existing_id_names = set(scheme[0] for scheme in IDUTILS_PID_SCHEMES_CONFIG)
existing_id_names = set(scheme[0] for scheme in IDUTILS_PID_SCHEMES)

# Load entry points from the specified group
for ep in set(entry_points(group=ep_name)):
Expand Down
4 changes: 2 additions & 2 deletions idutils/config.py → idutils/schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from . import validators

IDUTILS_PID_SCHEMES_CONFIG = [
IDUTILS_PID_SCHEMES = [
("doi", validators.is_doi),
("ark", validators.is_ark),
("handle", validators.is_handle),
Expand Down Expand Up @@ -57,7 +57,7 @@
order given by this list."""


IDUTILS_SCHEME_FILTER_CONFIG = [
IDUTILS_SCHEME_FILTER = [
(
"url",
# None these can have URLs, in which case we exclude them
Expand Down

0 comments on commit bcc4b70

Please sign in to comment.