Skip to content

Commit

Permalink
If prefix or suffix are specified as None, replace with empty strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswilburlewis committed Jul 25, 2024
1 parent 3f3ccff commit f8b8b26
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pytplot/importers/cdf_to_tplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ def cdf_to_tplot(filenames, mastercdf=None, varformat=None, exclude_format=None,
new_cdflib = False
logging.debug("Using old version of cdflib (%s)", cdflib.__version__)

if prefix is None:
prefix = ''

if suffix is None:
suffix = ''

if not isinstance(varnames, list):
varnames = [varnames]

Expand Down
5 changes: 5 additions & 0 deletions pytplot/importers/netcdf_to_tplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def netcdf_to_tplot(

stored_variables = []

if prefix is None:
prefix = ''
if suffix is None:
suffix = ''

if isinstance(filenames, str):
filenames = [filenames]
elif isinstance(filenames, list):
Expand Down
5 changes: 5 additions & 0 deletions pytplot/importers/sts_to_tplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def sts_to_tplot(sts_file=None, read_only=False, prefix='', suffix='', merge=Tru
sts_dict = {}
stored_variables = []

if prefix is None:
prefix = ''
if suffix is None:
suffix = ''

# Code assumes a list of STS files
if isinstance(sts_file, str):
sts_file = [sts_file]
Expand Down

0 comments on commit f8b8b26

Please sign in to comment.