Repository: scikit-hep/pyhf

Issue:
consolidation: remove --qualify-names
# Description

the option added in #233 is obsolete know that we handle names shared across modifier types (#354 ) so it should be removed again


Discussion:

Resolving patch:
diff --git a/pyhf/commandline.py b/pyhf/commandline.py
--- a/pyhf/commandline.py
+++ b/pyhf/commandline.py
@@ -72,8 +72,7 @@ def json2xml(workspace, xmlfile, specroot, dataroot):
 )
 @click.option('--measurement', default=None)
 @click.option('-p', '--patch', multiple=True)
-@click.option('--qualify-names/--no-qualify-names', default=False)
-def cls(workspace, output_file, measurement, qualify_names, patch):
+def cls(workspace, output_file, measurement, patch):
     with click.open_file(workspace, 'r') as specstream:
         d = json.load(specstream)
     measurements = d['toplvl']['measurements']
@@ -105,11 +104,7 @@ def cls(workspace, output_file, measurement, qualify_names, patch):
             with click.open_file(p, 'r') as read_file:
                 p = jsonpatch.JsonPatch(json.loads(read_file.read()))
             spec = p.apply(spec)
-        p = Model(
-            spec,
-            poiname=measurements[measurement_index]['config']['poi'],
-            qualify_names=qualify_names,
-        )
+        p = Model(spec, poiname=measurements[measurement_index]['config']['poi'])
         observed = sum((d['data'][c] for c in p.config.channels), []) + p.config.auxdata
         result = hypotest(1.0, observed, p, return_expected_set=True)
         result = {
diff --git a/pyhf/paramsets.py b/pyhf/paramsets.py
--- a/pyhf/paramsets.py
+++ b/pyhf/paramsets.py
@@ -62,7 +62,7 @@ def reduce_paramset_requirements(paramset_requirements):
         for k in param_keys:
             if len(combined_param[k]) != 1 and k != 'op_code':
                 raise exceptions.InvalidNameReuse(
-                    "Multiple values for '{}' ({}) were found for {}. Use unique modifier names or use qualify_names=True when constructing the pdf.".format(
+                    "Multiple values for '{}' ({}) were found for {}. Use unique modifier names when constructing the pdf.".format(
                         k, list(combined_param[k]), param_name
                     )
                 )
diff --git a/pyhf/pdf.py b/pyhf/pdf.py
--- a/pyhf/pdf.py
+++ b/pyhf/pdf.py
@@ -12,7 +12,7 @@
 
 
 class _ModelConfig(object):
-    def __init__(self, spec, poiname='mu', qualify_names=False):
+    def __init__(self, spec, poiname='mu'):
         self.poi_index = None
         self.par_map = {}
         self.par_order = []
@@ -37,13 +37,6 @@ def __init__(self, spec, poiname='mu', qualify_names=False):
                 self.samples.append(sample['name'])
                 for modifier_def in sample['modifiers']:
                     self.parameters.append(modifier_def['name'])
-                    if qualify_names:
-                        fullname = '{}/{}'.format(
-                            modifier_def['type'], modifier_def['name']
-                        )
-                        if modifier_def['name'] == poiname:
-                            poiname = fullname
-                        modifier_def['name'] = fullname
 
                     # get the paramset requirements for the given modifier. If
                     # modifier does not exist, we'll have a KeyError
@@ -62,8 +55,8 @@ def __init__(self, spec, poiname='mu', qualify_names=False):
                         (
                             modifier_def['name'],  # mod name
                             modifier_def['type'],  # mod type
-                            modifier_def['name'],
-                        )  # parset name
+                            modifier_def['name'],  # parset name
+                        )
                     )
 
                     # check the shareability (e.g. for shapesys for example)


Test patch:
diff --git a/tests/test_pdf.py b/tests/test_pdf.py
--- a/tests/test_pdf.py
+++ b/tests/test_pdf.py
@@ -372,6 +372,4 @@ def test_invalid_modifier_name_resuse():
         ]
     }
     with pytest.raises(pyhf.exceptions.InvalidNameReuse):
-        pdf = pyhf.Model(spec, poiname='reused_name')
-
-    pdf = pyhf.Model(spec, poiname='reused_name', qualify_names=True)
+        pyhf.Model(spec, poiname='reused_name')