From 7b1fa6480dadb1c725d37f3b551d24ac8aa9b7d6 Mon Sep 17 00:00:00 2001 From: katieb1 Date: Wed, 6 Dec 2023 09:48:43 -0800 Subject: [PATCH] Fix the name and project functions --- R/internalHelpers.R | 6 ++++-- R/project.R | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/internalHelpers.R b/R/internalHelpers.R index 4e6a1578..cec9d132 100644 --- a/R/internalHelpers.R +++ b/R/internalHelpers.R @@ -147,6 +147,9 @@ getScnSet <- function(ssimObject) { ScenarioID <- NULL tt <- command(list(list = NULL, scenarios = NULL, csv = NULL, lib = .filepath(ssimObject)), .session(ssimObject)) scnSet <- .dataframeFromSSim(tt, localNames = FALSE, convertToLogical = c("IsReadOnly")) + names(scnSet)[names(scnSet) == "Id"] <- "ScenarioID" + names(scnSet)[names(scnSet) == "ProjectId"] <- "ProjectID" + names(scnSet)[names(scnSet) == "ParentId"] <- "ParentID" if (nrow(scnSet) == 0) { scnSet <- merge(scnSet, data.frame(ScenarioID = NA, exists = NA), all = TRUE) scnSet <- subset(scnSet, !is.na(ScenarioID)) @@ -164,7 +167,7 @@ getProjectSet <- function(ssimObject) { if (nrow(projectSet) == 0) { projectSet[1, "ProjectID"] <- NA } - # names(projectSet)[names(projectSet) == "iD"] <- "projectId" + names(projectSet)[names(projectSet) == "Id"] <- "ProjectID" projectSet$exists <- TRUE projectSet <- subset(projectSet, !is.na(ProjectID)) return(projectSet) @@ -723,7 +726,6 @@ datasheets <- function(x, project = NULL, scenario = NULL, scope = NULL, refresh stop("Can't create new scenarios because there is more than one project in the ssimObject. Please specify the Project ssimObject to which new scenarios should belong.") } if (nrow(allProjects) == 0) { - browser() obj <- project(ssimObject, project = "project1") project <- .projectId(obj) } else { diff --git a/R/project.R b/R/project.R index fe54ded2..7987dff6 100644 --- a/R/project.R +++ b/R/project.R @@ -5,7 +5,6 @@ NULL setMethod(f = "initialize", signature = "Project", definition = function(.Object, ssimLibrary, name = NULL, id = NULL, projects = NULL, sourceProject = NULL) { - browser() ProjectID <- NULL Name <- NULL @@ -310,7 +309,6 @@ project <- function(ssimObject = NULL, project = NULL, sourceProject = NULL, sum if (projExists) { projectList[[as.character(projectsToMake$ProjectID[i])]] <- new("Project", ssimObject, id = cRow$ProjectID, projects = subset(allProjects, !is.na(exists)), sourceProject = sourceProject) } else { - browser() obj <- new("Project", ssimObject, name = cRow$Name, projects = subset(allProjects, !is.na(exists)), sourceProject = sourceProject) projectList[[as.character(.projectId(obj))]] <- obj }