Skip to content
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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

holgerteichgraeber
Copy link
Owner

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).

@codecov
Copy link

codecov bot commented Oct 10, 2019

Codecov Report

Merging #124 into dev will increase coverage by 0.08%.
The diff coverage is 80%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/clustering/extreme_vals.jl 83.75% <80%> (-0.47%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 371bc9f...b918664. Read the comment docs.

@holgerteichgraeber
Copy link
Owner Author

@YoungFaithful

Copy link
Collaborator

@YoungFaithful YoungFaithful left a 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)
Copy link
Collaborator

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)
Copy link
Collaborator

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants