Skip to content

Commit

Permalink
Adjust comparison for distance
Browse files Browse the repository at this point in the history
  • Loading branch information
marioCluml committed Nov 3, 2023
1 parent d25cb9d commit d54f7cc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [0.14.5] - 2023-11-02

### Changed

- Modified Ranked Outliers graphql query to take in a SearchFilter with
distance range and time range

### Added

- Added new method for Ranked Outliers `load_ranked_outliers_with_filter`,
`load_nodes_with_search_filter`, and `iter_through_search_filter_nodes`
to load Ranked Outliers depending on new Search Filter.


Check failure on line 21 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / check

Multiple consecutive blank lines [Expected: 1; Actual: 2]

Check failure on line 21 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / check

Multiple consecutive blank lines [Expected: 1; Actual: 2]

Check failure on line 22 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / check

Multiple consecutive blank lines [Expected: 1; Actual: 3]

Check failure on line 22 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / check

Multiple consecutive blank lines [Expected: 1; Actual: 3]
## [0.14.4] - 2023-10-19

### Added
Expand Down Expand Up @@ -307,6 +322,7 @@ across our system.

- An initial version.

[0.14.5]: https://github.com/aicers/review-web/compare/0.14.4...0.14.5
[0.14.4]: https://github.com/aicers/review-web/compare/0.14.3...0.14.4
[0.14.3]: https://github.com/aicers/review-web/compare/0.14.2...0.14.3
[0.14.2]: https://github.com/aicers/review-web/compare/0.14.1...0.14.2
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "review-web"
version = "0.14.4"
version = "0.14.5"
edition = "2021"

[dependencies]
Expand Down
16 changes: 6 additions & 10 deletions src/graphql/outlier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,8 @@ where

if let Some(filter) = filter {
if let Some(time) = &filter.time {
let start = time.start;
let end = time.end;
if let Some(start) = start {
if let Some(end) = end {
if let Some(start) = time.start {
if let Some(end) = time.end {
if node.timestamp < start.timestamp_nanos_opt().unwrap_or_default()
|| node.timestamp > end.timestamp_nanos_opt().unwrap_or_default()
{
Expand All @@ -733,22 +731,20 @@ where
} else if node.timestamp < start.timestamp_nanos_opt().unwrap_or_default() {
continue;
}
} else if let Some(end) = end {
} else if let Some(end) = time.end {
if node.timestamp > end.timestamp_nanos_opt().unwrap_or_default() {
continue;
}
}
}

if let Some(distance) = &filter.distance {
let start = distance.start;
let end = distance.end;
if let Some(start) = start {
if let Some(end) = end {
if let Some(start) = distance.start {
if let Some(end) = distance.end {
if node.distance < start || node.distance > end {
continue;
}
} else if (((node.distance * 10.0).round() / 10.0) - start).abs() > 0.0 {
} else if node.distance < start {
continue;
}
}
Expand Down

0 comments on commit d54f7cc

Please sign in to comment.