Skip to content

Commit 2ea7bfa

Browse files
authored
Merge pull request #52 from kin94der/master
fixed getScaled to reflect CALS API
2 parents 5be9134 + e1a5c5a commit 2ea7bfa

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

examples/PyTimber_Tutorial.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@
184184
"### Scaling algorithms\n",
185185
"\n",
186186
"getScaled can be used to exploit the time scaling functionality of Timber. Specify \n",
187-
"- the scale Interval (an integer) \n",
188-
"- the scaleSize (one of ['SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR']) \n",
187+
"- the scaleSize (an integer) \n",
188+
"- the scaleInterval (one of ['SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR']) \n",
189189
"- the scaling algorithm (one of ['MAX','MIN','AVG','COUNT','SUM','REPEAT','INTERPOLATE'])"
190190
]
191191
},
@@ -266,7 +266,7 @@
266266
],
267267
"source": [
268268
"db.getScaled('MSC01.ZT8.107:COUNTS','2016-08-03 16:30:00.000','2016-08-03 18:30:00.000',\n",
269-
" timescaleAlgorithm='SUM', scaleSize='MINUTE', timescaleInterval='1')"
269+
" scaleAlgorithm='SUM', scaleSize='1', scaleInterval='MINUTE')"
270270
]
271271
},
272272
{

pytimber/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from .pagestore import PageStore
1212

13-
__version__ = "2.4.3"
13+
__version__ = "2.5.0"
1414

1515
__cmmnbuild_deps__ = [
1616
"accsoft-cals-extr-client",

pytimber/pytimber.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def get(self, pattern_or_list, t1, t2=None,
484484
return out
485485

486486
def getScaled(self, pattern_or_list, t1, t2,unixtime=True,
487-
scaleAlgorithm='SUM', scaleSize='MINUTE', scaleInterval='1'):
487+
scaleAlgorithm='SUM', scaleInterval='MINUTE', scaleSize='1'):
488488
"""Query the database for a list of variables or for variables whose
489489
name matches a pattern (string) in a time window from t1 to t2.
490490
@@ -493,11 +493,11 @@ def getScaled(self, pattern_or_list, t1, t2,unixtime=True,
493493
If a fundamental pattern is provided, the end of the time window as to
494494
be explicitely provided.
495495
496-
Applies the scaling with supplied timescaleAlgorithm, scaleSize, timescaleInterval
496+
Applies the scaling with supplied scaleAlgorithm, scaleSize, scaleInterval
497497
"""
498498
ts1 = self.toTimestamp(t1)
499499
ts2 = self.toTimestamp(t2)
500-
timescaling=self.toTimescale([scaleInterval,scaleSize,scaleAlgorithm])
500+
timescaling=self.toTimescale([scaleSize,scaleInterval,scaleAlgorithm])
501501

502502
out = {}
503503
# Build variable list
@@ -520,8 +520,8 @@ def getScaled(self, pattern_or_list, t1, t2,unixtime=True,
520520
except jpype.JavaException as e:
521521
print(e.message())
522522
print('''
523-
timescaleAlgorithm should be one of:{},
524-
timescaleInterval one of:{},
523+
scaleAlgorithm should be one of:{},
524+
scaleInterval one of:{},
525525
scaleSize an integer'''.format(['MAX','MIN','AVG','COUNT','SUM','REPEAT','INTERPOLATE']
526526
,['SECOND', 'MINUTE','HOUR', 'DAY','WEEK','MONTH','YEAR']))
527527
return

tests/test_ldb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
t1 = '2015-05-15 12:00:00.000'
4646
t2 = '2015-05-15 15:00:00.000'
47-
d = ldb.getScaled('MSC01.ZT8.107:COUNTS',t1,t2,scaleSize='HOUR')
47+
d = ldb.getScaled('MSC01.ZT8.107:COUNTS',t1,t2,scaleInterval='HOUR')
4848
print(d)
4949

5050
print('------------------------------------------------------------------------')

0 commit comments

Comments
 (0)