forked from s_ranjbar/city_retrofit
overall quality improvement
This commit is contained in:
parent
1b3053b37f
commit
527bf4448b
File diff suppressed because it is too large
Load Diff
|
@ -23,8 +23,8 @@ class MonthlyValues:
|
|||
hour = 0
|
||||
for month in cte.DAYS_A_MONTH:
|
||||
total = 0
|
||||
for j in range(0, cte.DAYS_A_MONTH[month]):
|
||||
for k in range(0, 24):
|
||||
for _ in range(0, cte.DAYS_A_MONTH[month]):
|
||||
for _ in range(0, 24):
|
||||
total += values[hour] / 24 / cte.DAYS_A_MONTH[month]
|
||||
hour += 1
|
||||
out.append(total)
|
||||
|
@ -42,8 +42,8 @@ class MonthlyValues:
|
|||
hour = 0
|
||||
for month in cte.DAYS_A_MONTH:
|
||||
total = 0
|
||||
for j in range(0, cte.DAYS_A_MONTH[month]):
|
||||
for k in range(0, 24):
|
||||
for _ in range(0, cte.DAYS_A_MONTH[month]):
|
||||
for _ in range(0, 24):
|
||||
total += values[hour]
|
||||
hour += 1
|
||||
out.append(total)
|
||||
|
|
|
@ -15,7 +15,11 @@ def validate_import_export_type(cls_name: type, handler: str):
|
|||
:param handler: import export handler
|
||||
: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:
|
||||
error_message = f'Wrong import type [{handler}]. Valid functions include {functions}'
|
||||
|
|
Loading…
Reference in New Issue
Block a user