Skip to content

Commit 5e14be2

Browse files
author
sreeder
committed
update data values query
1 parent 7c5ba67 commit 5e14be2

File tree

3 files changed

+113
-73
lines changed

3 files changed

+113
-73
lines changed

src/Examples/Sample 1.1.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,17 @@
7474

7575
print
7676
print "************************************************"
77-
print "\t\tData Values: get_all_series()"
77+
print "\t\tSeries: get_all_series()"
7878
print "************************************************"
7979
print
8080

81-
pp.pprint(odm1service.get_series_by_id(1))
81+
ser = odm1service.get_series_by_id(1)
82+
pp.pprint(ser)
83+
ser = odm1service.get_series_by_id(173)
84+
pp.pprint(ser)
85+
if ser:
86+
print ser.variable
87+
8288

8389
print
8490
print "************************************************"
@@ -87,6 +93,7 @@
8793
print
8894

8995
pp.pprint(odm1service.get_values_by_series(1))
96+
pp.pprint(odm1service.get_values_by_series(173))
9097
print "The end"
9198

9299

src/api/ODM1_1_1/services/series_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,12 @@ def get_plot_values(self, seriesID, noDataValue, startDate = None, endDate = Non
406406
:return:
407407
"""
408408
series = self.get_series_by_id(seriesID)
409+
values = self.get_values_by_series(seriesID)
409410

410411
DataValues = [
411412
(dv.data_value, dv.local_date_time, dv.censor_code, dv.local_date_time.strftime('%m'),
412413
dv.local_date_time.strftime('%Y'))
413-
for dv in series.data_values
414+
for dv in values
414415
if dv.data_value != noDataValue if dv.local_date_time >= startDate if dv.local_date_time <= endDate
415416
]
416417
data = pd.DataFrame(DataValues, columns=["DataValue", "LocalDateTime", "CensorCode", "Month", "Year"])

0 commit comments

Comments
 (0)