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

#1571 Add degree variance evolution operator #1584

Open
wants to merge 2 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 #1571 degree variance evolution #1571 Add degree variance evolution operator Aug 11, 2022
!
@@ -0,0 +1,19 @@
[#1559] add unit-tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this file ?

* Creates an instance of this group reduce function.
*
*/
public GroupDegreeTreesToVariance() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed.


if (opt.isPresent()) {
mean = (double) opt.get() / (double) numberOfVertices;
opt2 = Optional.of(vertexDegrees.values().stream()
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 are using an optional here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please work with primitive types after fetching the values from the optionals. with Optional::orElse() you can define a value in the case of no value in optional.

*/
@FunctionAnnotation.ForwardedFields("f0")
public class TransformDeltaToAbsoluteDegreeTree
implements MapFunction<Tuple2<GradoopId, TreeMap<Long, Integer>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong indentation.

@FunctionAnnotation.ForwardedFields("f0")
public class TransformDeltaToAbsoluteDegreeTree
implements MapFunction<Tuple2<GradoopId, TreeMap<Long, Integer>>,
Tuple2<GradoopId, TreeMap<Long, Integer>>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong indentation.

Collection<Tuple2<GradoopId, String>> idLabelCollection = new HashSet<>();
testGraph.getVertices().map(v -> new Tuple2<>(v.getId(), v.getLabel()))
.returns(new TypeHint<Tuple2<GradoopId, String>>() {
}).output(new LocalCollectionOutputFormat<>(idLabelCollection));
Copy link
Contributor

Choose a reason for hiding this comment

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

Move }) to line above.

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

Do you need this?

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