Comparing version 0.9.0-alpha.c1914000 to 0.9.0-alpha.e6744236
@@ -7,3 +7,3 @@ import { Align } from "./align"; | ||
import { Fill } from "./fill"; | ||
import { avg, count, difference, first, keep, last, max, median, min, percentile, stdev, sum } from "./functions"; | ||
import { avg, count, difference, filter, first, keep, last, max, median, min, percentile, stdev, sum } from "./functions"; | ||
import { grouped, GroupedCollection } from "./grouped"; | ||
@@ -28,3 +28,3 @@ import { index, Index } from "./index"; | ||
export { Fill }; | ||
export { avg, count, difference, first, keep, last, max, median, min, percentile, stdev, sum }; | ||
export { avg, count, difference, filter, first, keep, last, max, median, min, percentile, stdev, sum }; | ||
export { grouped, GroupedCollection }; | ||
@@ -31,0 +31,0 @@ export { index, Index }; |
@@ -24,2 +24,3 @@ "use strict"; | ||
exports.difference = functions_1.difference; | ||
exports.filter = functions_1.filter; | ||
exports.first = functions_1.first; | ||
@@ -72,2 +73,2 @@ exports.keep = functions_1.keep; | ||
exports.WindowedCollection = windowed_1.WindowedCollection; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhwb3J0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9leHBvcnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUNBQWdDO0FBbUN2QixnQkFuQ0EsYUFBSyxDQW1DQTtBQWxDZCxpQ0FBOEI7QUFtQ3JCLGVBbkNBLFdBQUksQ0FtQ0E7QUFsQ2IseUNBQXVDO0FBbUM5QixtQkFuQ0EsbUJBQVEsQ0FtQ0E7QUFsQ2pCLDZDQUFzRDtBQW1DN0MscUJBbkNBLHVCQUFVLENBbUNBO0FBQUUscUJBbkNBLHVCQUFVLENBbUNBO0FBbEMvQixtQ0FBZ0Y7QUFtQ3ZFLGdCQW5DQSxhQUFLLENBbUNBO0FBQUUsZ0JBbkNBLGFBQUssQ0FtQ0E7QUFBRSxvQkFuQ0EsaUJBQV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JBcENBLGVBQU0sQ0FvQ0E7QUFuQ2YscUNBQThEO0FBb0NyRCwyQkFwQ0EseUJBQWdCLENBb0NBO0FBQUUsMkJBcENBLHlCQUFnQixDQW9DQTtBQW5DM0MscUNBQWtDO0FBb0N6QixpQkFwQ0EsZUFBTSxDQW9DQTtBQW5DZixpQ0FBb0M7QUFvQzNCLGVBcENBLFdBQUksQ0FvQ0E7QUFBRSxlQXBDQSxXQUFJLENBb0NBO0FBbkNuQiwyQ0FBbUQ7QUFvQzFDLG9CQXBDQSxxQkFBUyxDQW9DQTtBQUFFLG9CQXBDQSxxQkFBUyxDQW9DQTtBQW5DN0IsNkNBQXNGO0FBb0M3RSxxQkFwQ0EsdUJBQVUsQ0FvQ0E7QUFBRSx3QkFwQ0EsMEJBQWEsQ0FvQ0E7QUFBRSwwQkFwQ0EsNEJBQWUsQ0FvQ0E7QUFBRSxxQkFwQ0EsdUJBQVUsQ0FvQ0E7QUFuQy9ELGlDQUEwQjtBQW9DakIsZUFwQ0YsY0FBSSxDQW9DRTtBQUNiLHVDQUEwRDtBQUFqRCw4QkFBQSxRQUFRLENBQUE7QUFBRSx3Q0FBQSxrQkFBa0IsQ0FBQSJ9 |
{ | ||
"name": "pondjs", | ||
"version": "0.9.0-alpha.c1914000", | ||
"version": "0.9.0-alpha.e6744236", | ||
"description": "A TimeSeries library built on Immutable.js with Typescript", | ||
@@ -5,0 +5,0 @@ "main": "lib/exports.js", |
@@ -21,3 +21,4 @@ /** | ||
import { event } from "../src/event"; | ||
import { timeEvent, timeRangeEvent } from "../src/event"; | ||
import { index, Index } from "../src/index"; | ||
import { timeEvent, timeRangeEvent, indexedEvent } from "../src/event"; | ||
import { avg, max, sum } from "../src/functions"; | ||
@@ -403,2 +404,50 @@ import { period, Period } from "../src/period"; | ||
const weather = Immutable.List([ | ||
{ | ||
"date": "2014-7-1", | ||
"actual_mean_temp": 81, | ||
"actual_min_temp": 72, | ||
"actual_max_temp": 89, | ||
"average_min_temp": 68, | ||
"average_max_temp": 83, | ||
"record_min_temp": 52, | ||
"record_max_temp": 100, | ||
"record_min_temp_year": 1943, | ||
"record_max_temp_year": 1901, | ||
"actual_precipitation": 0, | ||
"average_precipitation": 0.12, | ||
"record_precipitation": 2.17 | ||
}, | ||
{ | ||
"date": "2014-7-2", | ||
"actual_mean_temp": 82, | ||
"actual_min_temp": 72, | ||
"actual_max_temp": 91, | ||
"average_min_temp": 68, | ||
"average_max_temp": 83, | ||
"record_min_temp": 56, | ||
"record_max_temp": 100, | ||
"record_min_temp_year": 2001, | ||
"record_max_temp_year": 1966, | ||
"actual_precipitation": 0.96, | ||
"average_precipitation": 0.13, | ||
"record_precipitation": 1.79 | ||
}, | ||
{ | ||
"date": "2014-7-3", | ||
"actual_mean_temp": 78, | ||
"actual_min_temp": 69, | ||
"actual_max_temp": 87, | ||
"average_min_temp": 68, | ||
"average_max_temp": 83, | ||
"record_min_temp": 54, | ||
"record_max_temp": 103, | ||
"record_min_temp_year": 1933, | ||
"record_max_temp_year": 1966, | ||
"actual_precipitation": 1.78, | ||
"average_precipitation": 0.12, | ||
"record_precipitation": 2.8 | ||
} | ||
]); | ||
describe("Creation", () => { | ||
@@ -433,2 +482,29 @@ it("can create a series with a list of events", () => { | ||
it("can create an series with a list of Indexed Events", () => { | ||
const events = weather.map(item => { | ||
const { | ||
date, | ||
actual_min_temp, | ||
actual_max_temp, | ||
record_min_temp, | ||
record_max_temp | ||
} = item; | ||
return indexedEvent( | ||
index(date), | ||
Immutable.Map({ | ||
temp: [ | ||
+record_min_temp, //eslint-disable-line | ||
+actual_min_temp, //eslint-disable-line | ||
+actual_max_temp, //eslint-disable-line | ||
+record_max_temp //eslint-disable-line | ||
] | ||
}) | ||
); | ||
}); | ||
const collection = new Collection(events); | ||
const series = new TimeSeries({ name, collection }); | ||
expect(series.size()).toBe(3); | ||
}); | ||
it("can create an series with no events", () => { | ||
@@ -573,2 +649,8 @@ const events = []; | ||
}); | ||
it("can use the is() comparator to compare a series and a value different series as false", () => { | ||
const series = timeSeries(sumPart1); | ||
const otherSeries = timeSeries(sumPart2); | ||
expect(TimeSeries.is(series, otherSeries)).toBeFalsy(); | ||
}); | ||
}); | ||
@@ -575,0 +657,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
657861
68
11279