-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: make cluster_band
optional, undefined if no cluster is found
#105
Conversation
WalkthroughThe changes introduce optionality to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DBSCANDetector
participant MADDetector
participant OutlierOutput
User->>DBSCANDetector: Request clustering
DBSCANDetector->>OutlierOutput: Generate OutlierOutput
OutlierOutput->>User: Return results with cluster_band (optional)
User->>MADDetector: Request MAD analysis
MADDetector->>OutlierOutput: Generate OutlierOutput
OutlierOutput->>User: Return results with cluster_band (optional)
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
fyi @matyax 🙂 |
cluster_band
optional, undefined if no cluster is found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- crates/augurs-js/src/outlier.rs (1 hunks)
- crates/augurs-outlier/src/dbscan.rs (5 hunks)
- crates/augurs-outlier/src/lib.rs (1 hunks)
- crates/augurs-outlier/src/mad.rs (1 hunks)
Additional comments not posted (11)
crates/augurs-outlier/src/lib.rs (2)
50-54
: LGTM!The change to make
cluster_band
anOption<Band>
is appropriate and well-documented.
Line range hint
59-67
:
LGTM!The constructor update to accept an
Option<Band>
for thecluster_band
parameter is consistent with the struct definition changes.crates/augurs-js/src/outlier.rs (2)
315-319
: LGTM!The change to make
cluster_band
anOption<ClusterBand>
is appropriate and well-documented.
327-327
: LGTM!The update to the
From
implementation to mapcluster_band
usingmap(Into::into)
is consistent with the struct definition changes and handles the optional value correctly.crates/augurs-outlier/src/mad.rs (1)
217-220
: LGTM!The change to wrap
normal_band
in anOption
is appropriate and enhances the flexibility of theMADDetector
implementation.crates/augurs-outlier/src/dbscan.rs (6)
94-94
: Good use of lazy initialization fornormal_band
.Initializing
normal_band
asNone
and using lazy initialization optimizes memory usage by deferring the creation of theBand
until it is actually needed.
128-130
: Efficient creation ofBand
usingget_or_insert_with
.Using
get_or_insert_with
ensures that theBand
is only created when a cluster is found, which aligns with the lazy initialization approach and optimizes resource usage.
564-564
: Important validation forcluster_band
in testtest_tiny
.Including an assertion to check if
cluster_band
isSome
ensures that the presence ofcluster_band
is validated, which is important for verifying the new behavior.
613-613
: Important validation forcluster_band
in testtest_realistic
.Including an assertion to check if
cluster_band
isSome
ensures that the presence ofcluster_band
is validated, which is important for verifying the new behavior.
635-636
: Important validation forcluster_band
in testtest_missing_data_at_start
.Including an assertion to check if
cluster_band
isSome
ensures that the presence ofcluster_band
is validated, which is important for verifying the new behavior.
638-657
: Crucial test cases for validatingcluster_band
behavior.The new test cases
test_no_cluster_band_small_eps
andtest_no_cluster_band_two_series
are crucial for ensuring that thecluster_band
field is correctly handled when no clusters are found, aligning with the PR objectives.
Bencher
Click to view all benchmark results
Bencher - Continuous Benchmarking View Public Perf Page Docs | Repo | Chat | Help |
Closes #104.
Summary by CodeRabbit
New Features
cluster_band
field to be optional, improving robustness in scenarios with insufficient input data.normal_band
, optimizing memory usage.Bug Fixes
cluster_band
across various input conditions.Tests
cluster_band
under different scenarios, ensuring comprehensive coverage.