cms-analysis / HiggsAnalysis-CombinedLimit

CMS Higgs Combination toolkit.
https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/latest
Apache License 2.0
75 stars 381 forks source link

Fix linter error for type comparison #857

Open nsmith- opened 1 year ago

nsmith- commented 1 year ago

In the code we use a lot of type(x) == y conditionals, e.g. https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/blob/cc6baaf1f7aeb16d05eee223380035ab93425a3d/python/DatacardParser.py#L450-L451 which recently started being checked by flake8, e.g.

./python/DatacardParser.py:450:38: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`

A few quick changes, e.g. to isinstance(x, y) would suppress these. For now I've silenced the warning in #856