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

More Comprehensive State Integrity Checking #209

Open
brodieG opened this issue Feb 23, 2017 · 0 comments
Open

More Comprehensive State Integrity Checking #209

brodieG opened this issue Feb 23, 2017 · 0 comments
Milestone

Comments

@brodieG
Copy link
Owner

brodieG commented Feb 23, 2017

Related to #197, it would be good to confirm that all the values in [email protected][[i]]@glob.indices actually map to a value in [email protected] when unitizers are stored and loaded. There is some dummy code commented out in R/load.R load() as of 812212b that does this, also copied here:

    # # check for and normalize state issues; this came up as a result of #197
    # # where our state objects were corrupted; really this should be handled
    # # in a more systematic way like we do for broader validation; if this
    # # happens more often we can look into that;
    # # NOTE: figured out what was going on here so commenting this out for now

    # ref.indices <- do.call(
    #   cbind,
    #   lapply(
    #     unitizers[[i]]@items.ref,
    #     function(z) as.integer(slot(z, "glob.indices"))
    #   )
    # )
    # ref.state <- lapply(
    #   slotNames(unitizers[[i]]@state.ref),
    #   function(z) length(slot(unitizers[[i]]@state.ref, z))
    # )
    # if(!identical(names(ref.state), names(ref.indices)))
    #   stop(
    #     "Internal error: incompatible global index structure; ",
    #     "contact maintainer"
    #   )

    # if(
    #   any(
    #     unlist(
    #       Map(
    #         function(v, w) any(v > w),
    #         split(ref.indices, row(ref.indices), ref.state), ref.state
    #   ) ) )
    # ) {
    #   meta_word_msg(
    #     "Unitizer ", i, " has corrupted state indices, we are resetting ",
    #     "them to NULL, which means review of reference tests will not ",
    #     "correctly reflect the reference states.  This is not expected ",
    #     "behavior and you should contact maintainer if it persists.", sep=""
    #   )
    #   glob.ind.def <- new("unitizerGlobalIndices")
    #   for(j in seq_along(unitizers[[i]]@items.ref))
    #     unitizers[[i]]@items.ref[[j]]@glob.indices <- glob.ind.def
    # }
@brodieG brodieG added this to the 1.5.0 milestone Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant