Skip to content

Commit c289836

Browse files
committed
Changed cac_ attribute to cac_1d_
1 parent 80fe436 commit c289836

File tree

3 files changed

+40
-40
lines changed

3 files changed

+40
-40
lines changed

docs/Tutorial_Semantic_Segmentation.ipynb

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
{
167167
"data": {
168168
"text/plain": [
169-
"<matplotlib.patches.Rectangle at 0x1a1af70c50>"
169+
"<matplotlib.patches.Rectangle at 0x1a23f3c590>"
170170
]
171171
},
172172
"execution_count": 4,
@@ -216,7 +216,7 @@
216216
{
217217
"data": {
218218
"text/plain": [
219-
"<matplotlib.patches.FancyArrowPatch at 0x1a1b942f50>"
219+
"<matplotlib.patches.FancyArrowPatch at 0x1a24906690>"
220220
]
221221
},
222222
"execution_count": 5,
@@ -336,7 +336,7 @@
336336
{
337337
"data": {
338338
"text/plain": [
339-
"<matplotlib.lines.Line2D at 0x1a1ecba590>"
339+
"<matplotlib.lines.Line2D at 0x1a27c71e90>"
340340
]
341341
},
342342
"execution_count": 8,
@@ -397,7 +397,7 @@
397397
{
398398
"data": {
399399
"text/plain": [
400-
"[<matplotlib.lines.Line2D at 0x1a1f6e48d0>]"
400+
"[<matplotlib.lines.Line2D at 0x1a2829be50>]"
401401
]
402402
},
403403
"execution_count": 10,
@@ -432,7 +432,7 @@
432432
"source": [
433433
"## Streaming Data with FLOSS\n",
434434
"\n",
435-
"Instead of manually computing `CAC_1D` like we did above on streaming data, we can actually call the `floss` function directly which returns back a Python generator. To demonstrate the use of `floss`, let's take some `old_data` and compute the matrix profile indices for it like we did above:"
435+
"Instead of manually computing `CAC_1D` like we did above on streaming data, we can actually call the `floss` function directly which instantiates a streaming object. To demonstrate the use of `floss`, let's take some `old_data` and compute the matrix profile indices for it like we did above:"
436436
]
437437
},
438438
{
@@ -490,7 +490,7 @@
490490
"source": [
491491
"You can now update the `stream` with a new data points `t` via the `stream.update(t)` function and this will slide your window over by one data point and it will automatically update:\n",
492492
"\n",
493-
"1. the `CAC_1D` (accessed via the `.cac_` attribute)\n",
493+
"1. the `CAC_1D` (accessed via the `.cac_1d_` attribute)\n",
494494
"2. the matrix profile (accessed via the `.P_` attribute)\n",
495495
"3. the matrix profile indices (accessed via the `.I_` attribute)\n",
496496
"4. the sliding window of data used to produce the `CAC_1D` (accessed via the `.T_` attribute - this should be the same size as the length of the `old_data\\)\n",
@@ -509,7 +509,7 @@
509509
" stream.update(t)\n",
510510
" \n",
511511
" if i % 100 == 0:\n",
512-
" windows.append((stream.T_, stream.cac_))"
512+
" windows.append((stream.T_, stream.cac_1d_))"
513513
]
514514
},
515515
{
@@ -713,39 +713,39 @@
713713
"</style>\n",
714714
"\n",
715715
"<div class=\"animation\">\n",
716-
" <img id=\"_anim_img204d1463aef24511af3f0fdcc804e18c\">\n",
716+
" <img id=\"_anim_img0f56a5975dc74a08b11a47ed20620d95\">\n",
717717
" <div class=\"anim-controls\">\n",
718-
" <input id=\"_anim_slider204d1463aef24511af3f0fdcc804e18c\" type=\"range\" class=\"anim-slider\"\n",
718+
" <input id=\"_anim_slider0f56a5975dc74a08b11a47ed20620d95\" type=\"range\" class=\"anim-slider\"\n",
719719
" name=\"points\" min=\"0\" max=\"1\" step=\"1\" value=\"0\"\n",
720-
" oninput=\"anim204d1463aef24511af3f0fdcc804e18c.set_frame(parseInt(this.value));\"></input>\n",
720+
" oninput=\"anim0f56a5975dc74a08b11a47ed20620d95.set_frame(parseInt(this.value));\"></input>\n",
721721
" <div class=\"anim-buttons\">\n",
722-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.slower()\"><i class=\"fa fa-minus\"></i></button>\n",
723-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.first_frame()\"><i class=\"fa fa-fast-backward\">\n",
722+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.slower()\"><i class=\"fa fa-minus\"></i></button>\n",
723+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.first_frame()\"><i class=\"fa fa-fast-backward\">\n",
724724
" </i></button>\n",
725-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.previous_frame()\">\n",
725+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.previous_frame()\">\n",
726726
" <i class=\"fa fa-step-backward\"></i></button>\n",
727-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.reverse_animation()\">\n",
727+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.reverse_animation()\">\n",
728728
" <i class=\"fa fa-play fa-flip-horizontal\"></i></button>\n",
729-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.pause_animation()\"><i class=\"fa fa-pause\">\n",
729+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.pause_animation()\"><i class=\"fa fa-pause\">\n",
730730
" </i></button>\n",
731-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.play_animation()\"><i class=\"fa fa-play\"></i>\n",
731+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.play_animation()\"><i class=\"fa fa-play\"></i>\n",
732732
" </button>\n",
733-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.next_frame()\"><i class=\"fa fa-step-forward\">\n",
733+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.next_frame()\"><i class=\"fa fa-step-forward\">\n",
734734
" </i></button>\n",
735-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.last_frame()\"><i class=\"fa fa-fast-forward\">\n",
735+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.last_frame()\"><i class=\"fa fa-fast-forward\">\n",
736736
" </i></button>\n",
737-
" <button onclick=\"anim204d1463aef24511af3f0fdcc804e18c.faster()\"><i class=\"fa fa-plus\"></i></button>\n",
737+
" <button onclick=\"anim0f56a5975dc74a08b11a47ed20620d95.faster()\"><i class=\"fa fa-plus\"></i></button>\n",
738738
" </div>\n",
739-
" <form action=\"#n\" name=\"_anim_loop_select204d1463aef24511af3f0fdcc804e18c\" class=\"anim-state\">\n",
740-
" <input type=\"radio\" name=\"state\" value=\"once\" id=\"_anim_radio1_204d1463aef24511af3f0fdcc804e18c\"\n",
739+
" <form action=\"#n\" name=\"_anim_loop_select0f56a5975dc74a08b11a47ed20620d95\" class=\"anim-state\">\n",
740+
" <input type=\"radio\" name=\"state\" value=\"once\" id=\"_anim_radio1_0f56a5975dc74a08b11a47ed20620d95\"\n",
741741
" >\n",
742-
" <label for=\"_anim_radio1_204d1463aef24511af3f0fdcc804e18c\">Once</label>\n",
743-
" <input type=\"radio\" name=\"state\" value=\"loop\" id=\"_anim_radio2_204d1463aef24511af3f0fdcc804e18c\"\n",
742+
" <label for=\"_anim_radio1_0f56a5975dc74a08b11a47ed20620d95\">Once</label>\n",
743+
" <input type=\"radio\" name=\"state\" value=\"loop\" id=\"_anim_radio2_0f56a5975dc74a08b11a47ed20620d95\"\n",
744744
" checked>\n",
745-
" <label for=\"_anim_radio2_204d1463aef24511af3f0fdcc804e18c\">Loop</label>\n",
746-
" <input type=\"radio\" name=\"state\" value=\"reflect\" id=\"_anim_radio3_204d1463aef24511af3f0fdcc804e18c\"\n",
745+
" <label for=\"_anim_radio2_0f56a5975dc74a08b11a47ed20620d95\">Loop</label>\n",
746+
" <input type=\"radio\" name=\"state\" value=\"reflect\" id=\"_anim_radio3_0f56a5975dc74a08b11a47ed20620d95\"\n",
747747
" >\n",
748-
" <label for=\"_anim_radio3_204d1463aef24511af3f0fdcc804e18c\">Reflect</label>\n",
748+
" <label for=\"_anim_radio3_0f56a5975dc74a08b11a47ed20620d95\">Reflect</label>\n",
749749
" </form>\n",
750750
" </div>\n",
751751
"</div>\n",
@@ -755,9 +755,9 @@
755755
" /* Instantiate the Animation class. */\n",
756756
" /* The IDs given should match those used in the template above. */\n",
757757
" (function() {\n",
758-
" var img_id = \"_anim_img204d1463aef24511af3f0fdcc804e18c\";\n",
759-
" var slider_id = \"_anim_slider204d1463aef24511af3f0fdcc804e18c\";\n",
760-
" var loop_select_id = \"_anim_loop_select204d1463aef24511af3f0fdcc804e18c\";\n",
758+
" var img_id = \"_anim_img0f56a5975dc74a08b11a47ed20620d95\";\n",
759+
" var slider_id = \"_anim_slider0f56a5975dc74a08b11a47ed20620d95\";\n",
760+
" var loop_select_id = \"_anim_loop_select0f56a5975dc74a08b11a47ed20620d95\";\n",
761761
" var frames = new Array(50);\n",
762762
" \n",
763763
" frames[0] = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAGwCAYAAABfOcJAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\\\n",
@@ -59156,7 +59156,7 @@
5915659156
" /* set a timeout to make sure all the above elements are created before\n",
5915759157
" the object is initialized. */\n",
5915859158
" setTimeout(function() {\n",
59159-
" anim204d1463aef24511af3f0fdcc804e18c = new Animation(frames, img_id, slider_id, 100.0,\n",
59159+
" anim0f56a5975dc74a08b11a47ed20620d95 = new Animation(frames, img_id, slider_id, 100.0,\n",
5916059160
" loop_select_id);\n",
5916159161
" }, 0);\n",
5916259162
" })()\n",

stumpy/floss.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ class floss(object):
337337
338338
Attributes
339339
----------
340-
cac_ : ndarray
341-
A corrected arc curve (CAC) updated as a result of ingressing a single
342-
new data point and egressing a single old data point.
340+
cac_1d_ : ndarray
341+
A 1-dimensional corrected arc curve (CAC) updated as a result of ingressing a
342+
single new data point and egressing a single old data point.
343343
344344
P_ : ndarray
345345
The matrix profile updated as a result of ingressing a single new data
@@ -463,8 +463,8 @@ def __init__(
463463
def update(self, t):
464464
"""
465465
Ingress a new data point, `t`, onto the time series, `T`, followed by egressing
466-
a oldest single data point from `T`. Then, update the corrected arc curve (CAC)
467-
and the matrix profile.
466+
a oldest single data point from `T`. Then, update the 1-dimensional corrected
467+
arc curve (CAC_1D) and the matrix profile.
468468
469469
Parameters
470470
----------
@@ -520,9 +520,9 @@ def update(self, t):
520520
self._n_appended += 1
521521

522522
@property
523-
def cac_(self):
523+
def cac_1d_(self):
524524
"""
525-
Get the updated corrected arc curve (CAC)
525+
Get the updated 1-dimensional corrected arc curve (CAC_1D)
526526
"""
527527
return self._cac.astype(np.float)
528528

tests/test_floss.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_floss():
168168
mp[update_idx, 0] = D[update_idx]
169169
mp[update_idx, 3] = last_idx + i
170170

171-
left_cac = _cac(
171+
left_cac_1d = _cac(
172172
mp[:, 3] - i - 1,
173173
L,
174174
bidirectional=False,
@@ -181,15 +181,15 @@ def test_floss():
181181
left_I = left_mp[:, 3]
182182

183183
stream.update(left_T[-1])
184-
right_cac = stream.cac_
184+
right_cac_1d = stream.cac_1d_
185185
right_P = stream.P_
186186
right_I = stream.I_
187187
right_T = stream.T_
188188

189189
naive.replace_inf(left_P)
190190
naive.replace_inf(right_P)
191191

192-
npt.assert_almost_equal(left_cac, right_cac)
192+
npt.assert_almost_equal(left_cac_1d, right_cac_1d)
193193
npt.assert_almost_equal(left_P, right_P)
194194
npt.assert_almost_equal(left_I, right_I)
195195
npt.assert_almost_equal(left_T, right_T)

0 commit comments

Comments
 (0)