pyhf
pyhf copied to clipboard
Remove `InvalidNameReuse` exception in favor of in `InvalidModel`
trafficstars
In relation to Issue #2059, @lorenzennio was wanting to handle this via raising InvalidNameReuse though he and @kratsg pointed out that what is actually happening is maybe a better use of InvalidModel. InvalidNameReuse was added in PR https://github.com/scikit-hep/pyhf/pull/209 though in the current uses of InvalidNameReuse
https://github.com/scikit-hep/pyhf/blob/1191f6676002b26bbd751c1b8e116400baaed25e/src/pyhf/parameters/utils.py#L42-L45
@kratsg thinks this should just be covered by InvalidModel.
If this actually is an invalid model then InvalidNameReuse can be removed everywhere in the code and InvalidModel can be used instead.