@@ -62,14 +62,14 @@ def parameters_deserializer(p_json: str):
62
62
values = loads (p_json )
63
63
64
64
dates = {
65
- key : parse_date (values [key ]) if values [key ] else None
65
+ key : parse_date (values [key ]). date () if values [key ] else None
66
66
for key in (
67
67
"current_date" ,
68
68
"date_first_hospitalized" ,
69
69
"mitigation_date" ,
70
70
)
71
71
}
72
- result = Parameters (
72
+ return Parameters (
73
73
current_date = dates ["current_date" ],
74
74
current_hospitalized = values ["current_hospitalized" ],
75
75
hospitalized = Disposition .create (
@@ -85,7 +85,7 @@ def parameters_deserializer(p_json: str):
85
85
doubling_time = values ["doubling_time" ],
86
86
market_share = values ["market_share" ],
87
87
max_y_axis = values ["max_y_axis" ],
88
- mitigation_date = values ["mitigation_date" ],
88
+ mitigation_date = dates ["mitigation_date" ],
89
89
n_days = values ["n_days" ],
90
90
population = values ["population" ],
91
91
recovered = values ["recovered" ],
@@ -97,23 +97,6 @@ def parameters_deserializer(p_json: str):
97
97
),
98
98
)
99
99
100
- # FIXME: parameters should be immutable
101
- # Working around validators in __init__
102
- for key , value in values .items ():
103
-
104
- if result .__dict__ [key ] != value and key not in (
105
- "current_date" ,
106
- "date_first_hospitalized" ,
107
- "dispositions" ,
108
- "hospitalized" ,
109
- "icu" ,
110
- "mitigation_date" ,
111
- "ventilated" ,
112
- ):
113
- result .__dict__ [key ] = value
114
-
115
- return result
116
-
117
100
118
101
def build_csv_download (df ):
119
102
return "data:text/csv;charset=utf-8,{csv}" .format (
0 commit comments