Skip to content

Commit

Permalink
adding look up table
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulworld committed Jul 22, 2018
1 parent f75a62b commit 14f9641
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions istsos/plugins/unit_con_post/lookUpTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
class LookUpTable(object):
def findLookUp(self, unit):
for key, value in lookups.items():
if str(unit).lower() in (n.lower() for n in value):
return key
if str(unit).lower() in (n.lower() for n in value):
return key
return(unit)


a=LookUpTable()
print('hello world')
print(a.findLookUp("degF"))
print(a.findLookUp("deg-F"))
# print(findLookUp1("degF"))
Binary file not shown.
5 changes: 5 additions & 0 deletions istsos/plugins/unit_con_post/retrievers/aiopg/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"°C":["°C", "celcius", "degree Celsius", "degree-celsius", "degree-celsius", "degree", "degree centigrade", "degcelsius", "degC"],
"°F":["°F", "fahrenheit", "degfahrenheit", "degF", "degfahrenheit", "degree-fahrenheit", "degree fahrenheit"],
"°K":["°K", "kelvin", "degK", "tempK"],
"°R":["°R", "Rankine", "°Ra"],
"°De":["°De", "Delisle"],
"°N":["°N", "Newton"],
"°N":["°N", "Newton"],
}

import asyncio
Expand Down Expand Up @@ -78,6 +82,7 @@ def findLookUp(self, unit):
for key, value in lookups.items():
if str(unit).lower() in (n.lower() for n in value):
return key
return(unit)

@asyncio.coroutine
def __get_array_2(self, offerings, request):
Expand Down

0 comments on commit 14f9641

Please sign in to comment.