From 2c0d666f87da505f847baf3567df1b7a235272b6 Mon Sep 17 00:00:00 2001 From: Marc Honnorat Date: Tue, 10 Apr 2018 08:46:55 +0200 Subject: [PATCH 1/3] Fix .gitignore for f2py generated files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 042b9bd..a40dae0 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,9 @@ test/ipynb/.ipynb_checkpoints fortran/omp.f90 fortran/wrffortran.pyf fortran/*.mod +fortran/_wrffortranmodule.c +fortran/_wrffortran-f2pywrappers.f +fortran/_wrffortran-f2pywrappers2.f90 build .settings src/wrf_python.egg-info From 69fdf0141950f7f3b8633f77462c41d9cc082eab Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Wed, 23 May 2018 14:23:50 -0600 Subject: [PATCH 2/3] Updated default fill value to be a double --- fortran/wrf_constants.f90 | 4 ++-- fortran/wrffortran.pyf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fortran/wrf_constants.f90 b/fortran/wrf_constants.f90 index 336c0e3..eb2e9d8 100644 --- a/fortran/wrf_constants.f90 +++ b/fortran/wrf_constants.f90 @@ -9,13 +9,13 @@ MODULE wrf_constants REAL(KIND=8), PARAMETER :: PI = 3.1415926535897932384626433D0 REAL(KIND=8), PARAMETER :: RAD_PER_DEG = PI/180.D0 REAL(KIND=8), PARAMETER :: DEG_PER_RAD = 180.D0/PI - REAL(KIND=8), PARAMETER :: DEFAULT_FILL = 9.9692099683868690E36 + REAL(KIND=8), PARAMETER :: DEFAULT_FILL = 9.9692099683868690D36 INTEGER(KIND=1), PARAMETER :: DEFAULT_FILL_INT8 = -127 INTEGER(KIND=2), PARAMETER :: DEFAULT_FILL_INT16 = -32767 INTEGER(KIND=4), PARAMETER :: DEFAULT_FILL_INT32 = -2147483647 INTEGER(KIND=8), PARAMETER :: DEFAULT_FILL_INT64 = INT(-9223372036854775806D0, KIND=8) REAL(KIND=4), PARAMETER :: DEFAULT_FILL_FLOAT = 9.9692099683868690E36 - REAL(KIND=8), PARAMETER :: DEFAULT_FILL_DOUBLE = 9.9692099683868690E36 + REAL(KIND=8), PARAMETER :: DEFAULT_FILL_DOUBLE = 9.9692099683868690D36 CHARACTER(LEN=1), PARAMETER :: DEFAULT_FILL_CHAR = ACHAR(0) diff --git a/fortran/wrffortran.pyf b/fortran/wrffortran.pyf index be27452..15340e1 100644 --- a/fortran/wrffortran.pyf +++ b/fortran/wrffortran.pyf @@ -322,7 +322,7 @@ python module _wrffortran ! in real(kind=8), parameter,optional :: p1000mb=100000.d0 real(kind=8), parameter,optional :: rv=461.6d0 real(kind=8), parameter,optional,depend(pi) :: rad_per_deg=pi/180.d0 - real(kind=8), parameter,optional :: default_fill_double=9.96920996839e+36 + real(kind=8), parameter,optional :: default_fill_double=9.9692099683868690d36 real(kind=8), parameter,optional :: rd=287.d0 real(kind=8), parameter,optional :: abscoef=.145d0 real(kind=8), parameter,optional :: celkel=273.15d0 @@ -341,7 +341,7 @@ python module _wrffortran ! in real(kind=8), parameter,optional :: cpmd=.887d0 real(kind=8), parameter,optional,depend(rd,g) :: sclht=rd*256.d0/g real(kind=8), parameter,optional :: ussalr=0.0065d0 - real(kind=8), parameter,optional :: default_fill=9.96920996839e+36 + real(kind=8), parameter,optional :: default_fill=9.9692099683868690d36 real(kind=8), parameter,optional :: rho_s=100.d0 real(kind=8), parameter,optional,depend(rhowat) :: rho_r=1000.0 real(kind=8), parameter,optional :: alpha=0.224d0 From 60989dd47abc1a94ea63f6a6a1739e8151ed49b2 Mon Sep 17 00:00:00 2001 From: Bill Ladwig Date: Thu, 31 May 2018 16:31:00 -0600 Subject: [PATCH 3/3] Removed unicode literals. Python 2.x strings are no longer promoted to unicode. Strings are now the native type for the interpreter used. Fixes #57. --- doc/source/new.rst | 13 +++++++++++++ doc/source/tutorial.rst | 1 + src/wrf/__init__.py | 3 +-- src/wrf/cache.py | 3 +-- src/wrf/computation.py | 3 +-- src/wrf/config.py | 3 +-- src/wrf/constants.py | 3 +-- src/wrf/coordpair.py | 3 +-- src/wrf/decorators.py | 3 +-- src/wrf/destag.py | 3 +-- src/wrf/extension.py | 3 +-- src/wrf/g_cape.py | 3 +-- src/wrf/g_cloudfrac.py | 3 +-- src/wrf/g_ctt.py | 3 +-- src/wrf/g_dbz.py | 3 +-- src/wrf/g_dewpoint.py | 3 +-- src/wrf/g_geoht.py | 3 +-- src/wrf/g_helicity.py | 3 +-- src/wrf/g_latlon.py | 3 +-- src/wrf/g_omega.py | 3 +-- src/wrf/g_precip.py | 3 +-- src/wrf/g_pressure.py | 3 +-- src/wrf/g_pw.py | 3 +-- src/wrf/g_rh.py | 3 +-- src/wrf/g_slp.py | 3 +-- src/wrf/g_temp.py | 3 +-- src/wrf/g_terrain.py | 3 +-- src/wrf/g_times.py | 3 +-- src/wrf/g_uvmet.py | 3 +-- src/wrf/g_vorticity.py | 3 +-- src/wrf/g_wind.py | 3 +-- src/wrf/geobnds.py | 3 +-- src/wrf/interp.py | 3 +-- src/wrf/interputils.py | 3 +-- src/wrf/latlonutils.py | 3 +-- src/wrf/metadecorators.py | 9 ++++----- src/wrf/projection.py | 33 ++++++++++++++++----------------- src/wrf/projutils.py | 3 +-- src/wrf/py3compat.py | 3 +-- src/wrf/routines.py | 11 ++++++----- src/wrf/specialdec.py | 3 +-- src/wrf/units.py | 3 +-- src/wrf/util.py | 9 ++++----- src/wrf/version.py | 2 +- 44 files changed, 82 insertions(+), 107 deletions(-) diff --git a/doc/source/new.rst b/doc/source/new.rst index f32b1f6..9b48709 100644 --- a/doc/source/new.rst +++ b/doc/source/new.rst @@ -4,6 +4,19 @@ What's New Releases ------------- +v1.2.0 +^^^^^^^^^^^^^^ + +- Release 1.2.0 +- Previous versions of wrf-python promoted the strings used in xarray (e.g. + name, attributes) to Unicode strings. This caused problems when porting + examples for PyNGL to use wrf-python in Python 3.x. All strings are now the + native string for the Python version being used. While this should be + transparent to most users, any users that worked with the xarray name or + attribute values on Python 2.7 may run in to string related errors, so we've + decided to bump the major version number. + + v1.1.3 ^^^^^^^^^^^^^^ diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index dc05e15..e449093 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -24,3 +24,4 @@ Past Tutorials tutorials/wrf_workshop_2017.rst tutorials/tutorial_03_2018.rst + diff --git a/src/wrf/__init__.py b/src/wrf/__init__.py index 25f0762..2a60704 100755 --- a/src/wrf/__init__.py +++ b/src/wrf/__init__.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import os import pkg_resources diff --git a/src/wrf/cache.py b/src/wrf/cache.py index 12b2226..571f653 100644 --- a/src/wrf/cache.py +++ b/src/wrf/cache.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from threading import local from collections import OrderedDict diff --git a/src/wrf/computation.py b/src/wrf/computation.py index 0132417..68486b2 100644 --- a/src/wrf/computation.py +++ b/src/wrf/computation.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np import numpy.ma as ma diff --git a/src/wrf/config.py b/src/wrf/config.py index d22d5de..513cf1f 100644 --- a/src/wrf/config.py +++ b/src/wrf/config.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from threading import local import wrapt diff --git a/src/wrf/constants.py b/src/wrf/constants.py index cedc62a..11cdc6c 100755 --- a/src/wrf/constants.py +++ b/src/wrf/constants.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from sys import version_info import struct diff --git a/src/wrf/coordpair.py b/src/wrf/coordpair.py index 8b3121a..62000cc 100644 --- a/src/wrf/coordpair.py +++ b/src/wrf/coordpair.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .py3compat import py2round diff --git a/src/wrf/decorators.py b/src/wrf/decorators.py index 7b1797f..1427462 100644 --- a/src/wrf/decorators.py +++ b/src/wrf/decorators.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from collections import Iterable, OrderedDict diff --git a/src/wrf/destag.py b/src/wrf/destag.py index 3d090ae..dda151a 100755 --- a/src/wrf/destag.py +++ b/src/wrf/destag.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .decorators import extract_and_transpose from .metadecorators import set_destag_metadata diff --git a/src/wrf/extension.py b/src/wrf/extension.py index 42c4734..d7636c5 100755 --- a/src/wrf/extension.py +++ b/src/wrf/extension.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np diff --git a/src/wrf/g_cape.py b/src/wrf/g_cape.py index 0a43c7a..697ca0d 100755 --- a/src/wrf/g_cape.py +++ b/src/wrf/g_cape.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np import numpy.ma as ma diff --git a/src/wrf/g_cloudfrac.py b/src/wrf/g_cloudfrac.py index 2417dfa..bb9368d 100644 --- a/src/wrf/g_cloudfrac.py +++ b/src/wrf/g_cloudfrac.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np import numpy.ma as ma diff --git a/src/wrf/g_ctt.py b/src/wrf/g_ctt.py index 1c59c01..1003a4e 100644 --- a/src/wrf/g_ctt.py +++ b/src/wrf/g_ctt.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np import numpy.ma as ma diff --git a/src/wrf/g_dbz.py b/src/wrf/g_dbz.py index f16b6bb..77b2523 100755 --- a/src/wrf/g_dbz.py +++ b/src/wrf/g_dbz.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np diff --git a/src/wrf/g_dewpoint.py b/src/wrf/g_dewpoint.py index e9778d2..57cd656 100755 --- a/src/wrf/g_dewpoint.py +++ b/src/wrf/g_dewpoint.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) #from .extension import computetd from .extension import _td diff --git a/src/wrf/g_geoht.py b/src/wrf/g_geoht.py index d9c7624..6b041ef 100755 --- a/src/wrf/g_geoht.py +++ b/src/wrf/g_geoht.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import warnings diff --git a/src/wrf/g_helicity.py b/src/wrf/g_helicity.py index cb3beb5..0429aef 100755 --- a/src/wrf/g_helicity.py +++ b/src/wrf/g_helicity.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np diff --git a/src/wrf/g_latlon.py b/src/wrf/g_latlon.py index a31ae8a..5d2dc08 100755 --- a/src/wrf/g_latlon.py +++ b/src/wrf/g_latlon.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from collections import OrderedDict diff --git a/src/wrf/g_omega.py b/src/wrf/g_omega.py index 419e2f7..6bddfa3 100755 --- a/src/wrf/g_omega.py +++ b/src/wrf/g_omega.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .constants import Constants from .destag import destagger diff --git a/src/wrf/g_precip.py b/src/wrf/g_precip.py index 6bb3973..aa75a80 100755 --- a/src/wrf/g_precip.py +++ b/src/wrf/g_precip.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .util import extract_vars diff --git a/src/wrf/g_pressure.py b/src/wrf/g_pressure.py index c90c25f..44676ad 100755 --- a/src/wrf/g_pressure.py +++ b/src/wrf/g_pressure.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .decorators import convert_units from .metadecorators import copy_and_set_metadata diff --git a/src/wrf/g_pw.py b/src/wrf/g_pw.py index 1c5d0fc..73d6f74 100755 --- a/src/wrf/g_pw.py +++ b/src/wrf/g_pw.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) #from .extension import computepw,computetv,computetk from .extension import _pw, _tv, _tk diff --git a/src/wrf/g_rh.py b/src/wrf/g_rh.py index 6e4bb6b..40f1263 100755 --- a/src/wrf/g_rh.py +++ b/src/wrf/g_rh.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .constants import Constants #from .extension import computerh, computetk diff --git a/src/wrf/g_slp.py b/src/wrf/g_slp.py index 77bac48..a8f0e03 100755 --- a/src/wrf/g_slp.py +++ b/src/wrf/g_slp.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) #from .extension import computeslp, computetk from .extension import _slp, _tk diff --git a/src/wrf/g_temp.py b/src/wrf/g_temp.py index 495262f..f29969c 100755 --- a/src/wrf/g_temp.py +++ b/src/wrf/g_temp.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .constants import Constants from .extension import _tk, _eth, _tv, _wetbulb diff --git a/src/wrf/g_terrain.py b/src/wrf/g_terrain.py index 6454166..80910ed 100755 --- a/src/wrf/g_terrain.py +++ b/src/wrf/g_terrain.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .decorators import convert_units from .metadecorators import copy_and_set_metadata diff --git a/src/wrf/g_times.py b/src/wrf/g_times.py index 30985ca..3c46b19 100755 --- a/src/wrf/g_times.py +++ b/src/wrf/g_times.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .util import extract_times diff --git a/src/wrf/g_uvmet.py b/src/wrf/g_uvmet.py index 5ef19a3..e1d7108 100755 --- a/src/wrf/g_uvmet.py +++ b/src/wrf/g_uvmet.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from math import fabs, log, tan, sin, cos diff --git a/src/wrf/g_vorticity.py b/src/wrf/g_vorticity.py index 343c06f..660f688 100755 --- a/src/wrf/g_vorticity.py +++ b/src/wrf/g_vorticity.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .extension import _avo, _pvo from .util import extract_vars, extract_global_attrs diff --git a/src/wrf/g_wind.py b/src/wrf/g_wind.py index b04246d..40f6fec 100755 --- a/src/wrf/g_wind.py +++ b/src/wrf/g_wind.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np diff --git a/src/wrf/geobnds.py b/src/wrf/geobnds.py index 022c9a7..2014b5c 100644 --- a/src/wrf/geobnds.py +++ b/src/wrf/geobnds.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .coordpair import CoordPair diff --git a/src/wrf/interp.py b/src/wrf/interp.py index 34d7e6f..7c92179 100755 --- a/src/wrf/interp.py +++ b/src/wrf/interp.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np import numpy.ma as ma diff --git a/src/wrf/interputils.py b/src/wrf/interputils.py index cd4ddc1..44a6ab7 100644 --- a/src/wrf/interputils.py +++ b/src/wrf/interputils.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from math import floor, ceil diff --git a/src/wrf/latlonutils.py b/src/wrf/latlonutils.py index 00940ef..adf27ab 100644 --- a/src/wrf/latlonutils.py +++ b/src/wrf/latlonutils.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from collections import Iterable diff --git a/src/wrf/metadecorators.py b/src/wrf/metadecorators.py index 771164b..573c7fc 100644 --- a/src/wrf/metadecorators.py +++ b/src/wrf/metadecorators.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import warnings import wrapt from collections import OrderedDict @@ -12,7 +11,7 @@ from .util import (extract_vars, either, from_args, arg_location, is_coordvar, latlon_coordvars, to_np, from_var, iter_left_indexes, is_mapping) from .coordpair import CoordPair -from .py3compat import viewkeys, viewitems, py3range, ucode +from .py3compat import viewkeys, viewitems, py3range from .interputils import get_xy_z_params, get_xy, to_xy_coords from .config import xarray_enabled @@ -135,7 +134,7 @@ def copy_and_set_metadata(copy_varname=None, delete_attrs=None, name=None, outattrs = OrderedDict() if copy_varname is not None: - outname = ucode(var_to_copy.name) + outname = var_to_copy.name if dimnames is not None: outdimnames = dimnames @@ -1854,7 +1853,7 @@ def set_smooth_metdata(): outattrs = OrderedDict() if isinstance(field, DataArray): - outname = "smooth_" + ucode(field.name) + outname = "smooth_" + field.name outdimnames = list(field.dims) outcoords.update(field.coords) outattrs.update(field.attrs) diff --git a/src/wrf/projection.py b/src/wrf/projection.py index d5b6670..61fd6b5 100644 --- a/src/wrf/projection.py +++ b/src/wrf/projection.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np import math from decimal import Decimal, Context, ROUND_HALF_UP @@ -532,13 +531,13 @@ class LambertConformal(WrfProj): else self.truelat2) _pyngl = Resources() - _pyngl.mpProjection = bytes("LambertConformal") - _pyngl.mpDataBaseVersion = bytes("MediumRes") + _pyngl.mpProjection = "LambertConformal" + _pyngl.mpDataBaseVersion = "MediumRes" _pyngl.mpLambertMeridianF = self.stand_lon _pyngl.mpLambertParallel1F = self.truelat1 _pyngl.mpLambertParallel2F = truelat2 - _pyngl.mpLimitMode = bytes("Corners") + _pyngl.mpLimitMode = "Corners" _pyngl.mpLeftCornerLonF = geobounds.bottom_left.lon _pyngl.mpLeftCornerLatF = geobounds.bottom_left.lat _pyngl.mpRightCornerLonF = geobounds.top_right.lon @@ -652,12 +651,12 @@ class Mercator(WrfProj): return None _pyngl = Resources() - _pyngl.mpProjection = bytes("Mercator") - _pyngl.mpDataBaseVersion = bytes("MediumRes") + _pyngl.mpProjection = "Mercator" + _pyngl.mpDataBaseVersion = "MediumRes" _pyngl.mpCenterLatF = 0.0 _pyngl.mpCenterLonF = self.stand_lon - _pyngl.mpLimitMode = bytes("Corners") + _pyngl.mpLimitMode = "Corners" _pyngl.mpLeftCornerLonF = geobounds.bottom_left.lon _pyngl.mpLeftCornerLatF = geobounds.bottom_left.lat _pyngl.mpRightCornerLonF = geobounds.top_right.lon @@ -770,8 +769,8 @@ class PolarStereographic(WrfProj): return None _pyngl = Resources() - _pyngl.mpProjection = bytes("Stereographic") - _pyngl.mpDataBaseVersion = bytes("MediumRes") + _pyngl.mpProjection = "Stereographic" + _pyngl.mpDataBaseVersion = "MediumRes" _pyngl.mpCenterLonF = self.stand_lon if self._hemi > 0: @@ -779,7 +778,7 @@ class PolarStereographic(WrfProj): else: _pyngl.mpCenterLatF = -90.0 - _pyngl.mpLimitMode = bytes("Corners") + _pyngl.mpLimitMode = "Corners" _pyngl.mpLeftCornerLonF = geobounds.bottom_left.lon _pyngl.mpLeftCornerLatF = geobounds.bottom_left.lat _pyngl.mpRightCornerLonF = geobounds.top_right.lon @@ -877,12 +876,12 @@ class LatLon(WrfProj): return None _pyngl = Resources() - _pyngl.mpProjection = bytes("CylindricalEquidistant") - _pyngl.mpDataBaseVersion = bytes("MediumRes") + _pyngl.mpProjection = "CylindricalEquidistant" + _pyngl.mpDataBaseVersion = "MediumRes" _pyngl.mpCenterLonF = self.stand_lon _pyngl.mpCenterLatF = self.moad_cen_lat - _pyngl.mpLimitMode = bytes("Corners") + _pyngl.mpLimitMode = "Corners" _pyngl.mpLeftCornerLonF = geobounds.bottom_left.lon _pyngl.mpLeftCornerLatF = geobounds.bottom_left.lat _pyngl.mpRightCornerLonF = geobounds.top_right.lon @@ -1055,12 +1054,12 @@ class RotatedLatLon(WrfProj): return None _pyngl = Resources() - _pyngl.mpProjection = bytes("CylindricalEquidistant") - _pyngl.mpDataBaseVersion = bytes("MediumRes") + _pyngl.mpProjection = "CylindricalEquidistant" + _pyngl.mpDataBaseVersion = "MediumRes" _pyngl.mpCenterLatF = self._pyngl_cen_lat _pyngl.mpCenterLonF = self._pyngl_cen_lon - _pyngl.mpLimitMode = bytes("Corners") + _pyngl.mpLimitMode = "Corners" _pyngl.mpLeftCornerLonF = geobounds.bottom_left.lon _pyngl.mpLeftCornerLatF = geobounds.bottom_left.lat _pyngl.mpRightCornerLonF = geobounds.top_right.lon diff --git a/src/wrf/projutils.py b/src/wrf/projutils.py index c7ff210..5cc2d14 100644 --- a/src/wrf/projutils.py +++ b/src/wrf/projutils.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .py3compat import viewitems diff --git a/src/wrf/py3compat.py b/src/wrf/py3compat.py index c74ce79..0c08366 100644 --- a/src/wrf/py3compat.py +++ b/src/wrf/py3compat.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from sys import version_info from math import floor, copysign diff --git a/src/wrf/routines.py b/src/wrf/routines.py index df6d533..ba5569c 100644 --- a/src/wrf/routines.py +++ b/src/wrf/routines.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .util import (get_iterable, is_standard_wrf_var, extract_vars, viewkeys, get_id) @@ -22,7 +21,7 @@ from .g_uvmet import (get_uvmet, get_uvmet10, get_uvmet10_wspd_wdir, from .g_vorticity import get_avo, get_pvo from .g_wind import (get_destag_wspd_wdir, get_destag_wspd_wdir10, get_u_destag, get_v_destag, get_w_destag) -from .g_times import get_times +from .g_times import get_times, get_xtimes from .g_cloudfrac import get_cloudfrac @@ -51,7 +50,8 @@ _FUNC_MAP = {"cape2d" : get_2dcape, "tv" : get_tv, "twb" : get_tw, "terrain" : get_terrain, - "times" : get_times, + "times" : get_times, + "xtimes" : get_xtimes, "uvmet" : get_uvmet, "uvmet10" : get_uvmet10, "avo" : get_avo, @@ -96,7 +96,8 @@ _VALID_KARGS = {"cape2d" : ["missing"], "tv" : ["units"], "twb" : ["units"], "terrain" : ["units"], - "times" : [], + "times" : [], + "xtimes" : [], "uvmet" : ["units"], "uvmet10" : ["units"], "avo" : [], diff --git a/src/wrf/specialdec.py b/src/wrf/specialdec.py index 1795f25..9c70eee 100644 --- a/src/wrf/specialdec.py +++ b/src/wrf/specialdec.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import numpy as np diff --git a/src/wrf/units.py b/src/wrf/units.py index 3d7eca7..11420cf 100755 --- a/src/wrf/units.py +++ b/src/wrf/units.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) from .constants import Constants, ConversionFactors diff --git a/src/wrf/util.py b/src/wrf/util.py index 2c0fd9e..be174b4 100644 --- a/src/wrf/util.py +++ b/src/wrf/util.py @@ -1,5 +1,4 @@ -from __future__ import (absolute_import, division, print_function, - unicode_literals) +from __future__ import (absolute_import, division, print_function) import os from sys import version_info @@ -31,7 +30,7 @@ import numpy.ma as ma from .config import xarray_enabled from .constants import default_fill, ALL_TIMES -from .py3compat import (viewitems, viewkeys, isstr, py3range, ucode) +from .py3compat import (viewitems, viewkeys, isstr, py3range) from .cache import cache_item, get_cached_item from .geobnds import GeoBounds, NullGeoBounds from .coordpair import CoordPair @@ -1722,7 +1721,7 @@ def _cat_files(wrfseq, varname, timeidx, is_moving, squeeze, meta, _key): if not timecached and outxtimes is not None: cache_item(_key, timekey, outxtimes) - outname = ucode(first_var.name) + outname = first_var.name outattrs = OrderedDict(first_var.attrs) outcoords = OrderedDict(first_var.coords) outdimnames = list(first_var.dims) @@ -1986,7 +1985,7 @@ def _join_files(wrfseq, varname, timeidx, is_moving, meta, _key): if not timecached and outxtimes is not None: cache_item(_key, timekey, outxtimes) - outname = ucode(first_var.name) + outname = first_var.name outcoords = OrderedDict(first_var.coords) outattrs = OrderedDict(first_var.attrs) # New dimensions diff --git a/src/wrf/version.py b/src/wrf/version.py index 18b2dba..c1afe52 100644 --- a/src/wrf/version.py +++ b/src/wrf/version.py @@ -1,2 +1,2 @@ -__version__ = "1.1.3" +__version__ = "1.2.0"