pyLAVA Setup and Requirements
Setting Up a Virtual Environment
We recommend using a virtual environment to isolate dependencies for this project. While venv is the easiest option since it’s part of the standard Python library, you are free to use conda or any other environment management tool you prefer.
Create a virtual environment:
Activate the environment: Verify that Python now points to the virtual environment:Accessing pyLAVA
On the NAS Cluster
On the NAS cluster, pylava is provided as part of the LAVA modules.
Information on loading the module is provided in the LAVA Installation Guide for NAS Users.
Loading one of the LAVA modules will append the PYTHONPATH environment variable to include the path to the pylava package.
This will provide python access to pylava without needing to install it in your own environment.
External Installation
To obtain pylava on a machine outside the NAS Cluster, first download the correct LAVA tarball by following the LAVA Installation Guide for External Users.
Once extracted, the directory structure will look like this:
pylava package is available as an installed package in /path/to/LAVA/lib/pylava/pylava.
Method 1 : pip install
Start by navigating to the pyLAVA root folder, LAVA/lib/pylava. From this directory using pip should add it to your python, environment.
Note
If you have permission errors when installing try changing the permission of the LAVA tarball directories to allow reading and writing.
Method 2 : Modify the PYTHONPATH
To make pylava accessible in your Python environment, add its parent directory to your PYTHONPATH:
To verify the installation, run:
This will display details like version, location, and dependencies, confirming that Python can find the package.Method 3 : Append the path in your Python scripts
If you prefer not to modify PYTHONPATH globally, add the following lines at the top of your Python script:
Requirements for pyLAVA
The pylava package is not shipped with the necessary dependencies.
You will need to install the required packages manually.
The required packages depend on the type of case you plan to run: simply running aerodynamic analyses through pylava requires fewer packages than running shape optimization cases. We provide details below.
Aerodynamic Analysis Requirements
In addition to pylava itself, the following python packages are required for running the aerodynamic analysis cases
(i.e. non-optimization cases).
| Package Name | Package Site | Description | Tested Version |
|---|---|---|---|
numpy |
link | Fundamental package for array computing in Python | 2.4.2 |
pyYAML |
link | YAML parser and emitter for Python | 6.0.3 |
mpi4py |
link | Python bindings for MPI (only required if running MPI) | 4.0.0 |
Optimization Requirements
In addition to pylava itself, the following python packages are required for running shape optimization cases through the pylava package.
Some of these can be installed via pip, while others need to be installed from their respective GitHub repositories.
Please visit the provided links for installation instructions.
| Package Name | Package Site | Description | Tested Version |
|---|---|---|---|
numpy |
link | Fundamental package for array computing in Python | 2.4.2 |
pyYAML |
link | YAML parser and emitter for Python | 6.0.3 |
pandas |
link | Powerful data structures for data analysis, time series, and statistics | 3.0.0 |
tabulate |
link | Pretty-print tabular data | 0.9.0 |
pyspline |
link | Python tools for B-spline curves, surfaces, volumes | 1.5.3 |
pygeo |
link | Object-oriented geometry framework for MDO and CAD. | 1.17.0 |
pyoptsparse |
link | Framework for efficient large-scale nonlinear optimization | 2.14.5 |
mpi4py |
link | Python bindings for MPI | 4.0.0 |
If you plan to vizualize the optimization history using pyoptsparse's optview, you will need to install the following packages
| Package Name | Package Site | Description | Tested Version |
|---|---|---|---|
pyoptsparse.optview |
link | Interactive visualization of optimization history | 2.14.5 |
OpenMDAO-Based Optimization Requirements
For connecting to OpenMDAO, the following packages are required,
| Package Name | Package Site | Description | Tested Version |
|---|---|---|---|
numpy |
link | Fundamental package for array computing in Python | 2.4.2 |
pyYAML |
link | YAML parser and emitter for Python | 6.0.3 |
openMDAO |
link | Multidisciplinary optimization framework | 3.42.0 |
MPhys |
link | Multiphysics framework built on OpenMDAO | 2.0.0 |
Additionally, for MPI support, you will require the following packages
| Package Name | Package Site | Description | Tested Version |
|---|---|---|---|
mpi4py |
link | Python bindings for MPI | 4.0.0 |
petsc4py |
link | PETSc for Python | 3.24.2 |