Skip to content

Commit

Permalink
Issue #249 use warnings.filter_warnings('error') to capture Future wa…
Browse files Browse the repository at this point in the history
…rnings and replace pd.append with pd.concat
  • Loading branch information
bikegeek committed Jan 4, 2023
1 parent 188433c commit 817e2d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions metcalcpy/agg_stat_event_equalize.py
Expand Up @@ -37,6 +37,7 @@
import pandas as pd
import yaml
import numpy as np
import warnings

from metcalcpy import GROUP_SEPARATOR
from metcalcpy.event_equalize import event_equalize
Expand Down Expand Up @@ -93,7 +94,8 @@ def calculate_values(self):

output_ee_data = output_ee_data.drop('equalize', axis=1)
output_ee_data_2 = output_ee_data_2.drop('equalize', axis=1)
all_ee_records = output_ee_data.append(output_ee_data_2).reindex()
warnings.simplefilter(action='error', category=FutureWarning)
all_ee_records = pd.concat([output_ee_data, output_ee_data_2]).reindex()
all_series_vars = {}
for key in self.params['series_val_2']:
all_series_vars[key] = np.unique(self.params['series_val_2'][key]
Expand Down Expand Up @@ -143,7 +145,9 @@ def run_ee_on_axis(self, fix_vals_permuted, axis='1'):
if output_ee_data.empty:
output_ee_data = series_data_after_ee
else:
output_ee_data = output_ee_data.append(series_data_after_ee)
warnings.simplefilter(action="error", category=FutureWarning)
output_ee_data = pd.concat([output_ee_data, series_data_after_ee])

return output_ee_data


Expand Down

0 comments on commit 817e2d3

Please sign in to comment.