Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 12, 2021
1 parent 124bd60 commit 7cacc62
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/pyhf/modifiers/histosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def append(self, key, channel, sample, thismod, defined_samp):
self._mega_mods[key][sample]['data']['mask'] += moddata['mask']

if thismod:
self.required_parsets.setdefault(thismod['name'], [required_parset(defined_samp['data'], thismod['data'])])
self.required_parsets.setdefault(
thismod['name'],
[required_parset(defined_samp['data'], thismod['data'])],
)

def finalize(self):
return self._mega_mods
Expand Down
5 changes: 4 additions & 1 deletion src/pyhf/modifiers/lumi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def append(self, key, channel, sample, thismod, defined_samp):
moddata = self.collect(thismod, nom)
self._mega_mods[key][sample]['data']['mask'] += moddata['mask']
if thismod:
self.required_parsets.setdefault(thismod['name'], [required_parset(defined_samp['data'], thismod['data'])])
self.required_parsets.setdefault(
thismod['name'],
[required_parset(defined_samp['data'], thismod['data'])],
)

def finalize(self):
return self._mega_mods
Expand Down
5 changes: 4 additions & 1 deletion src/pyhf/modifiers/normfactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def append(self, key, channel, sample, thismod, defined_samp):
moddata = self.collect(thismod, nom)
self._mega_mods[key][sample]['data']['mask'] += moddata['mask']
if thismod:
self.required_parsets.setdefault(thismod['name'], [required_parset(defined_samp['data'], thismod['data'])])
self.required_parsets.setdefault(
thismod['name'],
[required_parset(defined_samp['data'], thismod['data'])],
)

def finalize(self):
return self._mega_mods
Expand Down
5 changes: 4 additions & 1 deletion src/pyhf/modifiers/normsys.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def append(self, key, channel, sample, thismod, defined_samp):
self._mega_mods[key][sample]['data']['mask'] += moddata['mask']

if thismod:
self.required_parsets.setdefault(thismod['name'], [required_parset(defined_samp['data'], thismod['data'])])
self.required_parsets.setdefault(
thismod['name'],
[required_parset(defined_samp['data'], thismod['data'])],
)

def finalize(self):
return self._mega_mods
Expand Down
5 changes: 4 additions & 1 deletion src/pyhf/modifiers/shapefactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def append(self, key, channel, sample, thismod, defined_samp):
moddata = self.collect(thismod, nom)
self._mega_mods[key][sample]['data']['mask'] += moddata['mask']
if thismod:
self.required_parsets.setdefault(thismod['name'], [required_parset(defined_samp['data'], thismod['data'])])
self.required_parsets.setdefault(
thismod['name'],
[required_parset(defined_samp['data'], thismod['data'])],
)

def finalize(self):
return self._mega_mods
Expand Down
8 changes: 5 additions & 3 deletions src/pyhf/modifiers/shapesys.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def append(self, key, channel, sample, thismod, defined_samp):
self._mega_mods[key][sample]['data']['nom_data'] += moddata['nom_data']

if thismod:
self.required_parsets.setdefault(thismod['name'], [required_parset(defined_samp['data'], thismod['data'])])

self.required_parsets.setdefault(
thismod['name'],
[required_parset(defined_samp['data'], thismod['data'])],
)

def finalize(self):
return self._mega_mods
Expand All @@ -64,7 +66,7 @@ def finalize(self):
class shapesys_combined:
name = 'shapesys'
op_code = 'multiplication'

def __init__(self, modifiers, pdfconfig, builder_data, batch_size=None):
self.batch_size = batch_size

Expand Down
5 changes: 4 additions & 1 deletion src/pyhf/modifiers/staterror.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def append(self, key, channel, sample, thismod, defined_samp):
self._mega_mods[key][sample]['data']['nom_data'] += moddata['nom_data']

if thismod:
self.required_parsets.setdefault(thismod['name'], [required_parset(defined_samp['data'], thismod['data'])])
self.required_parsets.setdefault(
thismod['name'],
[required_parset(defined_samp['data'], thismod['data'])],
)

def finalize(self):
return self._mega_mods
Expand Down
2 changes: 1 addition & 1 deletion src/pyhf/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _finalize_parameters(user_parameters, _paramsets_requirements, channel_nbins

_sets = {}
for param_name, paramset_requirements in _reqs.items():
paramset_type = getattr(pyhf.parameters,paramset_requirements['paramset_type'])
paramset_type = getattr(pyhf.parameters, paramset_requirements['paramset_type'])
paramset = paramset_type(**paramset_requirements)
_sets[param_name] = paramset

Expand Down

0 comments on commit 7cacc62

Please sign in to comment.