From 76c1850da8b8ada472d68f62f56de1f7b6e7e4e6 Mon Sep 17 00:00:00 2001 From: Matt Ueckermann Date: Fri, 12 Oct 2018 10:48:34 -0400 Subject: [PATCH] BUGFIX: Fixing SMAP notebook with new coordinates and renaming coordinate.py to coordinates.py for the user API to match the developer API. * Also removing cache_native_coordinates as a attributes of Compositor nodes --- doc/notebooks/SMAP-level4-data-access.ipynb | 16 +++++++++------- podpac/{coordinate.py => coordinates.py} | 0 podpac/core/compositor.py | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) rename podpac/{coordinate.py => coordinates.py} (100%) diff --git a/doc/notebooks/SMAP-level4-data-access.ipynb b/doc/notebooks/SMAP-level4-data-access.ipynb index c7edfa9e3..81da5496c 100644 --- a/doc/notebooks/SMAP-level4-data-access.ipynb +++ b/doc/notebooks/SMAP-level4-data-access.ipynb @@ -111,7 +111,9 @@ "# dim = value\n", "time = '2018-05-19T12:00:00'\n", "\n", - "c_world = podpac.Coordinates.grid(lat=lat, lon=lon, time=time, order=['lat', 'lon', 'time'])\n", + "c_world = podpac.Coordinates([podpac.crange(*lat),\n", + " podpac.crange(*lon),\n", + " time], dims=['lat', 'lon', 'time'])\n", "o = sm.execute(c_world)\n", "figure()\n", "o.plot(cmap='gist_earth_r')\n", @@ -205,10 +207,10 @@ "outputs": [], "source": [ "import pydap.client\n", - "# The user needs to know/construct this url. Note the version number Vv3030_001 may change unexpectedly\n", + "# The user needs to know/construct this url. Note the version number Vv4030_001 may change unexpectedly\n", "source = ('https://n5eil01u.ecs.nsidc.org:443/opendap'\n", " '/SMAP/SPL4SMAU.004/2018.05.19'\n", - " '/SMAP_L4_SM_aup_20180519T120000_Vv4011_001.h5')\n", + " '/SMAP_L4_SM_aup_20180519T120000_Vv4030_001.h5')\n", "# This line is needed for an initial authentication\n", "auth_session.get(source + '.dds') \n", "dataset = pydap.client.open_url(source, session=auth_session)\n", @@ -448,10 +450,10 @@ }, "outputs": [], "source": [ - "bbox = podpac.Coordinates.grid(#dim=(start, stop, number)\n", - " lat=( 49, 25, 2),\n", - " lon=( -126, -66, 2),\n", - " order=['lat', 'lon']\n", + "bbox = podpac.Coordinates([ # (start, stop, number)\n", + " podpac.clinspace( 49, 25, 2), # lat\n", + " podpac.clinspace( -126, -66, 2), # lon\n", + " ], dims=['lat', 'lon']\n", ")" ] }, diff --git a/podpac/coordinate.py b/podpac/coordinates.py similarity index 100% rename from podpac/coordinate.py rename to podpac/coordinates.py diff --git a/podpac/core/compositor.py b/podpac/core/compositor.py index 65a060cdc..3b992c74b 100644 --- a/podpac/core/compositor.py +++ b/podpac/core/compositor.py @@ -65,11 +65,11 @@ class Compositor(Node): is_source_coordinates_complete = tl.Bool(False, help=("This allows some optimizations but assumes that a node's " "native_coordinates=source_coordinate + shared_coordinate " - "IN THAT ORDER")).tag(attr=True) + "IN THAT ORDER")) source = tl.Unicode().tag(attr=True) sources = tl.Instance(np.ndarray) - cache_native_coordinates = tl.Bool(True).tag(attr=True) + cache_native_coordinates = tl.Bool(True) interpolation = tl.Unicode('').tag(attr=True)