diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0a5bb88..4edcd7a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,2 +1,2 @@ [bumpversion] -current_version = 3.1.7 +current_version = 3.1.8 diff --git a/mesures/__init__.py b/mesures/__init__.py index 38aa401..1377800 100644 --- a/mesures/__init__.py +++ b/mesures/__init__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = '3.1.7' +__version__ = '3.1.8' __author__ = 'GISCE-TI S.L.' diff --git a/mesures/f5d.py b/mesures/f5d.py index 24c19bb..42f9360 100644 --- a/mesures/f5d.py +++ b/mesures/f5d.py @@ -10,7 +10,7 @@ TYPES = DTYPES.copy() TYPES.update({'factura': 'category'}) ENERGY_MAGNS = ['ai', 'ae', 'r1', 'r2', 'r3', 'r4'] -CNMC_ENERGY_MAGNS = ['ai_fix', 'ao_fix'] +CNMC_ENERGY_MAGNS = ['ai_fix', 'ae_fix'] class F5D(F5): def __init__(self, data, file_format='REE', distributor=None, comer=None, compression='bz2', columns=COLUMNS, dtypes=TYPES, version=0): @@ -58,11 +58,11 @@ def ai_fix(self): return res @property - def ao_fix(self): + def ae_fix(self): if not self.file_format == 'CNMC': res = 0 else: - res = int(self.file['ao_fix'].sum()) + res = int(self.file['ae_fix'].sum()) return res def cut_by_dates(self, di, df): @@ -89,7 +89,7 @@ def reader(self, filepath): agregates = {'ai': 'sum', 'ae': 'sum', 'r1': 'sum', 'r2': 'sum', 'r3': 'sum', 'r4': 'sum'} if self.file_format == 'CNMC': - agregates.update({'ai_fix': 'sum', 'ao_fix': 'sum'}) + agregates.update({'ai_fix': 'sum', 'ae_fix': 'sum'}) df = df.groupby(['cups', 'timestamp', 'season', 'firmeza', 'method', 'factura']).aggregate( agregates).reset_index() diff --git a/spec/generation_files_spec.py b/spec/generation_files_spec.py index a79da3c..74b47fc 100644 --- a/spec/generation_files_spec.py +++ b/spec/generation_files_spec.py @@ -320,7 +320,7 @@ def get_sample_f5d_data(file_format='REE'): 'invoice_number': 'FE20214444' } if file_format == 'CNMC': - basic_f5d.update({'ao_fix': 1000, 'ai_fix': 1000}) + basic_f5d.update({'ae_fix': 1000, 'ai_fix': 1000}) data_f5d = [basic_f5d.copy()] ts = "2020-01-01 01:00:00" for x in range(50): @@ -1015,7 +1015,7 @@ def get_sample_obcups_data(): f = F5D(data, file_format='CNMC') res = f.writer() assert isinstance(f.ai_fix, (int, np.int64)) - assert isinstance(f.ao_fix, (int, np.int64)) + assert isinstance(f.ae_fix, (int, np.int64)) with it('with CNMC format gets expected content'): data = SampleData().get_sample_f5d_data(file_format='CNMC')