Skip to content

Commit 3d608ee

Browse files
committed
rename moment to observation
1 parent f9c8866 commit 3d608ee

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

source/mir/timeseries.d

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import std.meta;
6767
@fastmath:
6868

6969
/++
70-
Plain time moment data structure.
70+
Plain time observation data structure.
7171
Observation are used as return tuple for for indexing $(LREF Series).
7272
+/
7373
struct Observation(Time, Data)
@@ -79,7 +79,7 @@ struct Observation(Time, Data)
7979
}
8080

8181
/// Convenient function for $(LREF Observation) construction.
82-
auto moment(Time, Data)(Time time, Data data)
82+
auto observation(Time, Data)(Time time, Data data)
8383
{
8484
return Observation!(Time, Data)(time, data);
8585
}
@@ -239,7 +239,7 @@ struct Series(TimeIterator, SliceKind kind, size_t[] packs, Iterator)
239239
}
240240
else
241241
{
242-
return time.front.moment(data.front);
242+
return time.front.observation(data.front);
243243
}
244244
}
245245

@@ -254,7 +254,7 @@ struct Series(TimeIterator, SliceKind kind, size_t[] packs, Iterator)
254254
}
255255
else
256256
{
257-
return time.back.moment(data.back);
257+
return time.back.observation(data.back);
258258
}
259259
}
260260

@@ -347,7 +347,7 @@ struct Series(TimeIterator, SliceKind kind, size_t[] packs, Iterator)
347347
}
348348
else
349349
{
350-
return time[slices[0]].moment(data[slices]);
350+
return time[slices[0]].observation(data[slices]);
351351
}
352352
}
353353

@@ -372,14 +372,14 @@ unittest
372372
static assert(is(typeof(series) == typeof(seriesSlice)));
373373

374374
/// indexing
375-
assert(series[1] == moment(2, 3.4));
375+
assert(series[1] == observation(2, 3.4));
376376

377377
/// range primitives
378378
assert(series.length == 4);
379-
assert(series.front == moment(1, 2.1));
379+
assert(series.front == observation(1, 2.1));
380380

381381
series.popFront;
382-
assert(series.front == moment(2, 3.4));
382+
assert(series.front == observation(2, 3.4));
383383

384384
series.popBackN(10);
385385
assert(series.empty);
@@ -417,8 +417,8 @@ unittest
417417
static assert(is(typeof(series) == typeof(seriesSlice)));
418418

419419
/// indexing
420-
assert(series[1, 4] == moment(Date(2017, 02, 01), 10));
421-
assert(series[2] == moment(Date(2017, 03, 01), iota([row_length], 11)));
420+
assert(series[1, 4] == observation(Date(2017, 02, 01), 10));
421+
assert(series[2] == observation(Date(2017, 03, 01), iota([row_length], 11)));
422422

423423
/// range primitives
424424
assert(series.length == 4);
@@ -446,7 +446,7 @@ enum isSeries(U : Series!(TimeIterator, kind, packs, Iterator), TimeIterator, Sl
446446
enum isSeries(U) = (size_t[]).init;
447447

448448
/++
449-
Sorts time-series according to the `less` predicate applied to time moments.
449+
Sorts time-series according to the `less` predicate applied to time observations.
450450
451451
The function works only for 1-dimensional time-series data.
452452
+/

0 commit comments

Comments
 (0)