__slots__ with __dict__ added to Obs

Memory consumption for an average Obs reduced by another 5%
Consider also dropping __dict__ for another 120 bytes per object
This commit is contained in:
Fabian Joswig 2021-10-28 14:47:13 +01:00
parent 2d35785087
commit ed8d9f9c5c

View file

@ -34,11 +34,11 @@ class Obs:
ensemble.
N_sigma_global -- Standard value for N_sigma (default 1.0)
"""
# __slots__ = ['names', 'shape', 'r_values', 'deltas', 'N', '_value', '_dvalue',
# 'ddvalue', 'reweighted', 'S', 'tau_exp', 'N_sigma', 'e_names',
# 'e_content', 'e_dvalue', 'e_ddvalue', 'e_tauint', 'e_dtauint',
# 'e_windowsize', 'e_rho', 'e_drho', 'e_n_tauint', 'e_n_dtauint',
# 'tag']
__slots__ = ['names', 'shape', 'r_values', 'deltas', 'N', '_value', '_dvalue',
'ddvalue', 'reweighted', 'S', 'tau_exp', 'N_sigma', 'e_names',
'e_content', 'e_dvalue', 'e_ddvalue', 'e_tauint', 'e_dtauint',
'e_windowsize', 'e_rho', 'e_drho', 'e_n_tauint', 'e_n_dtauint',
'tag', '__dict__']
e_tag_global = 0
S_global = 2.0