Skip to content

Commit e302275

Browse files
authored
Merge pull request #149 from ecobee/dev
adding timezonefinder, bump bleach to 3.3.0, add pytest-profiling
2 parents 8096b13 + b5cb14b commit e302275

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"**/Output_EPExport_Slave": true,
2828
"**/Output_EPExport_Test FMI 1.0 CS": true,
2929
"**/test/data": true,
30-
"external": true
30+
"external": true,
31+
"bcs_venv": true,
3132
},
3233
"python.linting.pylintEnabled": false,
3334
"python.linting.flake8Enabled": true,

requirements.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Babel==2.9.0
99
backcall==0.2.0
1010
beautifulsoup4==4.8.0
1111
black==20.8b1
12-
bleach==3.2.1
12+
bleach==3.3.0
1313
Bottleneck==1.3.2
1414
cachetools==4.2.0
1515
casadi==3.5.5
@@ -112,6 +112,7 @@ pyparsing==2.4.7
112112
pyrsistent==0.17.3
113113
pytest==6.2.1
114114
pytest-ordering==0.6
115+
pytest-profiling==1.7.0
115116
python-dateutil==2.8.1
116117
pytz==2020.5
117118
PyYAML==5.4
@@ -148,7 +149,7 @@ traitlets==5.0.5
148149
typed-ast==1.4.2
149150
typing-extensions==3.7.4.3
150151
typing-inspect==0.6.0
151-
tzwhere==3.0.3
152+
timezonefinder==5.2.0
152153
urllib3==1.26.2
153154
wcwidth==0.2.5
154155
webencodings==0.5.1

requirements_unfixed.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ google-cloud-bigquery==2.3.1
22
jupyterlab==2.2.9
33
pytest
44
pytest-ordering
5+
pytest-profiling
56
black
67
coverage
78
sphinx
@@ -28,7 +29,7 @@ dask
2829
requests
2930
scikit-learn
3031
statsmodels
31-
tzwhere
32+
timezonefinder
3233
numexpr
3334
bottleneck
3435
casadi

src/python/BuildingControlsSimulator/DataClients/DateTimeChannel.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# created by Tom Stesco tom.s@ecobee.com
22
import logging
3-
from pprint import pprint
43
import pytz
54

6-
from tzwhere import tzwhere
5+
from timezonefinder import TimezoneFinder
6+
77
import attr
88
import pandas as pd
99

@@ -33,11 +33,7 @@ def timezone(self):
3333
@staticmethod
3434
def get_timezone(latitude, longitude):
3535
"""Get pytz timezone object given latitude and longitude."""
36-
tzw = tzwhere.tzwhere(forceTZ=True)
36+
tf = TimezoneFinder()
3737
return pytz.timezone(
38-
tzw.tzNameAt(
39-
latitude=latitude,
40-
longitude=longitude,
41-
forceTZ=True,
42-
)
38+
tf.timezone_at(lng=longitude, lat=latitude)
4339
)

0 commit comments

Comments
 (0)