overall quality improvement

This commit is contained in:
Guille Gutierrez 2023-08-08 12:39:37 -04:00
parent 1b3053b37f
commit 527bf4448b
3 changed files with 562 additions and 558 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,8 +23,8 @@ class MonthlyValues:
hour = 0 hour = 0
for month in cte.DAYS_A_MONTH: for month in cte.DAYS_A_MONTH:
total = 0 total = 0
for j in range(0, cte.DAYS_A_MONTH[month]): for _ in range(0, cte.DAYS_A_MONTH[month]):
for k in range(0, 24): for _ in range(0, 24):
total += values[hour] / 24 / cte.DAYS_A_MONTH[month] total += values[hour] / 24 / cte.DAYS_A_MONTH[month]
hour += 1 hour += 1
out.append(total) out.append(total)
@ -42,8 +42,8 @@ class MonthlyValues:
hour = 0 hour = 0
for month in cte.DAYS_A_MONTH: for month in cte.DAYS_A_MONTH:
total = 0 total = 0
for j in range(0, cte.DAYS_A_MONTH[month]): for _ in range(0, cte.DAYS_A_MONTH[month]):
for k in range(0, 24): for _ in range(0, 24):
total += values[hour] total += values[hour]
hour += 1 hour += 1
out.append(total) out.append(total)

View File

@ -15,7 +15,11 @@ def validate_import_export_type(cls_name: type, handler: str):
:param handler: import export handler :param handler: import export handler
:return: None :return: None
""" """
functions = [function[1:] for function in dir(cls_name) if (type(getattr(cls_name, function)) is property or callable(getattr(cls_name, function))) and function in cls_name.__dict__ and function[0] == '_' and function != '__init__'] functions = [
function[1:] for function in dir(cls_name)
if (
isinstance(getattr(cls_name, function), property) or callable(getattr(cls_name, function))
) and function in cls_name.__dict__ and function[0] == '_' and function != '__init__']
if handler.lower() not in functions: if handler.lower() not in functions:
error_message = f'Wrong import type [{handler}]. Valid functions include {functions}' error_message = f'Wrong import type [{handler}]. Valid functions include {functions}'