Skip to content

Commit 0c19285

Browse files
scarlehoffRoyStegeman
authored andcommitted
add deprecation notice ; remove the easy way out for the flag
1 parent c263d94 commit 0c19285

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

n3fit/src/n3fit/scripts/n3fit_exec.py

-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ def from_yaml(cls, o, *args, **kwargs):
159159
N3FIT_FIXED_CONFIG['use_thcovmat_in_sampling'] = thconfig.get(
160160
'use_thcovmat_in_sampling', True
161161
)
162-
# TODO: this whole function is upside down?
163-
N3FIT_FIXED_CONFIG["allow_legacy_names"] = file_content.get("allow_legacy_names", False)
164-
# Fitting flag
165162
file_content.update(N3FIT_FIXED_CONFIG)
166163
return cls(file_content, *args, **kwargs)
167164

nnpdf_data/nnpdf_data/__init__.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
from functools import lru_cache
2+
import logging
23
import pathlib
34

45
import yaml
56

7+
log = logging.getLogger(__name__)
8+
69
path_vpdata = pathlib.Path(__file__).parent
710
path_commondata = path_vpdata / "commondata"
811

@@ -18,6 +21,13 @@
1821
}
1922

2023

24+
@lru_cache
25+
def _warn_old_names():
26+
log.warning(
27+
"The usage of old names is deprecated and support will be dropped in future versions! Update your runcards"
28+
)
29+
30+
2131
@lru_cache
2232
def legacy_to_new_map(dataset_name, sys=None):
2333
"""Find the new dataset name and variant corresponding to an old dataset
@@ -35,6 +45,13 @@ def legacy_to_new_map(dataset_name, sys=None):
3545
)
3646
variant += f"_{sys}"
3747

48+
# Deprecation notice
49+
_warn_old_names()
50+
warn_text = f"Please change {dataset_name} to {new_name}"
51+
if variant is None:
52+
warn_text += f" (variant: {variant})"
53+
log.warning(warn_text)
54+
3855
return new_name, variant
3956

4057

0 commit comments

Comments
 (0)