-
Notifications
You must be signed in to change notification settings - Fork 23
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
Extreme value search among one attribute and multiple nodes #124
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #124 +/- ##
==========================================
+ Coverage 64.49% 64.57% +0.08%
==========================================
Files 9 9
Lines 521 525 +4
==========================================
+ Hits 336 339 +3
- Misses 185 186 +1
Continue to review full report at Codecov.
|
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.
Small possible changes, depending on your likes.
# all attribute-node pairs in clust_data | ||
data_types = [k for k in keys(clust_data.data)] | ||
attribute_nodes = data_types[occursin.(data_type, data_types)] | ||
if isempty(attribute_nodes) |
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.
Instead of leaving the if statement open, we could just return the error and end the if statement after line 99. What do you think?
# this contains the special case that data_type is an attribute-node pair | ||
else | ||
data = zeros(clust_data.T*length(attribute_nodes), clust_data.K) | ||
for i in 1:length(attribute_nodes) |
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.
Alternative could be:
for (i, attribute_node) in enumerate(attribute_nodes)
That can generally simplify the readability of the code as you can now use attribute_node
instead of attribute_nodes[i]
Define an extreme value based on an attribute (e.g.
wind
) and it finds the corresponding extreme value among all nodes.Previously, only an attribute-node pair was allowed for extreme value identification (e.g.
wind-dena72
).