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

Base active ranges computation on multiple data sources and adapt first activity #160

Merged
merged 22 commits into from
May 28, 2019

Conversation

klaraschlueter
Copy link

Prerequisites

  • I adhere to the coding conventions (described here) in my code.
  • I have updated the copyright headers of the files I have modified.
  • I have written appropriate commit messages, i.e., I have recorded the goal, the need, the needed changes, and the location of my code modifications for each commit. This includes also, e.g., referencing to relevant issues.
  • I have put signed-off tags in all commits.
  • I have updated the changelog file NEWS.md appropriately.
  • The pull request is opened against the branch dev.

Description

Adresses issue #92: The function add.vertex.attribute.active.ranges is complemented by the possibility to base the computation on multiple data sources. The flag "combine.all.activity.types" is introduced, indicating if the generated vertex attribute contains one list per data source or a single list for all data sources. The default value in both first activity and active ranges is used as default per author and type. The default appended as vertex attribute is constructed from the given default analogously to the vertex attributs actually containing data.

Changelog

Added

  • It is now possible to base the computation of the vertex attribute active.ranges on multiple data sources. Furthermore, the flag combine.all.activity.types of the function add.vertex.attribute.active.ranges indicates, if the generated vertex attribute contains a list of ranges for every data source or one combined list of ranges. (926afbb, babddbd,
    674372b)

Changed/Improved

  • In first activity computation, the default.value is now used analogous to active ranges computation. The given value is used as default per author and type. As vertex default, a value of the same type as given attributes is constructed. (94cf102, 8ea6f54)

Copy link
Collaborator

@bockthom bockthom left a comment

Choose a reason for hiding this comment

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

Thanks for your pull request, @klaraschlueter.

It looks really good, even if I did not yet comprehend all the fancy functions in detail.

However, I already identified some minor issues and questions. Please have a look at them.

Copy link
Collaborator

@clhunsen clhunsen left a comment

Choose a reason for hiding this comment

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

Thank you very much for your work, @klaraschlueter. I see that this is quite some complex stuff you are dealing with. 😲 I was not aware of this in that detail...

I have annotated some minor issues. Additionally, we need to talk about the function list.by.inner.level in more detail and probably in a face-to-face meeting. Unfortunately, I do not get all the details yet.

@clhunsen clhunsen added this to the v3.5 milestone May 13, 2019
Klara added 20 commits May 27, 2019 11:51
The function add.vertex.attribute.active.ranges is adapted. It is possible now
to call it with a vector of multiple activity types. The lists containing active
ranges per type and author as before are combined to a list containing an element
for every given activity type and added as vertex attribute.

Signed-off-by: Klara Schlueter <[email protected]>
Move functionality of compute.attr from add.vertex.attribute.active.ranges to
the new funciton get.active.ranges.data (refactoring). Move the
match.arg.or.default call for the activity.types from
add.vertex.attribute.first.activity to get.first.activity.data for internal
consistency and analogy between first activity and active ranges.

Signed-off-by: Klara Schlueter <[email protected]>
The innermost list in vertex attributes computed by
add.vertex.attribute.active.ranges contains ranges as Strings. This range list
was named with these same range describing Strings, e.g. list("range1" =
"range1", "range2" = "range2"). This commit removes the names.

Signed-off-by: Klara Schlueter <[email protected]>
Add function get.expected.active.ranges to return expected active.ranges data
and call in test.

Signed-off-by: Klara Schlueter <[email protected]>
The function add.vertex.attribute.first.activity already provided a parameter
default.value. This parameter is now interpreted as default per person and data
source and the function get.first.activity.data is adapted to use it properly.

Signed-off-by: Klara Schlueter <[email protected]>
If first activity computation is done per data source (instead of over all data
sources), construct the default value for the whole vertex attribute as a list
of the same structure as given attributes, containing as elements the default
value per author and data source.

Signed-off-by: Klara Schlueter <[email protected]>
If active ranges computations is done per data source (instead of over all data
sources), construct the default value for the whole vertex attribute as a list
of the same structure as given attributes, containing as elements the default
value per author and data source.

Signed-off-by: Klara Schlueter <[email protected]>
The functions add.vertex.attribute.first.activity and
add.vertex.attribute.active.ranges both accept a parameter default.value. This
given value is interpreted as default value per type and author (not as default
attribute for vertices for which no data is available). It is distinguished from
the constructed vertex default and added to the vertex attributes in the
corresponding helper functions.

Signed-off-by: Klara Schlueter <[email protected]>
The test verifies that the function add.active.ranges inserts the expected
default values both for vertices (author unknown in active ranges data) and for
active ranges (missing information per known author and activity type).

Signed-off-by: Klara Schlueter <[email protected]>
The flag combine.all.activities of the function
add.vertex.attribute.active.ranges indicates, if the vertex attribute should
contain a list of ranges per data source or one list for all data sources. The
functionality for the second possibility is implemented in this commit.

Signed-off-by: Klara Schlueter <[email protected]>
Test the functionality introduced in 674372b1ee4d2733e6d9c471efdecf42b470d2e3.

Signed-off-by: Klara Schlueter <[email protected]>
Refactor and adapt active ranges and first activity.

Signed-off-by: Klara Schlueter <[email protected]>
Signed-off-by: Klara Schlueter <[email protected]>
Signed-off-by: Klara Schlueter <[email protected]>
Add spaces between "if" and "(", add documentation for default values,
clarify example for finding minima in first activity computation.

Signed-off-by: Klara Schlueter <[email protected]>
Apply documentation conventions and give input-output example
for list.by.inner.level.

Signed-off-by: Klara Schlueter <[email protected]>
..and remove unused parameter from helper function.

Signed-off-by: Klara Schlueter <[email protected]>
clhunsen
clhunsen previously approved these changes May 27, 2019
Copy link
Collaborator

@clhunsen clhunsen left a comment

Choose a reason for hiding this comment

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

Hi @klaraschlueter,

thank you very much for your patience and endurance! The PR looks fine for me, I just have suggestions for very minor refactorings and renamings in the tests that you added.

This is the last iteration from my side. 😀👍

Signed-off-by: Klara Schlueter <[email protected]>
bockthom
bockthom previously approved these changes May 27, 2019
Copy link
Collaborator

@bockthom bockthom left a comment

Choose a reason for hiding this comment

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

Thanks @klaraschlueter. This PR really contains a nicely implemented and useful feature. Thank you also for your endurance regarding finding appropriate function names 😉

I have no further suggestions regarding the functionality and implementation details of this PR. Looks good now!

Nonetheless, there is one minor issue which needs to be fixed before merging:
During rebasing, commit hashes change. As you have rebased today, the commit hashes in the changelog file "NEWS.md" are not valid any more. Could you please update them (see comments below.)? Thanks a lot! As soon as those are updated, I will merge this PR.

@bockthom bockthom merged commit 39b3651 into se-sic:dev May 28, 2019
@bockthom bockthom mentioned this pull request May 28, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants