Skip to content

make BudgetItem.freq a property

Kevin Kuns requested to merge kevin.kuns/pygwinc:BudgetItem-freq into master

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

Loading