From ed8d9f9c5c41249945256344b3e2a4d34ff5e5fe Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 28 Oct 2021 14:47:13 +0100 Subject: [PATCH] __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 --- pyerrors/pyerrors.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyerrors/pyerrors.py b/pyerrors/pyerrors.py index 3df41b7a..75d1b187 100644 --- a/pyerrors/pyerrors.py +++ b/pyerrors/pyerrors.py @@ -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