Skip to content

Commit

Permalink
add test for weeks instead of days as period
Browse files Browse the repository at this point in the history
  • Loading branch information
l-kotzur committed Jun 28, 2023
1 parent 06114bf commit 3666f3d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_hierarchical.py
Expand Up @@ -51,6 +51,28 @@ def test_hierarchical():

np.testing.assert_array_almost_equal(orig.values, test.values, decimal=4)

def test_hierarchical_for_weeks():

raw = pd.read_csv(
os.path.join(os.path.dirname(__file__), "..", "examples", "testdata.csv"),
index_col=0,
)

starttime = time.time()

aggregation = tsam.TimeSeriesAggregation(
raw,
noTypicalPeriods=8,
hoursPerPeriod=24*7,
clusterMethod="hierarchical",
extremePeriodMethod="new_cluster_center",
addPeakMin=["T"],
addPeakMax=["Load"],
)

typPeriods = aggregation.createTypicalPeriods()

print("Clustering took " + str(time.time() - starttime))

if __name__ == "__main__":
test_hierarchical()

0 comments on commit 3666f3d

Please sign in to comment.