From 3e740d106e1027d2d29bfd79bc30ee9148db2ce0 Mon Sep 17 00:00:00 2001 From: Joel Leja Date: Mon, 8 Jun 2020 18:26:55 -0400 Subject: [PATCH] avoid comparing to booleans using 'is' --- prospect/models/parameters.py | 4 ++-- prospect/models/sedmodel.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/prospect/models/parameters.py b/prospect/models/parameters.py index e32b5a49..90d8fe65 100644 --- a/prospect/models/parameters.py +++ b/prospect/models/parameters.py @@ -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: @@ -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): diff --git a/prospect/models/sedmodel.py b/prospect/models/sedmodel.py index 524327ce..3a0b6f28 100644 --- a/prospect/models/sedmodel.py +++ b/prospect/models/sedmodel.py @@ -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) @@ -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 @@ -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