This is an automated email from the ASF dual-hosted git repository. fgreg pushed a commit to branch v1.0.0-rc1 in repository https://gitbox.apache.org/repos/asf/incubator-sdap-ningesterpy.git
commit 5291ed9d9a11e48ff38a452a4fb54c93778712ae Author: Frank Greguska <[email protected]> AuthorDate: Mon Jan 22 15:34:13 2018 -0800 changed dependency to the new nexusproto project --- ningesterpy/ningesterpy.py | 2 +- ningesterpy/processors/__init__.py | 2 +- ningesterpy/processors/emptytilefilter.py | 2 +- ningesterpy/processors/tilereadingprocessor.py | 2 +- ningesterpy/processors/tilesummarizingprocessor.py | 6 +++--- requirements.txt | 2 +- tests/kelvintocelsius_test.py | 2 +- tests/processorchain_test.py | 2 +- tests/subtract180longitude_test.py | 2 +- tests/tilereadingprocessor_test.py | 4 ++-- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ningesterpy/ningesterpy.py b/ningesterpy/ningesterpy.py index 7b3e6b4..2782c40 100644 --- a/ningesterpy/ningesterpy.py +++ b/ningesterpy/ningesterpy.py @@ -1,7 +1,7 @@ import logging import uuid -import nexusproto.NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto from flask import Flask, request, jsonify, Response from flask.json import JSONEncoder from flask_accept import accept diff --git a/ningesterpy/processors/__init__.py b/ningesterpy/processors/__init__.py index 950c3b1..7444828 100644 --- a/ningesterpy/processors/__init__.py +++ b/ningesterpy/processors/__init__.py @@ -4,7 +4,7 @@ California Institute of Technology. All rights reserved """ from collections import defaultdict -import nexusproto.NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto class Processor(object): diff --git a/ningesterpy/processors/emptytilefilter.py b/ningesterpy/processors/emptytilefilter.py index 796af2c..fed030a 100644 --- a/ningesterpy/processors/emptytilefilter.py +++ b/ningesterpy/processors/emptytilefilter.py @@ -4,7 +4,7 @@ California Institute of Technology. All rights reserved """ import logging -import nexusproto.NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto import numpy from nexusproto.serialization import from_shaped_array diff --git a/ningesterpy/processors/tilereadingprocessor.py b/ningesterpy/processors/tilereadingprocessor.py index cba3e2f..755a1ee 100644 --- a/ningesterpy/processors/tilereadingprocessor.py +++ b/ningesterpy/processors/tilereadingprocessor.py @@ -8,7 +8,7 @@ from contextlib import contextmanager from os import sep, path, remove from urllib.request import urlopen -import nexusproto.NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto import numpy from netCDF4 import Dataset, num2date from nexusproto.serialization import to_shaped_array, to_metadata diff --git a/ningesterpy/processors/tilesummarizingprocessor.py b/ningesterpy/processors/tilesummarizingprocessor.py index 970a251..b65757f 100644 --- a/ningesterpy/processors/tilesummarizingprocessor.py +++ b/ningesterpy/processors/tilesummarizingprocessor.py @@ -2,7 +2,7 @@ Copyright (c) 2016 Jet Propulsion Laboratory, California Institute of Technology. All rights reserved """ -import nexusproto.NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto import numpy from nexusproto.serialization import from_shaped_array @@ -15,13 +15,13 @@ class NoTimeException(Exception): def find_time_min_max(tile_data): # Only try to grab min/max time if it exists as a ShapedArray - if tile_data.HasField("time") and isinstance(tile_data.time, nexusproto.ShapedArray): + if tile_data.time and isinstance(tile_data.time, nexusproto.ShapedArray): time_data = from_shaped_array(tile_data.time) min_time = int(numpy.nanmin(time_data).item()) max_time = int(numpy.nanmax(time_data).item()) return min_time, max_time - elif tile_data.HasField("time") and isinstance(tile_data.time, int): + elif tile_data.time and isinstance(tile_data.time, int): return tile_data.time, tile_data.time raise NoTimeException diff --git a/requirements.txt b/requirements.txt index 22d2912..b96700c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ flask=0.12.2 flask-accept==0.0.4 nco==4.7.1 netCDF4==1.3.1 -nexusproto==0.41 +nexusproto===1.0.1-SNAPSHOT numpy==1.12.1 protobuf==3.2.0 pytz==2017.2 diff --git a/tests/kelvintocelsius_test.py b/tests/kelvintocelsius_test.py index 182abc7..16da24f 100644 --- a/tests/kelvintocelsius_test.py +++ b/tests/kelvintocelsius_test.py @@ -5,7 +5,7 @@ California Institute of Technology. All rights reserved import unittest from os import path -import nexusproto.NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto import numpy as np from nexusproto.serialization import from_shaped_array diff --git a/tests/processorchain_test.py b/tests/processorchain_test.py index 08330e2..066f7fa 100644 --- a/tests/processorchain_test.py +++ b/tests/processorchain_test.py @@ -5,7 +5,7 @@ California Institute of Technology. All rights reserved import unittest from os import path -from nexusproto import NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto from processors.processorchain import ProcessorChain diff --git a/tests/subtract180longitude_test.py b/tests/subtract180longitude_test.py index 5ad55c2..0e9b543 100644 --- a/tests/subtract180longitude_test.py +++ b/tests/subtract180longitude_test.py @@ -5,7 +5,7 @@ California Institute of Technology. All rights reserved import unittest from os import path -import nexusproto.NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto import numpy as np from nexusproto.serialization import from_shaped_array diff --git a/tests/tilereadingprocessor_test.py b/tests/tilereadingprocessor_test.py index ca29dc8..e9a6784 100644 --- a/tests/tilereadingprocessor_test.py +++ b/tests/tilereadingprocessor_test.py @@ -7,7 +7,7 @@ from os import path import numpy as np from nexusproto.serialization import from_shaped_array -from nexusproto import NexusContent_pb2 as nexusproto +from nexusproto import DataTile_pb2 as nexusproto import processors @@ -40,7 +40,7 @@ class TestReadMurData(unittest.TestCase): the_data = np.ma.masked_invalid(from_shaped_array(tile.variable_data)) self.assertEqual((1, 10, 10), the_data.shape) self.assertEqual(0, np.ma.count(the_data)) - self.assertTrue(tile.HasField('time')) + self.assertTrue(tile.time) def test_read_not_empty_mur(self): test_file = path.join(path.dirname(__file__), 'datafiles', 'not_empty_mur.nc4')
