Skip to content

Commit ecff8a8

Browse files
committed
fix: fix some smaller bugs
1 parent 490c3e0 commit ecff8a8

4 files changed

Lines changed: 623 additions & 624 deletions

File tree

frost_sta_client/model/datastream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def observed_area(self):
146146
@observed_area.setter
147147
def observed_area(self, value):
148148
if value is None:
149-
self._location = None
149+
self._observed_area = None
150150
return
151151
geo_classes = [obj for _, obj in inspect.getmembers(geojson) if inspect.isclass(obj) and
152152
obj.__module__ == 'geojson.geometry']
Lines changed: 67 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,67 @@
1-
# Copyright (C) 2021 Fraunhofer Institut IOSB, Fraunhoferstr. 1, D 76131
2-
# Karlsruhe, Germany.
3-
#
4-
# This program is free software: you can redistribute it and/or modify
5-
# it under the terms of the GNU Lesser General Public License as published by
6-
# the Free Software Foundation, either version 3 of the License, or
7-
# (at your option) any later version.
8-
#
9-
# This program is distributed in the hope that it will be useful,
10-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
# GNU Lesser General Public License for more details.
13-
#
14-
# You should have received a copy of the GNU Lesser General Public License
15-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
from .data_array_value import DataArrayValue
17-
18-
19-
class DataArrayDocument:
20-
def __init__(self, count=-1, next_link = None, value=None):
21-
if value is None:
22-
value = []
23-
self._count = count
24-
self._next_link = next_link
25-
self._value = value
26-
27-
@property
28-
def count(self):
29-
return self._count
30-
31-
@count.setter
32-
def count(self, value):
33-
if type(value) == int or value is None:
34-
self._count = value
35-
else:
36-
raise TypeError('count should be of type int')
37-
38-
@property
39-
def next_link(self):
40-
return self._next_link
41-
42-
@next_link.setter
43-
def next_link(self, value):
44-
if type(value) == str or value is None:
45-
self._next_link = value
46-
else:
47-
raise TypeError('nextLink should be of type str')
48-
49-
@property
50-
def value(self):
51-
return self._value
52-
53-
@value.setter
54-
def value(self, value):
55-
if type(value) == list and all(isinstance(x, DataArrayValue) for x in value):
56-
self._value = value
57-
else:
58-
raise TypeError('value should be a list of type DataArrayValue')
59-
60-
def get_observations(self):
61-
obs_list = []
62-
for dav in self.value:
63-
obs_list.concat(dav.get_observations())
64-
return obs_list
65-
66-
def add_data_array_value(self, dav):
67-
self.value.append(dav)
68-
1+
# Copyright (C) 2021 Fraunhofer Institut IOSB, Fraunhoferstr. 1, D 76131
2+
# Karlsruhe, Germany.
3+
#
4+
# This program is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU Lesser General Public License as published by
6+
# the Free Software Foundation, either version 3 of the License, or
7+
# (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public License
15+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
from .data_array_value import DataArrayValue
17+
18+
19+
class DataArrayDocument:
20+
def __init__(self, count=-1, next_link = None, value=None):
21+
if value is None:
22+
value = []
23+
self._count = count
24+
self._next_link = next_link
25+
self._value = value
26+
27+
@property
28+
def count(self):
29+
return self._count
30+
31+
@count.setter
32+
def count(self, value):
33+
if type(value) == int or value is None:
34+
self._count = value
35+
else:
36+
raise TypeError('count should be of type int')
37+
38+
@property
39+
def next_link(self):
40+
return self._next_link
41+
42+
@next_link.setter
43+
def next_link(self, value):
44+
if type(value) == str or value is None:
45+
self._next_link = value
46+
else:
47+
raise TypeError('nextLink should be of type str')
48+
49+
@property
50+
def value(self):
51+
return self._value
52+
53+
@value.setter
54+
def value(self, value):
55+
if type(value) == list and all(isinstance(x, DataArrayValue) for x in value):
56+
self._value = value
57+
else:
58+
raise TypeError('value should be a list of type DataArrayValue')
59+
60+
def get_observations(self):
61+
obs_list = []
62+
for dav in self.value:
63+
obs_list.extend(dav.observations)
64+
return obs_list
65+
66+
def add_data_array_value(self, dav):
67+
self.value.append(dav)

0 commit comments

Comments
 (0)