Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
microprediction committed Oct 18, 2024
1 parent 406fb3a commit 4ce6f6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ importlib-metadata>=1.7.0
momentum>=0.2.5
numpy>=1.19.5
pytz>=2021.3
scikit-learn



11 changes: 6 additions & 5 deletions tests/test_freq.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ def test_date_stuff():

def test_inference():
# https://github.com/pandas-dev/pandas/blob/master/pandas/tseries/frequencies.py
expected = {'S':[RECENT_SECONDS + j for j in range(200)],
'5S':[RECENT_SECONDS + 5 * j for j in range(200)],
'T':[RECENT_SECONDS + 60 * j for j in range(200)],
'5T':[RECENT_SECONDS + 5 * 60 * j for j in range(200)]} # 5 minutes
expected = {'s':[RECENT_SECONDS + j for j in range(200)],
'5s':[RECENT_SECONDS + 5 * j for j in range(200)],
'min':[RECENT_SECONDS + 60 * j for j in range(200)],
'5min':[RECENT_SECONDS + 5 * 60 * j for j in range(200)]} # 5 minutes
for expected_freq, t in expected.items():
freq = infer_freq_from_epoch(t)
assert freq==expected_freq


if __name__=='__main__':
test_date_stuff()
test_date_stuff()
test_inference()
2 changes: 1 addition & 1 deletion tests/tsa/test_tsa_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

fs = [ tsa_p1_d0_q0, tsa_p1_d0_q1 ]

from timemachines.skatertools.ensembling import precision_weighted_ensemble_factory
from timemachines.skatertools.ensembling.ensemblefactory import precision_weighted_ensemble_factory

def my_skater(y,s,k,**ignore):
return precision_weighted_ensemble_factory(y=y,s=s,k=k,fs=fs)
Expand Down

0 comments on commit 4ce6f6b

Please sign in to comment.