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

Solves differences between C++ and R estimation engines #84

Merged
merged 18 commits into from
Jun 21, 2023
Merged

Conversation

auzaheta
Copy link
Collaborator

Description

  • Solves startTime and endTime bug on DyNAM and REM models
    preprocessing.
  • Clean unnecessary functions imports.
  • Solves aes_string() deprecation.
  • Solves issue on C++ engine on DyNAM-rate.
  • Enforcing an 80-character line length on C++ code.
  • Comply with code style.
  • Changes that reduce execution time in the R estimation engine.

Fixes #71
Closes #39

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • The package builds on my OS without issues (please add workstation details)
  • My changes generate no new warnings
  • My code follows the style guidelines of this project
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (.R, NEWS.md)
  • I have bumped the version by the appropriate increment in the DESCRIPTION file (major, minor, patch)

Sorry, something went wrong.

@auzaheta auzaheta requested a review from jhollway June 20, 2023 20:27
@auzaheta auzaheta self-assigned this Jun 20, 2023
Comment on lines +385 to +386
For more, please see Hollway (2020) Network Embeddedness and
the Rate of Water Cooperation and Conflict.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hollway, James. 2020. “Network Embeddedness and the Rate of Water Cooperation and Conflict.” Pp. 87–113 in Networks in Water Governance, edited by M. Fischer and K. Ingold. Cham: Springer International Publishing.

library(goldfish)
data("RFID_Validity_Study")
#?RFID_Validity_Study


## -----------------------------------------------------------------------------------------------------------
## ----------------------------------------------------------------------------------------------------------------------
head(participants)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder whether we should change all these vignettes to tutorials. I think tutorials better fits how we use tutorials in courses, for example, and helps trim the size/testing burden of the package too. See manynet/migraph for how we have done it there.

Comment on lines 23 to +25
This vignette summarizes effects that are implemented in `goldfish` and
are thus available to be used with actor-oriented DyNAM models and tie-oriented Relational Event Models.
are thus available to be used with actor-oriented DyNAM models and
tie-oriented Relational Event Models.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there anything actually run in this vignette, or is it 'just' an information page.

add_node_attribute("floor", actors$floor)

autographr(callNetworkHlf, labels = FALSE, layout = "fr") +
geom_node_point(aes(color = as.factor(floor)), size = 2, show.legend = FALSE)

# The network at the end
callNetworkEnd <- as.matrix(callNetwork, time = max(calls$time) + 1) |>
callNetworkEnd <- as.matrix(callNetwork, time = max(calls$time) + 1) |>
add_node_attribute("floor", actors$floor)

autographr(callNetworkEnd, labels = FALSE, layout = "fr") +
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using vignettes means the plots will be changed everytime they are run, inflating the repository etc for no good reason. If they are illustrative, can they be moved to the README? If they are for learning/discovery, can they be in tutorials?

Comment on lines +1 to +2
test_that(
"out/in/deg weighted right censored preprocessing",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Excellent job adding all these very important tests, @auzaheta , thank you!

Comment on lines -163 to -165
#' @importFrom changepoint cpt.mean cpt.var
#' @importFrom ggplot2 ggplot aes geom_line geom_point theme_minimal xlab ylab
#' geom_vline scale_x_continuous theme element_text
Copy link
Collaborator

Choose a reason for hiding this comment

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

These still seem to be required below, e.g. lines 208 and 212

Comment on lines +32 to +33
if ("cache" %in% .argsNames) cache <- stats
else cache <- NULL
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we are keen to use {rlang} as a dependency, there is also rlang::%||%, which might be useful here.

@@ -52,7 +51,7 @@ defineGroups_interaction <- function(records, actors, seed.randomization,
stopifnot(
inherits(records, "data.frame"),
inherits(actors, "data.frame"),
is(seed.randomization, "numeric"),
methods::is(seed.randomization, "numeric"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think a methods dependency needs to be declared?

@auzaheta auzaheta merged commit 74481fa into main Jun 21, 2023
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.

C and R engine results differ for rate model Preprocessing start-time and end-time bug
2 participants