From e24d1b3959e3692a3f69c9bc42ea65092dda5531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20N=C3=B6the?= Date: Tue, 16 May 2017 18:26:50 +0200 Subject: [PATCH 1/2] Add support for columns named "_deg" --- fact/analysis/core.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fact/analysis/core.py b/fact/analysis/core.py index 905137f..ed528b4 100644 --- a/fact/analysis/core.py +++ b/fact/analysis/core.py @@ -10,7 +10,7 @@ ) -off_key_re = re.compile('([a-zA-z1-9]+)_Off_([0-9])') +off_key_re = re.compile('([a-zA-z1-9]+)_Off_([0-9])(_deg)?') def calc_run_summary_source_independent( @@ -108,7 +108,9 @@ def split_on_off_source_independent( off_dfs = [] for region, theta_off_key in enumerate(theta_off_keys, start=1): - off_df = events.query('{} <= {}'.format(theta_off_key, theta_cut)) + off_df = events.query('{} <= {}'.format( + theta_off_key, theta_cut) + ).copy() off_df['off_region'] = region drop_off_columns(off_df, region, inplace=True) @@ -236,8 +238,10 @@ def drop_off_columns(df, off_region, inplace=False): for col in df.columns: m = off_key_re.match(col) if m: - on_key, key_region = m.groups() - # if + on_key, key_region, deg = m.groups() + if deg: + on_key += deg + if int(key_region) == off_region: df.drop(on_key, axis=1, inplace=True) df[on_key] = df[col] From 2458ff73486a77aead5c7e936071b811b252fcff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20N=C3=B6the?= Date: Tue, 16 May 2017 18:28:08 +0200 Subject: [PATCH 2/2] Bump version --- fact/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fact/VERSION b/fact/VERSION index 9b40aa6..9028ec6 100644 --- a/fact/VERSION +++ b/fact/VERSION @@ -1 +1 @@ -0.10.4 +0.10.5