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

#1570 Add degree range evolution operator #1582

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

alwba
Copy link

@alwba alwba commented Aug 11, 2022

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (if necessary).
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I ran a spell checker.

@alwba alwba changed the title #1570 degree range evolution #1570 Add degree range evolution operator Aug 11, 2022
@Before
public void setUp() throws Exception {
testGraph = getTestGraphWithValues();
Collection<Tuple2<GradoopId, String>> idLabelCollection = new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you need this ?

opt = vertexDegrees.values().stream().reduce(Math::max);
opt.ifPresent(integer -> collector.collect(new Tuple2<>(timePoint, integer)));
break;
case AVG:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not belong in this Branch

case RANGE:
opt = vertexDegrees.values().stream().reduce(Math::max);
opt2 = vertexDegrees.values().stream().reduce(Math::min);
opt.flatMap(max -> opt2.map(min -> max - min));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not working. It does not change the value of the opt. Since the expected values in the UnitTests are wrong for BOTH, t4, you were possibly not aware of this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int maxDegree = vertexDegrees.values().stream().reduce(Math::max).orElse(0);
int minDegree = vertexDegrees.values().stream().reduce(Math::min).orElse(0);
collector.collect(new Tuple2<>(timePoint, maxDegree - minDegree));

// DEGREES
EXPECTED_BOTH_DEGREES.add(new Tuple2<>(Long.MIN_VALUE, 0));
EXPECTED_BOTH_DEGREES.add(new Tuple2<>(0L, 1));
EXPECTED_BOTH_DEGREES.add(new Tuple2<>(4L, 3));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected value should be 2 here, since max is 3 and min is 1.

@ChrizZz110 ChrizZz110 marked this pull request as draft November 22, 2023 10:12
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.

2 participants