make BudgetItem.freq a property
This makes BudgetItem
frequency arrays properties instead of attributes. As an attribute, BudgetItem.freq
can be set directly but this doesn't update the precomp cache or any of the frequency arrays of the cal_objs
and noise_objs
for instances of Budget
. This is a problem if run
is called without any keyword arguments after changing freq
. Now that freq
is a property, the setter clears the precomp cache and recurses through the cal_objs
and noise_objs
if applicable.
So this works correctly now
traces1 = budget.run(freq=freq1)
budget.freq = freq2
traces2 = budget.run()
Merge request reports
Activity
added bug label
53 53 np.log10(float(fspec[2])), 54 54 int(fspec[1]), 55 55 ) 56 except (ValueError, IndexError): 56 except (ValueError, IndexError, AttributeError): If
spec
is notnp.ndarray
and is notNone
, thenspec
is not a string when entering the try block.spec.split(':')
raises anAttributeError
in this case. This was also previously the case and I fixed it this way when updating the rest of the frequency specification. This could also be solved by adding an else case after the case thatspec
isNone
. Open to other suggestions.
498 511 logger.debug("load {}".format(item)) 499 512 item.load() 500 513 501 def update(self, _precomp=None, **kwargs): 514 def update(self, **kwargs): mentioned in commit 8356c3d9