Skip to content
generated from ansys/template

Pythonic interface to Ansys RedHawk-SC, Totem-SC and other seascape tools

License

Notifications You must be signed in to change notification settings

ansys/pyseascape

Repository files navigation

PySeascape Library

PyAnsys PyPI MIT Black

A pythonic remotable interface to RedhawkSC and TotemSC that allows integration with other PyAnsys and Python libraries.

How to install

Install from PyPI

User installation can be performed by running:

pip install ansys-seascape

OR

python -m pip install ansys-seascape

Install from latest Github source

Fetch latest source from github:

cd <your-library-directory>
git clone https://github.com/pyansys/pyseascape.git

(Optional) Create and enable virtual environment. Please refer to official venv documentation for more help regarding virtual environment setup.

# Create a virtual environment
python -m venv .venv

# Activate it in a POSIX system
source .venv/bin/activate

# Activate it in Windows CMD environment
.venv\Scripts\activate.bat

# Activate it in Windows Powershell
.venv\Scripts\Activate.ps1

Run the setup script

cd pyseascape
python setup.py install

Install additional requirements (if needed):

python -m pip install -r requirements/requirements_build.txt
python -m pip install -r requirements/requirements_doc.txt
python -m pip install -r requirements/requirements_tests.txt

Usage

Note: Either a local installation or remote connection to licensed Redhawk-SC is required to use the pyseascape library. This only offers a remotable frontend interface that can run directly in native Python on any machine.

Launching local Redhawk-SC in backend

from ansys.seascape import RedhawkSC
gp = RedhawkSC(executable=path_to_executable)

OR

from ansys import seascape
gp = seascape.RedhawkSC(executable=path_to_executable)

Connecting to remote Redhawk-SC session

from ansys.seascape import RedhawkSC
gp = RedhawkSC(url=url_or_ip_to_redhawksc_server:port)

All Redhawk-SC global functions can be called using prefix of RedhawkSC object name. Object methods can be called as normal.

Running Redhawk-SC commands

For example:

# If gp = RedhawkSC(...)
db = gp.open_db(db_name)  # Returns a SeascapeDB remotable object
db.create_design_view(...)

# Creating Redhawk-SC objects
inst = gp.Instance('Inst_Name')

# Redhawk-SC modules must also be prefixed by gp
# E.g. using voltage_impact module
gp.voltage_impact.helpers.get_pgimpact_histograms(...)

Using TotemSC

Using TotemSC is same as RedhawkSC where user needs to import TotemSC instead of RedhawkSC.

Accessing Redhawk-SC help

Redhawk-SC native help function supports command based as well as keyword based help. This help can be accessed remotely as well.

# If gp = RedhawkSC(...)

# command based help
gp.help(command='gp.Scatter')

# keyword based help
gp.help(keyword='scatter')

Known issues and limitations

GUI features have not yet been implemented. Hence, commands like open_console_window, open_scheduler_window etc. will not work yet. Commands like gp.scatter_plot will also not work as it requires drawing gui plots

Documentation

Please refer to Redhawk-SC Documentation.


About

Pythonic interface to Ansys RedHawk-SC, Totem-SC and other seascape tools

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages