Skip to content

Commit c5e7cde

Browse files
committed
replace freq string H and S with lower case string
1 parent d6f4662 commit c5e7cde

File tree

10 files changed

+29
-29
lines changed

10 files changed

+29
-29
lines changed

documentation/composite_signal.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ the PerformanceMonitoring object.
3636
>>> import numpy as np
3737
>>> import pecos
3838
>>> pm = pecos.monitoring.PerformanceMonitoring()
39-
>>> index = pd.date_range('1/1/2017', periods=24, freq='H')
39+
>>> index = pd.date_range('1/1/2017', periods=24, freq='h')
4040
>>> data = {'A': np.arange(24)}
4141
>>> df = pd.DataFrame(data, index=index)
4242
>>> pm.add_dataframe(df)

documentation/metrics.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To compute QCI,
3131
>>> import numpy as np
3232
>>> import pecos
3333
>>> pm = pecos.monitoring.PerformanceMonitoring()
34-
>>> index = pd.date_range('1/1/2017', periods=24, freq='H')
34+
>>> index = pd.date_range('1/1/2017', periods=24, freq='h')
3535
>>> data = {'A': np.arange(24)}
3636
>>> df = pd.DataFrame(data, index=index)
3737
>>> pm.add_dataframe(df)

documentation/timefilter.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The following example defines a time filter between 3 AM and 9 PM,
1616
>>> import numpy as np
1717
>>> import pecos
1818
>>> pm = pecos.monitoring.PerformanceMonitoring()
19-
>>> index = pd.date_range('1/1/2017', periods=24, freq='H')
19+
>>> index = pd.date_range('1/1/2017', periods=24, freq='h')
2020
>>> data = {'A': np.arange(24)}
2121
>>> df = pd.DataFrame(data, index=index)
2222
>>> pm.add_dataframe(df)

examples/dashboard/dashboard_example_1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
# Populate the object with a dataframe and translation dictionary
4242
# In this example, fake data is generated using a sin wave function
43-
index = pd.date_range(analysis_date, periods=24, freq='H')
43+
index = pd.date_range(analysis_date, periods=24, freq='h')
4444
data=np.sin(np.random.rand(3,1)*np.arange(0,24,1))
4545
df = pd.DataFrame(data=data.transpose(), index=index, columns=['A', 'B', 'C'])
4646
pm.add_dataframe(df)

pecos/tests/test_graphics.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_plot_timeseries1(self):
6767
os.remove(filename)
6868

6969
periods = 5
70-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
70+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
7171
data = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15]])
7272
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
7373

@@ -84,7 +84,7 @@ def test_plot_timeseries2(self):
8484
os.remove(filename)
8585

8686
periods = 5
87-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
87+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
8888
data = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15]])
8989
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
9090
tfilter = pd.Series(data = (df.index < index[3]), index = df.index)
@@ -147,7 +147,7 @@ def test_plot_doy_heatmap1(self):
147147
os.remove(filename)
148148

149149
periods = 5*24 # 5 days
150-
index = pd.date_range('3/1/2016', periods=periods, freq='H')
150+
index = pd.date_range('3/1/2016', periods=periods, freq='h')
151151
data = np.random.rand(periods)
152152
df = pd.DataFrame(data=data, index=index, columns=['A'])
153153

@@ -164,7 +164,7 @@ def test_plot_doy_heatmap2(self):
164164
os.remove(filename)
165165

166166
periods = 365*12
167-
index = pd.date_range('1/1/2016', periods=periods, freq='2H')
167+
index = pd.date_range('1/1/2016', periods=periods, freq='2h')
168168
data = np.random.rand(periods)
169169
df = pd.DataFrame(data=data, index=index, columns=['A'])
170170
overlay = pd.DataFrame(index=[1,100,200,300,365],
@@ -191,7 +191,7 @@ def test_plot_test_results2(self):
191191
filename_root = abspath(join(testdir, 'plot_test_results2'))
192192
pm = pecos.monitoring.PerformanceMonitoring()
193193
periods = 5
194-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
194+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
195195
data = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15]])
196196
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
197197
tfilter = pd.Series(data = (df.index < index[3]), index = df.index)

pecos/tests/test_io.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_write_test_results1(self):
5454

5555
pm = pecos.monitoring.PerformanceMonitoring()
5656
periods = 5
57-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
57+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
5858
data = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15]])
5959
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
6060
tfilter = pd.Series(data = (df.index < index[3]), index = df.index)
@@ -95,7 +95,7 @@ def test_write_monitoring_report2(self):# with test results and graphics (encode
9595

9696
pm = pecos.monitoring.PerformanceMonitoring()
9797
periods = 5
98-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
98+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
9999
data = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15]])
100100
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
101101
tfilter = pd.Series(data = (df.index < index[3]), index = df.index)

pecos/tests/test_metrics.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class TestMetrics(unittest.TestCase):
1414

1515
def test_pd_far(self):
16-
index = pd.date_range('1/1/2016', periods=4, freq='H')
16+
index = pd.date_range('1/1/2016', periods=4, freq='h')
1717

1818
actual = np.array([[True, False, False],
1919
[False, False, True],
@@ -40,7 +40,7 @@ def test_pd_far(self):
4040

4141
def test_integral(self):
4242
periods = 5
43-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
43+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
4444
data = np.array([[1,2,3], [4,4,3], [7,6,np.nan], [4,8,4], [1,8.5,6]])
4545
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
4646

@@ -63,7 +63,7 @@ def test_integral(self):
6363

6464
def test_derivative(self):
6565
periods = 5
66-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
66+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
6767
data = np.array([[1,2,3], [4,4,3], [7,6,np.nan], [4,8,4], [1,8.5,6]])
6868
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
6969

@@ -96,7 +96,7 @@ def test_derivative(self):
9696
def test_qci_no_test_results(self):
9797
periods = 5
9898
np.random.seed(100)
99-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
99+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
100100
data=np.sin(np.random.rand(3,1)*np.arange(0,periods,1))
101101
df = pd.DataFrame(data=data.transpose(), index=index, columns=['A', 'B', 'C'])
102102
trans = dict(zip(df.columns, [[col] for col in df.columns]))
@@ -116,7 +116,7 @@ def test_qci_no_test_results(self):
116116
def test_qci_with_test_results(self):
117117
periods = 5
118118
np.random.seed(100)
119-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
119+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
120120
data=np.sin(np.random.rand(3,1)*np.arange(0,periods,1))
121121
df = pd.DataFrame(data=data.transpose(), index=index, columns=['A', 'B', 'C'])
122122
trans = dict(zip(df.columns, [[col] for col in df.columns]))
@@ -158,7 +158,7 @@ def test_qci_with_test_results(self):
158158
def test_rmse(self):
159159

160160
periods = 5
161-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
161+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
162162
x1 = pd.DataFrame(data=np.array([4, 4, 4.5, 2.7, 6]), index=index, columns=['Power'])
163163
x2 = pd.DataFrame(data=np.array([5,10,4.5,3,4]), index=index, columns=['Power'])
164164

pecos/tests/test_monitoring.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class Test_check_delta(unittest.TestCase):
377377

378378
@classmethod
379379
def setUp(self):
380-
index = pd.date_range('1/1/2017', periods=24, freq='H')
380+
index = pd.date_range('1/1/2017', periods=24, freq='h')
381381
data = {'A': [0.5,-0.3,0.2,0,0.5,-0.45,0.35,-0.4,0.5,1.5,0.5,-0.5,0.5,-0.5,5,6,10,10.5,10,10.3,10,10.8,10,9.9],
382382
'B': [0,1,2.2,3,3.8,5,6,7.1,8,9,10,5,-2,1,0,0.5,0,5,3,9.5,8.2,7,np.nan,5]}
383383
df = pd.DataFrame(data, index=index)
@@ -522,7 +522,7 @@ class Test_check_outlier(unittest.TestCase):
522522

523523
@classmethod
524524
def setUp(self):
525-
index = pd.date_range('1/1/2017', periods=24, freq='H')
525+
index = pd.date_range('1/1/2017', periods=24, freq='h')
526526
data = {'A': [112,114,113,132,134,127,150,120,117,112,107,99,140,
527527
98,88,98,106,110,107,79,102,115,np.nan,91]}
528528
df = pd.DataFrame(data, index=index)
@@ -570,7 +570,7 @@ class Test_check_custom(unittest.TestCase):
570570
def setUp(self):
571571
N = 1000
572572
np.random.seed(92837)
573-
index = pd.date_range('1/1/2020', periods=N, freq='S')
573+
index = pd.date_range('1/1/2020', periods=N, freq='s')
574574
data = {'A': np.random.normal(size=N),'B': np.random.normal(size=N)}
575575
df = pd.DataFrame(data, index=index)
576576

pecos/tests/test_pv.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestPV(unittest.TestCase):
1515
def test_insolation(self):
1616
# same test as metrics.time_integral
1717
periods = 5
18-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
18+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
1919
data = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15]])
2020
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
2121

@@ -28,7 +28,7 @@ def test_insolation(self):
2828
def test_energy(self):
2929
# same test as metrics.time_integral
3030
periods = 5
31-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
31+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
3232
data = np.array([[1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15]])
3333
df = pd.DataFrame(data=data, index=index, columns=['A', 'B', 'C'])
3434

@@ -41,7 +41,7 @@ def test_energy(self):
4141
def test_performance_ratio(self):
4242

4343
periods = 5
44-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
44+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
4545
E = pd.Series(data=np.array([4, 4, 4.5, 2.7, 6]), index=index)
4646
POA = pd.Series(data=np.array([1000,1250,1250,900,1500]), index=index)
4747

@@ -52,7 +52,7 @@ def test_performance_ratio(self):
5252
def test_normalized_current(self):
5353

5454
periods = 5
55-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
55+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
5656
I = pd.Series(data=np.array([4, 4, 4.5, 2.7, 6]), index=index)
5757
POA = pd.Series(data=np.array([1000,1250,1250,900,1500]), index=index)
5858

@@ -63,7 +63,7 @@ def test_normalized_current(self):
6363
def test_normalized_efficiency(self):
6464

6565
periods = 5
66-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
66+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
6767
P = pd.Series(data=np.array([4, 4, 4.5, 2.7, 6]), index=index)
6868
POA = pd.Series(data=np.array([1000,1250,1250,900,1500]), index=index)
6969

@@ -74,7 +74,7 @@ def test_normalized_efficiency(self):
7474
def test_performance_index(self):
7575

7676
periods = 5
77-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
77+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
7878
P = pd.Series(data=np.array([4, 4, 4.5, 2.7, 6]), index=index)
7979
P_expected = pd.Series(data=np.array([5,10,4.5,3,4]), index=index)
8080

@@ -85,7 +85,7 @@ def test_performance_index(self):
8585
def test_energy_yield(self):
8686

8787
periods = 5
88-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
88+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
8989
E = pd.Series(data=np.array([4, 4, 4.5, 2.7, 6]), index=index)
9090

9191
EY = pecos.pv.energy_yield(E, 10)
@@ -95,7 +95,7 @@ def test_energy_yield(self):
9595
def test_clearness_index(self):
9696

9797
periods = 5
98-
index = pd.date_range('1/1/2016', periods=periods, freq='H')
98+
index = pd.date_range('1/1/2016', periods=periods, freq='h')
9999
DNI = pd.Series(data=np.array([4, 4, 4.5, 2.7, 6]), index=index)
100100
ExI = pd.Series(data=np.array([5,10,4.5,3,4]), index=index)
101101

pecos/tests/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class TestEvaluateString(unittest.TestCase):
144144

145145
@classmethod
146146
def setUp(self):
147-
index = pd.date_range('1/1/2020', periods=72, freq='H')
147+
index = pd.date_range('1/1/2020', periods=72, freq='h')
148148
data = {'A': np.random.rand(72),
149149
'B': np.random.rand(72)}
150150
self.df = pd.DataFrame(data, index=index)

0 commit comments

Comments
 (0)