Skip to content

Commit

Permalink
fix(SoftwareSession): make environment optional
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Oct 28, 2019
1 parent cd9e5b7 commit 85e05af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions py/stencila/schema/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1968,25 +1968,25 @@ class SoftwareSession(Thing):
by software to execute.
"""

environment: "SoftwareEnvironment"
cpuLimit: Optional[float] = None
cpuRequested: Optional[float] = None
dateEnd: Optional[Union["Date", str]] = None
dateStart: Optional[Union["Date", str]] = None
environment: Optional["SoftwareEnvironment"] = None
memoryLimit: Optional[float] = None
memoryRequested: Optional[float] = None
status: Optional["ESessionStatus"] = None
volumeMounts: Optional[Array["VolumeMount"]] = None

def __init__(
self,
environment: "SoftwareEnvironment",
alternateNames: Optional[Array[str]] = None,
cpuLimit: Optional[float] = None,
cpuRequested: Optional[float] = None,
dateEnd: Optional[Union["Date", str]] = None,
dateStart: Optional[Union["Date", str]] = None,
description: Optional[Union[str, Array["Node"]]] = None,
environment: Optional["SoftwareEnvironment"] = None,
id: Optional[str] = None,
memoryLimit: Optional[float] = None,
memoryRequested: Optional[float] = None,
Expand All @@ -2004,8 +2004,6 @@ def __init__(
name=name,
url=url
)
if environment is not None:
self.environment = environment
if cpuLimit is not None:
self.cpuLimit = cpuLimit
if cpuRequested is not None:
Expand All @@ -2014,6 +2012,8 @@ def __init__(
self.dateEnd = dateEnd
if dateStart is not None:
self.dateStart = dateStart
if environment is not None:
self.environment = environment
if memoryLimit is not None:
self.memoryLimit = memoryLimit
if memoryRequested is not None:
Expand Down
6 changes: 3 additions & 3 deletions r/R/types.R
Original file line number Diff line number Diff line change
Expand Up @@ -2343,13 +2343,13 @@ SoftwareEnvironment <- function(
#' Represents a runtime session with the resources and image that is required by software to execute.
#'
#' @name SoftwareSession
#' @param environment Definition of the environment to execute this session in. \bold{Required}.
#' @param alternateNames Alternate names (aliases) for the item.
#' @param cpuLimit The amount of CPU the session has been limited to.
#' @param cpuRequested The amount of CPU requested for the session.
#' @param dateEnd The date-time that the session ended
#' @param dateStart The date-time that the session began
#' @param description A description of the item.
#' @param environment Definition of the environment to execute this session in.
#' @param id The identifier for this item.
#' @param memoryLimit The amount of memory that the session has been limited to.
#' @param memoryRequested The amount of memory requested for the session.
Expand All @@ -2361,13 +2361,13 @@ SoftwareEnvironment <- function(
#' @seealso \code{\link{Thing}}
#' @export
SoftwareSession <- function(
environment,
alternateNames,
cpuLimit,
cpuRequested,
dateEnd,
dateStart,
description,
environment,
id,
memoryLimit,
memoryRequested,
Expand All @@ -2386,11 +2386,11 @@ SoftwareSession <- function(
url = url
)
self$type <- as_scalar("SoftwareSession")
self[["environment"]] <- check_property("SoftwareSession", "environment", TRUE, missing(environment), "SoftwareEnvironment", environment)
self[["cpuLimit"]] <- check_property("SoftwareSession", "cpuLimit", FALSE, missing(cpuLimit), "numeric", cpuLimit)
self[["cpuRequested"]] <- check_property("SoftwareSession", "cpuRequested", FALSE, missing(cpuRequested), "numeric", cpuRequested)
self[["dateEnd"]] <- check_property("SoftwareSession", "dateEnd", FALSE, missing(dateEnd), Union("Date", "character"), dateEnd)
self[["dateStart"]] <- check_property("SoftwareSession", "dateStart", FALSE, missing(dateStart), Union("Date", "character"), dateStart)
self[["environment"]] <- check_property("SoftwareSession", "environment", FALSE, missing(environment), "SoftwareEnvironment", environment)
self[["memoryLimit"]] <- check_property("SoftwareSession", "memoryLimit", FALSE, missing(memoryLimit), "numeric", memoryLimit)
self[["memoryRequested"]] <- check_property("SoftwareSession", "memoryRequested", FALSE, missing(memoryRequested), "numeric", memoryRequested)
self[["status"]] <- check_property("SoftwareSession", "status", FALSE, missing(status), Enum("unknown", "starting", "started", "stopping", "stopped", "failed"), status)
Expand Down
2 changes: 0 additions & 2 deletions schema/SoftwareSession.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,3 @@ properties:
type: array
items:
- $ref: VolumeMount
required:
- environment

0 comments on commit 85e05af

Please sign in to comment.