Skip to content

Commit 91df243

Browse files
committed
Merge pull request #18 from gisce/fix_schema_measures_float
FIX fields.Float() for power measures
2 parents 1102605 + 85c3dd0 commit 91df243

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

sippers/adapters/hidrocantabrico.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class HidrocantabricoMeasuresAdapter(MeasuresAdapter, MeasuresSchema):
108108
@pre_load
109109
def fix_numbers(self, data):
110110
for attr, field in self.fields.iteritems():
111-
if isinstance(field, fields.Integer):
111+
if isinstance(field, (fields.Integer, fields.Float)):
112112
if not data.get(attr):
113113
data[attr] = 0
114114
else:

sippers/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def next(self):
196196
except Exception as exc:
197197
logger.critical(
198198
"Error in %s L:%s: %s %s", self.path, self.stats.line_number,
199-
str(exc), data.get('orig'), exc_info=True
199+
str(exc), line, exc_info=True
200200
)
201201
self.stats.errors.append(
202202
(self.stats.line_number, str(exc))

sippers/models/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ class MeasuresSchema(Schema):
121121
tipo_r5 = fields.String()
122122
reactiva_6 = fields.Integer()
123123
tipo_r6 = fields.String()
124-
potencia_1 = fields.Integer()
124+
potencia_1 = fields.Float()
125125
tipo_p1 = fields.String()
126-
potencia_2 = fields.Integer()
126+
potencia_2 = fields.Float()
127127
tipo_p2 = fields.String()
128-
potencia_3 = fields.Integer()
128+
potencia_3 = fields.Float()
129129
tipo_p3 = fields.String()
130-
potencia_4 = fields.Integer()
130+
potencia_4 = fields.Float()
131131
tipo_p4 = fields.String()
132-
potencia_5 = fields.Integer()
132+
potencia_5 = fields.Float()
133133
tipo_p5 = fields.String()
134-
potencia_6 = fields.Integer()
134+
potencia_6 = fields.Float()
135135
tipo_p6 = fields.String()

0 commit comments

Comments
 (0)