> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# py_project

This module provides access to project settings.

Placeholders in project can be constructed in the following way (based on a oscillator example):

```python theme={null}
# complete example in examples 02_python_examples/01_console/placeholders/create_oscillator_plus_placeholder.py
# reduced snippet with only one parameter

import py_placeholder

# create some placeholders
sensi = find_actor("oscillator")
project.create_placeholder_from_actor_property( actor_uuid = sensi.uuid, property_id = 'ParameterManager', create_as_expression = True )

project.set_placeholder( name='P_D_ref_val', user_level=py_placeholder.PLACEHOLDER_USERLEVEL_COMPUTATION_ENGINEER, value=0.02, value_type=py_placeholder.PLACEHOLDER_TYPE_REAL )
project.set_placeholder( name='P_D_lower_bound', user_level=py_placeholder.PLACEHOLDER_USERLEVEL_COMPUTATION_ENGINEER, value=0.01, value_type=py_placeholder.PLACEHOLDER_TYPE_REAL )
project.set_placeholder( name='P_D_upper_bound', user_level=py_placeholder.PLACEHOLDER_USERLEVEL_COMPUTATION_ENGINEER, value=0.03, value_type=py_placeholder.PLACEHOLDER_TYPE_REAL )

# Modify parameter manager
pm_expression_string = """
    {
    "parameter_container" :
    [
        {
            "deterministic_property" : {
                "domain_type" : { "value" : "real" },
                "kind" : { "value" : "continuous" },
                "lower_bound" : $(P_D_lower_bound),
                "upper_bound" : $(P_D_upper_bound)
            },
            "name" : "D",
            "reference_value" : $(P_D_ref_val),
            "type" : { "value" : "deterministic" }
        }
    ]
}"""
# Set placeholder expression for parameter manager back to project
project.set_placeholder( name = 'ParameterManager', overwrite = True, expression = pm_expression_string )
```

## *class* py\_project.OSLFileProvider

#### \_\_init\_\_()

Raises an exception
This class cannot be instantiated from Python

## *class* py\_project.Project

#### \_\_init\_\_()

Raises an exception
This class cannot be instantiated from Python

#### assign\_placeholder(actor\_uuid: [UUID](https://developer.synopsys.com/docs/optislang/optislang-python-api/modules/id.md#id.UUID), property\_id: str, placeholder\_id: str)

Assign a placeholder in this project.

Parameters

actor\_uuid
: Unique id to the actor

property\_id
: Property ID.

placeholder\_id
: Placeholder ID.

Raises

RuntimeError
: Raised when placeholder does not exist, or
when property does not exist, or
when placeholder type and property type does not match.

#### create\_placeholder\_from\_actor\_property(actor\_uuid: UUID, property\_id: str) → str

Create placeholder from actor property with new id if id already exist

Parameters

actor\_uuid
: Unique id to the actor.

property\_id
: Name of the actor property.

create\_as\_expression
: Decide if the placeholder is created as value or as macro expression. False by default.

Returns

str
: Actual ID of the generated placeholder.

Raises

RuntimeError
: Raised when property id is not accessible at actor.

#### get\_actions() → [ProjectActions](#py_project.ProjectActions)

Get defined actions for project.

#### get\_file\_provider() → [OSLFileProvider](#py_project.OSLFileProvider)

Get central file registration for project.

#### get\_maximum\_threads() → int

Get the maximum number of threads used by this project.

#### get\_placeholder(placeholder\_id: str) → dict

Get placeholder by id from this project as dict.

Parameters

placeholder\_id
: Placeholder ID.

Returns

dict
name : str

> Placeholder ID.

user\_level
: User level.

description
: Placeholder description.

range
: Placeholder range.

value
: Placeholder value. Datatype should match with the type argument.

type
: Placeholder type.

expression
: Placeholder macro expression.

Raises

RuntimeError
: Raised when the placeholder does not exist.

#### get\_placeholder\_ids() → [WStrList](https://developer.synopsys.com/docs/optislang/optislang-python-api/modules/stdcpp_python_export.md#stdcpp_python_export.WStrList)

Get placeholder ids from this project.

Returns

list
: List of placeholder ids.

#### get\_protocol\_file\_path() → [Path](https://developer.synopsys.com/docs/optislang/optislang-python-api/modules/stdcpp_python_export.md#stdcpp_python_export.Path)

Get the path of the protocol file.

#### get\_root\_system() → [RunnableSystem](https://developer.synopsys.com/docs/optislang/optislang-python-api/modules/_optiSLang_Actors.md#optiSLang_Actors.RunnableSystem)

Get root system.

#### get\_run\_scenario() → [ProjectRunScenario](#py_project.ProjectRunScenario)

Get run scenario for project.

#### get\_state() → [ProjectStatus](#py_project.ProjectStatus)

Get state of project.

#### *property* name

The project’s name as displayed.

#### *property* project\_dir

The project directory. Empty string if the project has not yet been saved.

#### *property* project\_path

The project file path. Empty string if the project has not yet been saved.

#### *property* project\_working\_dir

The project working dir path. Empty string if the project has not yet been saved.

#### *property* reference\_files\_dir

The reference files directory path.

#### remove\_placeholder(placeholder\_id: str)

Remove a placeholder from this project.

Parameters

placeholder\_id
: Placeholder ID.

#### rename\_placeholder(existing\_placdeholder\_id: str, new\_placdeholder\_id: str)

Rename a placeholder in this project.

Parameters

placeholder\_id
: Placeholder ID.

new\_placeholder\_id
: New placeholder ID.

Raises

RuntimeError
: Raised when placeholder does not exist.

#### set\_actions(actions: [ProjectActions](#py_project.ProjectActions))

Set defined actions for project.

#### set\_maximum\_threads(num\_threads: int)

Get the maximum number of threads used by this project.

#### set\_placeholder(, name: object=None \[, user\_level: object=None \[, description: object=None \[, range: object=None \[, value: object=None \[, value\_type: object=None \[, expression: object=None \[, overwrite: bool=False]]]]]]]]) → str

Create a new placeholder or overwrite an existing one.

Parameters:
name : str, optional

> Placeholder ID. In case of creating a new placeholder, the ID may be adapted to maintain ID uniqueness. None by default.

user\_level
: User level. py\_placeholder.PLACEHOLDER\_USERLEVEL\_FLOW\_ENGINEER by default.

description
: Placeholder description. None by default.

range
: Placeholder range. None by default.

value
: Placeholder value. Datatype should match with the type argument. Mutual exclusive with the expression argument. None by default

type
: Placeholder type. py\_placeholder.PLACEHOLDER\_TYPE\_RAW by default.

expression
: Placeholder macro expression. Mutual exclusive with the value argument. None by default.

overwrite
: In case overwrite is True and placeholder is found by name, specified attributes will be overwritten. A new placeholder is created otherwise. False by default.

Returns

str
: Actual ID of the generated/modified placeholder.

Raises

RuntimeError
: Raised when the placeholder cannot be created/modified.

#### *property* settings

Project settings.

#### unassign\_placeholder(actor\_uuid: UUID, placeholder: str id)

Remove a placeholder assignment in this project.

Parameters

actor\_uuid
: Unique id to the actor

property\_id
: Property ID.

## *class* py\_project.ProjectAction

#### \_\_init\_\_()

Raises an exception
This class cannot be instantiated from Python

#### *property* name

Action name.

#### *property* point

Action point.

#### type() → [ProjectActionType](#py_project.ProjectActionType)

Action type.

## *class* py\_project.ProjectActionList

#### \_\_contains\_\_(arg2: object) → bool

#### \_\_delitem\_\_(arg2: object)

#### \_\_getitem\_\_(arg2: object) → object

#### \_\_init\_\_()

#### \_\_iter\_\_() → object

#### \_\_len\_\_() → int

#### \_\_setitem\_\_(arg2: object, arg3: object)

#### append(arg2: object)

#### extend(arg2: object)

#### push(action: [ProjectAction](#py_project.ProjectAction))

#### size() → int

## *class* py\_project.ProjectActionPoint

**Enumeration**

Enumerates possible project action points.

#### PROJECT\_ACTION\_POINT\_ANY *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ANY*

#### PROJECT\_ACTION\_POINT\_NONE *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_NONE*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_ABOUT\_TO\_START *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_ABOUT\_TO\_START*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_OPEN *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_OPEN*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_OPENED *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_OPENED*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_SAVE *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_SAVE*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_SAVED *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_SAVED*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_STARTED *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_STARTED*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_STOPPED *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_STOPPED*

#### PROJECT\_ACTION\_POINT\_ON\_PROJECT\_STOP\_REQUESTED *= py\_project.ProjectActionPoint.PROJECT\_ACTION\_POINT\_ON\_PROJECT\_STOP\_REQUESTED*

## *class* py\_project.ProjectActionRunScript

#### \_\_init\_\_()

#### \_\_init\_\_(arg2: str, arg3: str, arg4: [ProjectActionPoint](#py_project.ProjectActionPoint))

#### *property* script

Script content to execute.

## *class* py\_project.ProjectActionRunScriptFile

#### \_\_init\_\_()

#### \_\_init\_\_(arg2: str, arg3: [ProvidedPath](https://developer.synopsys.com/docs/optislang/optislang-python-api/modules/py_file_access.md#py_file_access.ProvidedPath), arg4: [ProjectActionPoint](#py_project.ProjectActionPoint))

#### *property* script

Script file to execute.

## *class* py\_project.ProjectActionType

**Enumeration**

Enumerates possible project action types.

#### PROJECT\_ACTION\_RUN\_SCRIPT *= py\_project.ProjectActionType.PROJECT\_ACTION\_RUN\_SCRIPT*

#### PROJECT\_ACTION\_RUN\_SCRIPT\_FILE *= py\_project.ProjectActionType.PROJECT\_ACTION\_RUN\_SCRIPT\_FILE*

## *class* py\_project.ProjectActions

#### \_\_init\_\_()

#### *property* actions

Actions container.

#### contains(name: str) → bool

Test if action exists.

#### register(action: [ProjectAction](#py_project.ProjectAction)) → bool

Register project action.

#### unique\_name(base: str) → str

Get unique action name.

#### unregister(name: str) → bool

Unregister project action by name.

## *class* py\_project.ProjectFilenameEscape

**Enumeration**

Enumerates possible filename escape modes.

#### PROJECT\_FE\_FULL *= py\_project.ProjectFilenameEscape.PROJECT\_FE\_FULL*

#### PROJECT\_FE\_RESERVED\_ONLY *= py\_project.ProjectFilenameEscape.PROJECT\_FE\_RESERVED\_ONLY*

## *class* py\_project.ProjectRunScenario

**Enumeration**

Enumerates possible project run scenarios.

#### PROJECT\_RUN\_SCENARIO\_ABORTED *= py\_project.ProjectRunScenario.PROJECT\_RUN\_SCENARIO\_ABORTED*

#### PROJECT\_RUN\_SCENARIO\_FINISHED *= py\_project.ProjectRunScenario.PROJECT\_RUN\_SCENARIO\_FINISHED*

#### PROJECT\_RUN\_SCENARIO\_MODIFIED\_ALL *= py\_project.ProjectRunScenario.PROJECT\_RUN\_SCENARIO\_MODIFIED\_ALL*

#### PROJECT\_RUN\_SCENARIO\_MODIFIED\_SOME *= py\_project.ProjectRunScenario.PROJECT\_RUN\_SCENARIO\_MODIFIED\_SOME*

#### PROJECT\_RUN\_SCENARIO\_PARTIAL *= py\_project.ProjectRunScenario.PROJECT\_RUN\_SCENARIO\_PARTIAL*

#### PROJECT\_RUN\_SCENARIO\_PAUSED *= py\_project.ProjectRunScenario.PROJECT\_RUN\_SCENARIO\_PAUSED*

#### PROJECT\_RUN\_SCENARIO\_PRISTINE *= py\_project.ProjectRunScenario.PROJECT\_RUN\_SCENARIO\_PRISTINE*

## *class* py\_project.ProjectSettings

#### \_\_init\_\_()

#### *property* actors\_ignore\_predecessor\_failure

Actors ignore predecessor failure flag.

#### *property* auto\_save\_enabled

Auto save enabled flag.

#### *property* custom\_location

Custom working directory location.

#### *property* filename\_escape\_mode

Filename escape mode.

#### *property* hide\_number\_of\_message\_queue\_threads\_warning

Hide number of message queue threads warning flag.

#### *property* maximum\_auto\_relocation\_depth

Maximum auto relocation depth.

#### *property* number\_of\_message\_queue\_threads

Number of message queue threads.

#### *property* project\_actions

Project actions.

#### *property* project\_id

Project id.

#### *property* project\_manager\_id

Project manager id.

#### *property* purge\_on\_save

Purge on save flag.

#### *property* reference\_files\_directory\_name

Reference files directory name.

#### *property* remove\_empty\_directories\_on\_purge

Remove empty directories on purge flag.

#### *property* short\_description

Project short description.

#### *property* show\_conditional\_exec\_ui

Conditional execution ui visibility flag.

#### *property* show\_environment\_ui

Environment ui visibility flag.

#### *property* show\_files\_ui

Files ui visibility flag.

#### *property* show\_placeholders\_ui

Placeholders ui visibility flag.

#### *property* show\_run\_options\_ui

Run options ui visibility flag.

#### *property* show\_variables\_ui

Variables ui visibility flag.

#### *property* working\_data\_storage

Working data storage mode.

#### *property* working\_directory\_location

Working directory location.

## *class* py\_project.ProjectStatus

**Enumeration**

Enumerates possible project states.

#### PROJECT\_STATUS\_ABORTED *= py\_project.ProjectStatus.PROJECT\_STATUS\_ABORTED*

#### PROJECT\_STATUS\_ABORT\_REQUESTED *= py\_project.ProjectStatus.PROJECT\_STATUS\_ABORT\_REQUESTED*

#### PROJECT\_STATUS\_FINISHED *= py\_project.ProjectStatus.PROJECT\_STATUS\_FINISHED*

#### PROJECT\_STATUS\_IDLE *= py\_project.ProjectStatus.PROJECT\_STATUS\_IDLE*

#### PROJECT\_STATUS\_PAUSED *= py\_project.ProjectStatus.PROJECT\_STATUS\_PAUSED*

#### PROJECT\_STATUS\_PAUSE\_REQUESTED *= py\_project.ProjectStatus.PROJECT\_STATUS\_PAUSE\_REQUESTED*

#### PROJECT\_STATUS\_PROCESSING *= py\_project.ProjectStatus.PROJECT\_STATUS\_PROCESSING*

#### PROJECT\_STATUS\_STOPPED *= py\_project.ProjectStatus.PROJECT\_STATUS\_STOPPED*

#### PROJECT\_STATUS\_STOP\_REQUESTED *= py\_project.ProjectStatus.PROJECT\_STATUS\_STOP\_REQUESTED*

## *class* py\_project.ProjectWorkingDataStorage

**Enumeration**

Enumerates possible project working data storage modes.

#### PROJECT\_WDL\_EXTERNAL *= py\_project.ProjectWorkingDataStorage.PROJECT\_WDL\_EXTERNAL*

#### PROJECT\_WDS\_EMBEDDED *= py\_project.ProjectWorkingDataStorage.PROJECT\_WDS\_EMBEDDED*

## *class* py\_project.ProjectWorkingDirectoryLocation

**Enumeration**

Enumerates possible project working diretory locations.

#### PROJECT\_WDL\_ALONGSIDE\_PROJECT *= py\_project.ProjectWorkingDirectoryLocation.PROJECT\_WDL\_ALONGSIDE\_PROJECT*

#### PROJECT\_WDL\_CUSTOM *= py\_project.ProjectWorkingDirectoryLocation.PROJECT\_WDL\_CUSTOM*
