Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rdemaria/pytimber
Browse files Browse the repository at this point in the history
  • Loading branch information
rdemaria committed Jul 24, 2017
2 parents 057951c + 2ea7bfa commit 29e9dae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions examples/PyTimber_Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@
"### Scaling algorithms\n",
"\n",
"getScaled can be used to exploit the time scaling functionality of Timber. Specify \n",
"- the scale Interval (an integer) \n",
"- the scaleSize (one of ['SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR']) \n",
"- the scaleSize (an integer) \n",
"- the scaleInterval (one of ['SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR']) \n",
"- the scaling algorithm (one of ['MAX','MIN','AVG','COUNT','SUM','REPEAT','INTERPOLATE'])"
]
},
Expand Down Expand Up @@ -266,7 +266,7 @@
],
"source": [
"db.getScaled('MSC01.ZT8.107:COUNTS','2016-08-03 16:30:00.000','2016-08-03 18:30:00.000',\n",
" timescaleAlgorithm='SUM', scaleSize='MINUTE', timescaleInterval='1')"
" scaleAlgorithm='SUM', scaleSize='1', scaleInterval='MINUTE')"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion pytimber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from .pagestore import PageStore

__version__ = "2.4.3"
__version__ = "2.5.0"

__cmmnbuild_deps__ = [
"accsoft-cals-extr-client",
Expand Down
10 changes: 5 additions & 5 deletions pytimber/pytimber.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def get(self, pattern_or_list, t1, t2=None,
return out

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

out = {}
# Build variable list
Expand All @@ -523,8 +523,8 @@ def getScaled(self, pattern_or_list, t1, t2,unixtime=True,
except jpype.JavaException as e:
print(e.message())
print('''
timescaleAlgorithm should be one of:{},
timescaleInterval one of:{},
scaleAlgorithm should be one of:{},
scaleInterval one of:{},
scaleSize an integer'''.format(['MAX','MIN','AVG','COUNT','SUM','REPEAT','INTERPOLATE']
,['SECOND', 'MINUTE','HOUR', 'DAY','WEEK','MONTH','YEAR']))
return
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

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

print('------------------------------------------------------------------------')
Expand Down

0 comments on commit 29e9dae

Please sign in to comment.