Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Paul van Tilburg | 3451445de1 | |
Paul van Tilburg | b88c7f77a0 | |
Paul van Tilburg | 705ffae249 | |
Paul van Tilburg | bd2344beb6 | |
Paul van Tilburg | bad20b803a | |
Paul van Tilburg | fc4672328f | |
Paul van Tilburg | 769f0745c8 |
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.2.3] - 2022-05-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Update the examples in `README.md`
|
||||||
|
* Fix tests by adding missing type
|
||||||
|
* Fix map key color code for level 8 used by map sampling
|
||||||
|
|
||||||
## [0.2.2] - 2022-05-10
|
## [0.2.2] - 2022-05-10
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -39,7 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
Initial release.
|
Initial release.
|
||||||
|
|
||||||
[Unreleased]: https://git.luon.net/paul/sinoptik/compare/v0.2.2...HEAD
|
[Unreleased]: https://git.luon.net/paul/sinoptik/compare/v0.2.3...HEAD
|
||||||
|
[0.2.3]: https://git.luon.net/paul/sinoptik/compare/v0.2.2...v0.2.3
|
||||||
[0.2.2]: https://git.luon.net/paul/sinoptik/compare/v0.2.1...v0.2.2
|
[0.2.2]: https://git.luon.net/paul/sinoptik/compare/v0.2.1...v0.2.2
|
||||||
[0.2.1]: https://git.luon.net/paul/sinoptik/compare/v0.2.0...v0.2.1
|
[0.2.1]: https://git.luon.net/paul/sinoptik/compare/v0.2.0...v0.2.1
|
||||||
[0.2.0]: https://git.luon.net/paul/sinoptik/compare/v0.1.0...v0.2.0
|
[0.2.0]: https://git.luon.net/paul/sinoptik/compare/v0.1.0...v0.2.0
|
||||||
|
|
|
@ -2218,7 +2218,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sinoptik"
|
name = "sinoptik"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assert_float_eq",
|
"assert_float_eq",
|
||||||
"assert_matches",
|
"assert_matches",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sinoptik"
|
name = "sinoptik"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
authors = [
|
authors = [
|
||||||
"Admar Schoonen <admar@luon.net",
|
"Admar Schoonen <admar@luon.net",
|
||||||
"Paul van Tilburg <paul@luon.net>"
|
"Paul van Tilburg <paul@luon.net>"
|
||||||
|
|
42
README.md
42
README.md
|
@ -107,27 +107,27 @@ position:
|
||||||
{
|
{
|
||||||
"lat": 52.0905169,
|
"lat": 52.0905169,
|
||||||
"lon": 5.1109709,
|
"lon": 5.1109709,
|
||||||
"time": 1645800043,
|
"time": 1652188682,
|
||||||
"UVI": [
|
"UVI": [
|
||||||
{
|
{
|
||||||
"time": 1645799526,
|
"time": 1652140800,
|
||||||
"value": 1
|
"value": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"time": 1645885926,
|
"time": 1652227200,
|
||||||
"value": 2
|
"value": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"time": 1645972326,
|
"time": 1652313600,
|
||||||
"value": 3
|
"value": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"time": 1646058726,
|
"time": 1652400000,
|
||||||
"value": 2
|
"value": 4
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"time": 1646145126,
|
"time": 1652486400,
|
||||||
"value": 1
|
"value": 5
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -138,31 +138,31 @@ position:
|
||||||
The PAQI (pollen/air quality index) metric is a special combined metric.
|
The PAQI (pollen/air quality index) metric is a special combined metric.
|
||||||
If selected, it not only merges items from the AQI and pollen metric into
|
If selected, it not only merges items from the AQI and pollen metric into
|
||||||
`PAQI` by selecting the maximum value for each hour, but it also yields the
|
`PAQI` by selecting the maximum value for each hour, but it also yields the
|
||||||
24-hour maximum forecast item for air quality index in `AQI_max` and for
|
maximum forecast item for air quality index in `AQI_max` and for
|
||||||
pollen in `pollen_max` seperately:
|
pollen in `pollen_max` seperately (out the items that `PAQI` combined):
|
||||||
|
|
||||||
``` json
|
``` json
|
||||||
{
|
{
|
||||||
"lat": 52.0905169,
|
"lat": 52.0905169,
|
||||||
"lon": 5.1109709,
|
"lon": 5.1109709,
|
||||||
"time": 1645800043,
|
"time": 1652189065,
|
||||||
"AQI_max": {
|
"AQI_max": {
|
||||||
"time": 1652022000,
|
"time": 1652191200,
|
||||||
"value": 6.65
|
"value": 6.09
|
||||||
},
|
},
|
||||||
"PAQI": [
|
"PAQI": [
|
||||||
{
|
{
|
||||||
"time": 1651951457,
|
"time": 1652187600,
|
||||||
"value": 6.04
|
"value": 6.09
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"time": 1651955057,
|
"time": 1652191200,
|
||||||
"value": 6.04
|
"value": 6.09
|
||||||
},
|
},
|
||||||
...
|
...
|
||||||
],
|
],
|
||||||
"pollen_max": {
|
"pollen_max": {
|
||||||
"time": 1652034257,
|
"time": 1652209200,
|
||||||
"value": 6
|
"value": 6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub(crate) mod position;
|
||||||
pub(crate) mod providers;
|
pub(crate) mod providers;
|
||||||
|
|
||||||
#[derive(Responder)]
|
#[derive(Responder)]
|
||||||
#[response(status = 200, content_type = "image/png")]
|
#[response(content_type = "image/png")]
|
||||||
struct PngImageData(Vec<u8>);
|
struct PngImageData(Vec<u8>);
|
||||||
|
|
||||||
/// Handler for retrieving the forecast for an address.
|
/// Handler for retrieving the forecast for an address.
|
||||||
|
@ -110,7 +110,7 @@ mod tests {
|
||||||
use assert_float_eq::*;
|
use assert_float_eq::*;
|
||||||
use assert_matches::assert_matches;
|
use assert_matches::assert_matches;
|
||||||
use image::{DynamicImage, Rgba, RgbaImage};
|
use image::{DynamicImage, Rgba, RgbaImage};
|
||||||
use rocket::http::Status;
|
use rocket::http::{ContentType, Status};
|
||||||
use rocket::local::blocking::Client;
|
use rocket::local::blocking::Client;
|
||||||
use rocket::serde::json::Value as JsonValue;
|
use rocket::serde::json::Value as JsonValue;
|
||||||
|
|
||||||
|
|
20
src/maps.rs
20
src/maps.rs
|
@ -29,16 +29,16 @@ type MapKeyHistogram = HashMap<Rgb<u8>, u32>;
|
||||||
/// Note that the actual score starts from 1, not 0 as per this array.
|
/// Note that the actual score starts from 1, not 0 as per this array.
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
const MAP_KEY: [[u8; 3]; 10] = [
|
const MAP_KEY: [[u8; 3]; 10] = [
|
||||||
[ 73, 218, 33],
|
[0x49, 0xDA, 0x21],
|
||||||
[ 48, 210, 0],
|
[0x30, 0xD2, 0x00],
|
||||||
[255, 248, 139],
|
[0xFF, 0xF8, 0x8B],
|
||||||
[255, 246, 66],
|
[0xFF, 0xF6, 0x42],
|
||||||
[253, 187, 49],
|
[0xFD, 0xBB, 0x31],
|
||||||
[253, 142, 36],
|
[0xFD, 0x8E, 0x24],
|
||||||
[252, 16, 62],
|
[0xFC, 0x10, 0x3E],
|
||||||
[150, 10, 51],
|
[0x97, 0x0A, 0x33],
|
||||||
[166, 109, 188],
|
[0xA6, 0x6D, 0xBC],
|
||||||
[179, 48, 161],
|
[0xB3, 0x30, 0xA1],
|
||||||
];
|
];
|
||||||
|
|
||||||
/// The Buienradar map sample size.
|
/// The Buienradar map sample size.
|
||||||
|
|
Loading…
Reference in New Issue