Quick Start

This page gives you an introduction on how to get started with PyFieldView. For installation and system requirements, see the installation instructions.

This example loads a Plot3D dataset from <FieldView install>/examples/f18 via fv.home and exports an image.

Getting Started Example

import os

import fieldview as fv


# Resolve the bundled example dataset under the FieldView install root.
data_dir = os.path.join(fv.home, "examples", "f18")

# Load Plot3D (grid + results).
ds = fv.data.load_plot3d(
    os.path.join(data_dir, "f18i9b_g_bin"),
    os.path.join(data_dir, "f18i9b_q_bin"),
)

# Simple query and export.
print("Grids:", ds.num_grids)
output_png = os.path.join(os.path.expanduser("~"), "fv_plot3d.png")
fv.export_png(output_png)
print(f"Saved image: {output_png}")

Related API symbols:

Python Script Errors

Interactive or GUI sessions

When you run a script from Tools > Execute Python File... or from -python, FieldView distinguishes a few different failure cases:

  • Startup or preflight failures: if FieldView cannot initialize a supported Python runtime, cannot find the required helper components, or the license does not include valid TecPLUS™ Software Maintenance Service (SMS) for Python scripting, the script does not start. FieldView reports the startup problem before any user code runs.

  • Unhandled Python exceptions: if your script hits a normal Python error that is not caught with try/except, FieldView stops the script at the failing line. This includes both regular Python errors such as undefined names (NameError), missing files (FileNotFoundError), and type or value mistakes in your script, and PyFieldView-specific exceptions from fieldview.exceptions. In general, regular Python exceptions come from your script or the Python runtime, while fieldview.exceptions usually mean the Python call reached FieldView but FieldView rejected the request or reported a backend failure such as fieldview.exceptions.CoreError. For a full list of PyFieldView exception types, see fieldview.exceptions. FieldView prints the full traceback to the console and, in GUI mode, also shows a popup with a short summary. Close the popup and inspect the console to see the file name, line number, and full call stack for the error.

Batch mode

When you run FieldView in batch mode, for example with -batch -python, GUI error popups are suppressed. Use the console output and the process exit status to diagnose startup problems, Python exceptions, and other script failures.