Skip to content

Commit 90d1133

Browse files
committed
Merge pull request #43 from wholmgren/timedelta
timedelta and pandas compatibility
2 parents e844d83 + 3659b36 commit 90d1133

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ python:
33
- 2.7
44
- 3.3
55
- 3.4
6+
env:
7+
- PD_VERSION=0.13.1
8+
- PD_VERSION="0.14.*"
9+
- PD_VERSION="0.15.*"
10+
- PD_VERSION="0.16.*"
11+
612
# setup miniconda for numpy, scipy, pandas
713
before_install:
814
- echo "before install"
@@ -19,7 +25,7 @@ before_install:
1925

2026
install:
2127
- echo "install"
22-
- conda install --yes python=$TRAVIS_PYTHON_VERSION numpy scipy pandas nose pytz ephem
28+
- conda install --yes python=$TRAVIS_PYTHON_VERSION numpy scipy pandas=$PD_VERSION nose pytz ephem
2329
- conda install --yes coverage
2430
- pip install coveralls
2531
- python setup.py install

pvlib/irradiance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import logging
1111
pvl_logger = logging.getLogger('pvlib')
1212

13+
import datetime
14+
1315
import numpy as np
1416
import pandas as pd
1517

@@ -167,7 +169,7 @@ def _doy_to_timestamp(doy, epoch='2013-12-31'):
167169
-------
168170
pd.Timestamp
169171
"""
170-
return pd.Timestamp('2013-12-31') + pd.Timedelta(days=float(doy))
172+
return pd.Timestamp('2013-12-31') + datetime.timedelta(days=float(doy))
171173

172174

173175
def aoi_projection(surf_tilt, surf_az, sun_zen, sun_az):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
setuptools_kwargs = {
3333
'zip_safe': False,
3434
'install_requires': ['numpy >= 1.7.0',
35-
'pandas >= 0.15',
35+
'pandas >= 0.13.1',
3636
'pytz',
3737
'six',
3838
'pyephem',

0 commit comments

Comments
 (0)