PetroFit / petrofit

Python package for calculating Petrosian properties and fitting galaxy light profiles
https://petrofit.readthedocs.io
26 stars 6 forks source link

Accessing `PSFConvolvedModel2D.model` twice caused an error #142

Closed robelgeda closed 2 years ago

robelgeda commented 2 years ago

Running the PSFConvolvedModel2D.model attribute twice or mode causes the following error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Input In [244], in <cell line: 1>()
----> 1 ori_fitted_model.model

File .../petrofit/petrofit/modeling/models.py:348, in PSFConvolvedModel2D.model(self)
    345     setattr(model, param, getattr(self, param).value)
    347 fixed = self.fixed
--> 348 del fixed['psf_pa']
    350 bounds = self.bounds
    351 del bounds['psf_pa']

File ~/miniconda3/envs/petrofit/lib/python3.10/collections/__init__.py:1112, in UserDict.__delitem__(self, key)
   1111 def __delitem__(self, key):
-> 1112     del self.data[key]

KeyError: 'psf_pa'
robelgeda commented 2 years ago

Fixed with #145