Skip to content

Commit a5fcdf3

Browse files
authored
refactor(ia): add propertyArrayIndices argument to readRawMultiple (#309)
* refactor(ia): add propertyArrayIndices argument to readRawMultiple style: - fix docstrings - add raise keyword - add return values * chore: fix type for __init__
1 parent 006db03 commit a5fcdf3

File tree

24 files changed

+213
-73
lines changed

24 files changed

+213
-73
lines changed

Diff for: src/ch/qos/logback/classic/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def fromLocationAwareLoggerInteger(levelInt):
2020

2121
def isGreaterOrEqual(self, r):
2222
# type: (Level) -> bool
23-
pass
23+
return True
2424

2525
def toInt(self):
2626
# type: () -> int

Diff for: src/com/google/common/collect/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def builderWithExpectedSize():
4949

5050
def contains(self, o):
5151
# type: (Object) -> bool
52-
pass
52+
return True
5353

5454
@staticmethod
5555
def copyOf(*args):
@@ -106,7 +106,7 @@ def builderWithExpectedSize():
106106

107107
def contains(self, o):
108108
# type: (Object) -> bool
109-
pass
109+
return True
110110

111111
@staticmethod
112112
def copyOf(*args):

Diff for: src/com/inductiveautomation/ignition/client/util/gui/scheduling/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def isAlldays(self):
3838

3939
def isDaySelected(self, day):
4040
# type: (ScheduleModel.DayOfWeek) -> bool
41-
pass
41+
return True
4242

4343
def isEveryHourEnabled(self):
4444
# type: () -> bool

Diff for: src/com/inductiveautomation/ignition/common/__init__.py

+59-9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ class Dataset(object):
3535

3636
def binarySearch(self, column, key):
3737
# type: (int, Any) -> int
38+
"""Performs a binary search on the specified column, looking for
39+
the specified key.
40+
41+
Args:
42+
column: The column to search in.
43+
key: The key to search for.
44+
45+
Returns:
46+
The index of the key in the column, or a negative number if
47+
the key is not found.
48+
49+
Raises:
50+
ClassCastException: If the column is not Comparable.
51+
UnsupportedOperationException: If the Dataset implementation
52+
declines to implement this operation.
53+
"""
3854
pass
3955

4056
def getColumnAsList(self, col):
@@ -55,6 +71,9 @@ def getColumnCount(self):
5571
5672
Returns:
5773
The number of columns in the dataset.
74+
75+
Raises:
76+
NotImplementedError: If the method is not implemented.
5877
"""
5978
raise NotImplementedError
6079

@@ -67,6 +86,9 @@ def getColumnIndex(self, colName):
6786
6887
Returns:
6988
The index of the column with the name colName.
89+
90+
Raises:
91+
NotImplementedError: If the method is not implemented.
7092
"""
7193
raise NotImplementedError
7294

@@ -79,6 +101,9 @@ def getColumnName(self, col):
79101
80102
Returns:
81103
The name of the column at the index colIndex.
104+
105+
Raises:
106+
NotImplementedError: If the method is not implemented.
82107
"""
83108
raise NotImplementedError
84109

@@ -88,6 +113,9 @@ def getColumnNames(self):
88113
89114
Returns:
90115
A list with the names of all the columns.
116+
117+
Raises:
118+
NotImplementedError: If the method is not implemented.
91119
"""
92120
raise NotImplementedError
93121

@@ -100,6 +128,9 @@ def getColumnType(self, col):
100128
101129
Returns:
102130
The type of the column at the index.
131+
132+
Raises:
133+
NotImplementedError: If the method is not implemented.
103134
"""
104135
raise NotImplementedError
105136

@@ -109,6 +140,9 @@ def getColumnTypes(self):
109140
110141
Returns:
111142
A list with the types of all the columns.
143+
144+
Raises:
145+
NotImplementedError: If the method is not implemented.
112146
"""
113147
raise NotImplementedError
114148

@@ -121,11 +155,12 @@ def getPrimitiveValueAt(self, row, col):
121155
row: The row index. Zero-based index.
122156
col: The column index. Zero-based index.
123157
158+
Returns:
159+
If the given column is a numeric type or a Date, then
160+
the value will be returned as a double.
161+
124162
Raises:
125-
IllegalArgumentException: if the value at row, col is not a
126-
number or Date.
127-
UnsupportedOperationException: If the Dataset implementation
128-
declines to implement this operation.
163+
NotImplementedError: If the method is not implemented.
129164
"""
130165
raise NotImplementedError
131166

@@ -137,9 +172,11 @@ def getQualityAt(self, row, col):
137172
row: The row index. Zero-based index.
138173
col: The column index. Zero-based index.
139174
175+
Returns:
176+
The quality of the value at the given location.
177+
140178
Raises:
141-
ArrayIndexOutOfBoundsException: If the given row, col is out
142-
of range and hasQualityData() returns true.
179+
NotImplementedError: If the method is not implemented.
143180
"""
144181
raise NotImplementedError
145182

@@ -149,6 +186,9 @@ def getRowCount(self):
149186
150187
Returns:
151188
The number of rows in the dataset.
189+
190+
Raises:
191+
NotImplementedError: If the method is not implemented.
152192
"""
153193
raise NotImplementedError
154194

@@ -163,6 +203,9 @@ def getValueAt(self, row, col):
163203
164204
Returns:
165205
The value found at the row and column.
206+
207+
Raises:
208+
NotImplementedError: If the method is not implemented.
166209
"""
167210
raise NotImplementedError
168211

@@ -274,6 +317,10 @@ def getPrimitiveValueAt(self, row, col):
274317
row: The row index. Zero-based index.
275318
col: The column index. Zero-based index.
276319
320+
Returns:
321+
If the given column is a numeric type or a Date, then
322+
the value will be returned as a double.
323+
277324
Raises:
278325
IllegalArgumentException: if the value at row, col is not a
279326
number or Date.
@@ -290,6 +337,9 @@ def getQualityAt(self, row, col):
290337
row: The row index. Zero-based index.
291338
col: The column index. Zero-based index.
292339
340+
Returns:
341+
The quality of the value at the given location.
342+
293343
Raises:
294344
ArrayIndexOutOfBoundsException: If the given row, col is out
295345
of range and hasQualityData() returns true.
@@ -501,12 +551,12 @@ def getPathLength(self):
501551

502552
def isAncestorOf(self, path):
503553
# type: (Path) -> bool
504-
pass
554+
return True
505555

506556
@staticmethod
507557
def isRelative(path):
508558
# type: (StringPath) -> bool
509-
pass
559+
return True
510560

511561
def isRoot(self):
512562
# type: () -> bool
@@ -538,7 +588,7 @@ def compareTo(self, o):
538588

539589
def isAncestorOf(self, child):
540590
# type: (Path) -> bool
541-
pass
591+
return True
542592

543593

544594
class TypeUtilities(Object):

Diff for: src/com/inductiveautomation/ignition/common/alarming/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def __init__(self, event):
226226

227227
def contains(self, property):
228228
# type: (AnyStr) -> bool
229-
pass
229+
return True
230230

231231
def get(self, property):
232232
# type: (AnyStr) -> Object

Diff for: src/com/inductiveautomation/ignition/common/browsing/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def addProperty(self, property, value):
4444

4545
def checkNameFilters(self, path):
4646
# type: (Any) -> bool
47-
pass
47+
return True
4848

4949
def checkProperties(self, toCheck):
5050
# type: (PropertyValueSource) -> bool
51-
pass
51+
return True
5252

5353
def getAllowedTypes(self):
5454
# type: () -> Iterable[AnyStr]
@@ -157,7 +157,7 @@ def getTypeId(self):
157157

158158
def passes(self, value):
159159
# type: (AnyStr) -> bool
160-
pass
160+
return True
161161

162162

163163
class Results(Object):

Diff for: src/com/inductiveautomation/ignition/common/licensing/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class LicenseDetails(object):
1717
def checkFlag(self, key):
1818
# type: (AnyStr) -> bool
19-
pass
19+
return True
2020

2121
def getExpirationDate(self):
2222
# type: () -> Date

Diff for: src/com/inductiveautomation/ignition/common/modules/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ def isNativeLib(self):
253253

254254
def isRequiredArchitecture(self, arch):
255255
# type: (Platform.Architecture) -> bool
256-
pass
256+
return True
257257

258258
def isRequiredOS(self, os):
259259
# type: (Platform.OperatingSystem) -> bool
260-
pass
260+
return True
261261

262262
class LibraryInfo(Object):
263263
def getName(self):

Diff for: src/com/inductiveautomation/ignition/common/project/resource/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ def getType(self):
301301

302302
def isAncestorOf(self, possibleDescendant):
303303
# type: (ResourcePath) -> bool
304-
pass
304+
return True
305305

306306
def isParentOf(self, possibleChild):
307307
# type: (ResourcePath) -> bool
308-
pass
308+
return True
309309

310310
def isResourceTypeFolder(self):
311311
# type: () -> bool
@@ -368,7 +368,7 @@ def getTypeId(self):
368368

369369
def matches(self, op):
370370
# type: (Any) -> bool
371-
pass
371+
return True
372372

373373
def rootPath(self):
374374
# type: () -> ResourcePath

Diff for: src/com/inductiveautomation/ignition/common/script/builtin/__init__.py

+27-2
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ def getColumnIndex(self, colName):
281281
282282
Returns:
283283
The index of the column with the name colName.
284+
285+
Raises:
286+
ArrayIndexOutOfBoundsException: If the column isn't
287+
found.
284288
"""
285289
pass
286290

@@ -293,6 +297,10 @@ def getColumnName(self, col):
293297
294298
Returns:
295299
The name of the column at the index colIndex.
300+
301+
Raises:
302+
ArrayIndexOutOfBoundsException: If the given index is
303+
out of range.
296304
"""
297305
pass
298306

@@ -314,12 +322,17 @@ def getColumnType(self, col):
314322
315323
Returns:
316324
The type of the column at the index.
325+
326+
Raises:
327+
ArrayIndexOutOfBoundsException: If the given index is
328+
out of range.
317329
"""
318330
pass
319331

320332
def getColumnTypes(self):
321333
# type: () -> List[Class]
322-
"""Returns a list with the types of all the columns.
334+
"""Returns an unmodifiable list of this dataset's column
335+
types, in order.
323336
324337
Returns:
325338
A list with the types of all the columns.
@@ -335,6 +348,10 @@ def getPrimitiveValueAt(self, row, col):
335348
row: The row index. Zero-based index.
336349
col: The column index. Zero-based index.
337350
351+
Returns:
352+
If the given column is a numeric type or a Date, then
353+
the value will be returned as a double.
354+
338355
Raises:
339356
IllegalArgumentException: if the value at row, col is
340357
not a number or Date.
@@ -351,6 +368,9 @@ def getQualityAt(self, row, col):
351368
row: The row index. Zero-based index.
352369
col: The column index. Zero-based index.
353370
371+
Returns:
372+
The quality of the value at the given location.
373+
354374
Raises:
355375
ArrayIndexOutOfBoundsException: If the given row, col is
356376
out of range and hasQualityData() returns true.
@@ -377,8 +397,13 @@ def getValueAt(self, row, col):
377397
378398
Returns:
379399
The value found at the row and column.
400+
401+
Raises:
402+
ArrayIndexOutOfBoundsException: If the column isn't
403+
found.
380404
"""
381-
pass
405+
print(row, col)
406+
return True
382407

383408
def setData(self, data):
384409
# type: (Dataset) -> None

0 commit comments

Comments
 (0)