Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisión y correcciones del formato MCIL345QH #75

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
- `F5`
- `F5D`
- `MAGCL`
- `MAGCLQH`
- `MCIL345`
- `MCIL345QH`
- `MEDIDAS`
Expand Down
30 changes: 0 additions & 30 deletions mesures/magclqh.py

This file was deleted.

1 change: 0 additions & 1 deletion mesures/mcil345.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def writer(self):
df = (datetime.strptime(daymin, DATE_MASK) + timedelta(days=1)).strftime(DATE_MASK)
self.measures_date = di
dataf = self.file[(self.file['timestamp'] >= di) & (self.file['timestamp'] < df)]
# dataf['timestamp'] = dataf['timestamp'].apply(lambda x: x.strftime(DATETIME_HOUR_MASK))
# Avoid to generate file if dataframe is empty
if len(dataf):
existing_files = os.listdir('/tmp')
Expand Down
5 changes: 3 additions & 2 deletions mesures/mcil345qh.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self, data, distributor=None, compression='bz2', version=0):
self.prefix = 'MCIL345QH'

def reader(self, filepath):
"""Overrided to use DATETIME_HOUR_MASK instead of DATE_MASK"""
if isinstance(filepath, str):
df = pd.read_csv(filepath, sep=';', names=COLUMNS)
elif isinstance(filepath, list):
Expand Down Expand Up @@ -62,7 +63,8 @@ def reader(self, filepath):

def writer(self):
"""
MCIL345 contains hourly generation curves
MCIL345QH contains hourly generation curves
Overrided to use DATETIME_HOUR_MASK instead of DATE_MASK
:return: file path
"""
daymin = self.file['timestamp'].min()
Expand All @@ -74,7 +76,6 @@ def writer(self):
df = (datetime.strptime(daymin, DATETIME_HOUR_MASK) + timedelta(days=1)).strftime(DATETIME_HOUR_MASK)
self.measures_date = di
dataf = self.file[(self.file['timestamp'] >= di) & (self.file['timestamp'] < df)]
# dataf['timestamp'] = dataf['timestamp'].apply(lambda x: x.strftime(DATETIME_HOUR_MASK))
# Avoid to generate file if dataframe is empty
if len(dataf):
existing_files = os.listdir('/tmp')
Expand Down
Loading