From b745facb5cb9e2c075f3155bc8dfe5a4bb9fbf82 Mon Sep 17 00:00:00 2001 From: Daniel Adriaansen Date: Fri, 21 Apr 2023 15:58:19 -0600 Subject: [PATCH 1/2] Switches str to string for Pandas read_csv usage. --- scripts/python/met/mprbase.py | 2 +- scripts/python/met/point.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/python/met/mprbase.py b/scripts/python/met/mprbase.py index 57e5769015..0615171313 100644 --- a/scripts/python/met/mprbase.py +++ b/scripts/python/met/mprbase.py @@ -8,7 +8,7 @@ class mpr_data(): # Skip first "col_start" columns if col_start is not 0. def read_mpr(input_file, col_last, col_start = 0, header=None, delim_whitespace=True, keep_default_na=False, - skiprows=1, dtype=str): + skiprows=1, dtype='string'): mpr_data = pd.read_csv(input_file, header=header, delim_whitespace=delim_whitespace, keep_default_na=keep_default_na, diff --git a/scripts/python/met/point.py b/scripts/python/met/point.py index 10c93f91aa..3c64549e85 100644 --- a/scripts/python/met/point.py +++ b/scripts/python/met/point.py @@ -674,7 +674,7 @@ def read_text_point_obs(input_file, header=None, delim_whitespace=delim_whitespace, keep_default_na=keep_default_na, names=['typ', 'sid', 'vld', 'lat', 'lon', 'elv', 'var', 'lvl', 'hgt', 'qc', 'obs'], - dtype={'typ':'str', 'sid':'str', 'vld':'str', 'var':'str', 'qc':'str'}).values.tolist() + dtype={'typ':'string', 'sid':'string', 'vld':'string', 'var':'string', 'qc':'string'}).values.tolist() return ascii_point_data # Note: caller should import netCDF4 From 09398df5de595c4d7b33bc56ed9cad4ce2894264 Mon Sep 17 00:00:00 2001 From: Daniel Adriaansen Date: Fri, 21 Apr 2023 16:00:08 -0600 Subject: [PATCH 2/2] Switches dtypes for read_csv usage and corrects Appendix F. --- docs/Users_Guide/appendixF.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/Users_Guide/appendixF.rst b/docs/Users_Guide/appendixF.rst index f028c87326..4a8fe86cae 100644 --- a/docs/Users_Guide/appendixF.rst +++ b/docs/Users_Guide/appendixF.rst @@ -496,7 +496,7 @@ Examples of Python Embedding for Point Observations .. code-block:: none :caption: PointStat Command with Dual Python Embedding - point_stat 'PYTHON_NUMPY' 'PYTHON_NUMPY' PointStat_config -outdir /path/to/output + point_stat 'PYTHON_NUMPY' 'PYTHON_NUMPY=/path/to/obs/python/script.py python_arg1 python_arg2' PointStat_config -outdir /path/to/output .. code-block:: none :caption: PointStat Config with Dual Python Embedding @@ -509,14 +509,6 @@ Examples of Python Embedding for Point Observations ]; } - obs = { - field = [ - { - name = "/path/to/obs/python/script.py python_arg1 python_arg2"; - } - ]; - } - .. _pyembed-mpr-data: Python Embedding for MPR Data