Skip to content

Commit

Permalink
one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoralez committed Nov 11, 2024
1 parent 87e7ca1 commit 328c7b5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nbs/lag_transforms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@
"outputs": [],
"source": [
"#| hide\n",
"import operator"
"import operator\n",
"\n",
"from mlforecast.grouped_array import GroupedArray as MLGroupedArray"
]
},
{
Expand Down Expand Up @@ -593,8 +595,14 @@
" tfm._set_core_tfm(1)\n",
" tfm._get_name(1)\n",
" tfm.transform(ga)\n",
" tfm.update(ga)\n",
" tfm.update_samples"
" updates = tfm.update(ga)\n",
" upd_samples = tfm.update_samples\n",
" if upd_samples > -1:\n",
" sliced_ga = MLGroupedArray(ga.data, ga.indptr).take_from_groups(slice(-upd_samples, None))\n",
" ga2 = CoreGroupedArray(sliced_ga.data, sliced_ga.indptr)\n",
" tfm.transform(ga) # to reset state\n",
" updates2 = tfm.update(ga2)\n",
" np.testing.assert_allclose(updates, updates2)"
]
}
],
Expand Down

0 comments on commit 328c7b5

Please sign in to comment.