Commit 64582d45 authored by Camilla Dodge Koslowsky Harris's avatar Camilla Dodge Koslowsky Harris
Browse files

fixed a bug with default behavior for variables

parent 65c6402f
......@@ -277,7 +277,8 @@ def bracketify(variable_name: str) -> str:
def write_zone(
tecplot_zone
tecplot_dataset
, tecplot_zone
, write_as: str
, filename: str
, variables=None
......@@ -286,6 +287,7 @@ def write_zone(
"""Writes a tecplot zone to various formats.
Args:
tecplot_dataset (): The dataset to save.
tecplot_zone (): The zone to save.
write_as (str): Type of file to write to. Supported options are 'hdf5',
'csv', 'tecplot_ascii', and 'tecplot_plt'.
......@@ -295,7 +297,7 @@ def write_zone(
behavior is to save all variables.
verbose: (Optional) Print diagnostic information. Defaults to False.
"""
if verbose:
if verbose and variables:
print('Saving variables:')
for var in variables:
print(var.name)
......@@ -309,6 +311,8 @@ def write_zone(
if 'hdf5' in write_as:
if verbose:
print('hdf5')
if not variables:
variables = list(tecplot_dataset.variables())
_save_hdf5(
filename,
aux_data,
......@@ -316,6 +320,8 @@ def write_zone(
variables
)
elif 'csv' in write_as:
if not variables:
variables = list(tecplot_dataset.variables())
_save_csv(
filename,
aux_data,
......@@ -475,7 +481,7 @@ def interpolate_zone_to_geometry(
geometry_points[direction][:]
## interpolate variables on to the geometry
if verbose:
if verbose and variables:
print('Interpolating variables:')
for var in variables:
print(var.name)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment