Skip to content

Commit

Permalink
Merge pull request #183 from jrleja/update_boolean_comparison
Browse files Browse the repository at this point in the history
avoid comparing boolean arrays to booleans using 'is'
  • Loading branch information
bd-j authored Jun 9, 2020
2 parents 629674b + 3e740d1 commit 002cdbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions prospect/models/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def propagate_parameter_dependencies(self):
value depends on another parameter, calculate those values and store
them in the :py:attr:`self.params` dictionary.
"""
if self._has_parameter_dependencies is False:
if self._has_parameter_dependencies == False:
return
for p, info in list(self.config_dict.items()):
if 'depends_on' in info:
Expand Down Expand Up @@ -247,7 +247,7 @@ def fixed_params(self):
``config_dict``.
"""
return [k['name'] for k in pdict_to_plist(self.config_list)
if (k.get('isfree', False) is False)]
if (k.get('isfree', False) == False)]

@property
def description(self):
Expand Down
8 changes: 4 additions & 4 deletions prospect/models/sedmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def predict_spec(self, obs, sigma_spec, **extras):
calibrated_spec[emask] += self._elinespec.sum(axis=1)
# Otherwise, if FSPS is not adding emission lines to the spectrum, we
# add emission lines to valid pixels here.
elif (self.params.get("nebemlineinspec", True) is False) & (emask.any()):
elif (self.params.get("nebemlineinspec", True) == False) & (emask.any()):
self._elinespec = self.get_eline_spec(wave=self._wave[emask])
if emask.any():
calibrated_spec[emask] += self._elinespec.sum(axis=1)
Expand Down Expand Up @@ -321,7 +321,7 @@ def predict_phot(self, filters):
phot = np.atleast_1d(10**(-0.4 * mags))

# generate emission-line photometry
if self.params.get('nebemlineinspec', False) is False:
if self.params.get('nebemlineinspec', False) == False:
phot += self.nebline_photometry(filters)

return phot
Expand Down Expand Up @@ -469,8 +469,8 @@ def get_el(self, obs, calibrated_spec, sigma_spec=None):
"""
# ensure we have no emission lines in spectrum
# and we definitely want them.
assert self.params['nebemlineinspec'] is False
assert self.params['add_neb_emission'] is True
assert self.params['nebemlineinspec'] == False
assert self.params['add_neb_emission'] == True

# generate Gaussians on appropriate wavelength gride
idx = self._elines_to_fit
Expand Down

0 comments on commit 002cdbf

Please sign in to comment.