Elipse Plant Manager — EPM Web API

Version 5.0.45

epmwebapi.datasetconfig

class PeriodUnit(enum.Enum):

Enumeration with all available period units.

Second = <PeriodUnit.Second: 1>
Minute = <PeriodUnit.Minute: 2>
Hour = <PeriodUnit.Hour: 3>
Day = <PeriodUnit.Day: 4>
Month = <PeriodUnit.Month: 5>
Inherited Members
enum.Enum
name
value
class DatasetConfig:

Class representing an EPM Dataset.

DatasetConfig(connection, name, description=None)
REGEX_PATTERN = '^[^a-z_]+|[^a-z0-9\\.\\:\\%\\&\\@\\!\\-\\#_]+|[^a-z0-9]+$|.{{{0},}}'
NAME_MAX_SIZE = 50
DESCRIPTION_MAX_SIZE = 500
name: str

Returns the name of a Dataset.

Returns

A str with the name of a Dataset.

description: str

Returns the description of a Dataset.

Returns

A str with the description of a Dataset.

startTime: datetime.datetime

Returns the starting time of a Dataset.

Returns

A datetime representing the starting time of a Dataset.

endTime: datetime.datetime

Returns the ending time of a Dataset.

Returns

A datetime representing the ending time of a Dataset.

period: Union[datetime.timedelta, dateutil.relativedelta.relativedelta]

Returns the period interval of a Dataset.

Returns

A timedelta or a relativedelta value with the interval of a Dataset.

isTimeInterval: bool

Returns whether the type of a Dataset is a TimeInterval.

Returns

True if the type of a Dataset is a TimeInterval or False otherwise.

datasetPens: List[epmwebapi.datasetpen.DatasetPen]
def setName(self, name: str):

Sets a name for a Dataset.

Parameters
  • name: A new name for a Dataset.
Raises
  • Exception: Invalid name length.
  • Exception: Invalid character on the name.
  • Exception: Name must be a str.
def setDescription(self, description: str):

Sets a new description for a Dataset.

Parameters
  • description: A new description for a Dataset.
Raises
  • Exception: Invalid description length.
  • Exception: Description must be a str.
def timeIntervalConfig(self, startTime: datetime.datetime, endTime: datetime.datetime):

Sets a time interval for a Dataset.

Parameters
  • startTime: Starting time interval.
  • endTime: Ending time interval.
Raises
  • Exception: The startTime parameter must be before the endTime parameter.
  • Exception: Both parameters must have a datetime data type.
def recentPeriodConfig(self, count: int, periodUnit: PeriodUnit):

Sets a recent period interval of a Dataset.

Parameters
  • count: Number of Period Units.
  • periodUnit: Type of Period Unit. Possible values are Second, Minute, Hour, Day, or Month.
Raises
  • Exception: The count parameter must be an Integer.
  • Exception: The periodUnit parameter must have a PeriodUnit data type.
def addPen( self, title: str, dataSourceName: str = None) -> epmwebapi.datasetpen.DatasetPen:

Adds a new Pen to a Dataset.

Parameters
  • title: Title of this new Pen.
  • dataSourceName: Optional parameter with a data source for this Pen. Default is None.
Returns

A new epmwebapi.datasetpen.DatasetPen object.

Raises
  • Exception: Pen title already exists.
def getPen(self, title: str) -> epmwebapi.datasetpen.DatasetPen:

Returns a Pen from this Dataset.

Parameters
  • title: Title of a Pen.
Returns

An epmwebapi.datasetpen.DatasetPen object.

Raises
  • Exception: Pen not found.
def removePen(self, title: str):

Removes a Pen from this Dataset.

Parameters
  • title: Title of a Pen to remove.
Raises
  • Exception: Pen not found.
def execute(self) -> numpy.ndarray:

Executes this Dataset.

Returns

The result of the execution of this Dataset as an np.ndarray object.

def saveToFile(self, path: str, overwrite: bool = False):

Saves the configuration of this Dataset to a file.

Parameters
  • path: Path to a file.
  • overwrite: Optional parameter indicating whether the configuration file must be overwritten. Default is False.
def saveToLocal(self, overwrite: bool = False):

Saves the configuration of this Dataset to the local user's Documents folder.

Parameters
  • overwrite: Optional parameter indicating whether the configuration file must be overwritten. Default is False.
def saveToServer(self, overwrite: bool = False):

Saves the configuration of this Dataset to an EPM Server.

Parameters
  • overwrite: Optional parameter indicating whether the configuration must be overwritten. Default is False.
class DatasetConfigLocal(DatasetConfig):

Class representing a local Dataset.

DatasetConfigLocal(connection, name, content=None, description=None, filePath=None)
filePath: str

File path of a local Dataset.

Returns

A str representing the path of a local Dataset.

def setName(self, name: str):

Sets a name for a local Dataset.

Parameters
  • name: Name for a local Dataset.
Raises
  • Exception: Invalid name length.
  • Exception: Invalid character on name.
  • Exception: The name parameter must be a str.
def save(self):

Saves a local Dataset to a file.

Raises
  • Exception: Local Dataset changed but there is another Dataset with this name on the same folder.
  • Exception: There is no Dataset file to save. Please use the saveToFile or saveToLocal methods.
def delete(self):

Deletes a local Dataset.

def duplicate( self, newName: str, samePath: bool = True) -> DatasetConfig:

Creates a copy of a local Dataset.

Parameters
  • newName: A name for the copy of this local Dataset.
  • samePath: An optional parameter indicating whether the new local Dataset has the same path of this local Dataset. Default is True.
Returns

A DatasetConfigLocal object as a copy of this local Dataset.

Raises
  • Exception: Dataset has no file on folder.
  • Exception: Dataset already exists.
class DatasetConfigServer(DatasetConfig):

Class representing a Dataset from an EPM Server.

DatasetConfigServer(connection, name, description, content=None)
def setName(self, name: str):

Sets the name of this Dataset.

Parameters
  • name: Name of this EPM Server Dataset.
Raises
  • Exception: Invalid name length.
  • Exception: Invalid character on name parameter.
  • Exception: The name argument must be a str.
def save(self):

Saves this Dataset to an EPM Server.

Raises
  • Exception: Dataset name changed but there is another Dataset with the same name on the EPM Server.
def delete(self):

Deletes this Dataset from the EPM Server.

def duplicate(self, newName: str) -> DatasetConfig:

Creates a copy of this Dataset from the current EPM Server.

Parameters
  • newName: A name for the copy of this Dataset.
Returns

A copy of this Dataset.

Raises
  • Exception: A duplicated Dataset must have a different name.
  • Exception: There is another Dataset with the same name on the EPM Server.