[ 
https://issues.apache.org/jira/browse/SDAP-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16397378#comment-16397378
 ] 

ASF GitHub Bot commented on SDAP-30:
------------------------------------

fgreg closed pull request #3: SDAP-30
URL: https://github.com/apache/incubator-sdap-ningesterpy/pull/3
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sdap/processors/tilereadingprocessor.py 
b/sdap/processors/tilereadingprocessor.py
index cc3afef..a483907 100644
--- a/sdap/processors/tilereadingprocessor.py
+++ b/sdap/processors/tilereadingprocessor.py
@@ -253,11 +253,8 @@ def read_data(self, tile_specifications, file_path, 
output_tile):
                     tile.meta_data.add().CopyFrom(
                         to_metadata(self.metadata, 
ds[self.metadata][tuple(ordered_slices.values())]))
 
-                timevar = ds[self.time]
-                # Note assumption is that index of time is start value in 
dimtoslice
-                tile.time = 
to_seconds_from_epoch(timevar[dimtoslice[self.time].start],
-                                                  
timeunits=timevar.getncattr('units'),
-                                                  timeoffset=self.time_offset)
+                tile.time.CopyFrom(
+                    
to_shaped_array(numpy.ma.filled(ds[self.time][dimtoslice[self.time]], 
numpy.NaN)))
 
                 output_tile.tile.time_series_tile.CopyFrom(tile)
 
diff --git a/tests/datafiles/not_empty_wswm.nc 
b/tests/datafiles/not_empty_wswm.nc
index 772bbcb..ce0ebcc 100644
Binary files a/tests/datafiles/not_empty_wswm.nc and 
b/tests/datafiles/not_empty_wswm.nc differ
diff --git a/tests/tilereadingprocessor_test.py 
b/tests/tilereadingprocessor_test.py
index 2700073..927b436 100644
--- a/tests/tilereadingprocessor_test.py
+++ b/tests/tilereadingprocessor_test.py
@@ -275,7 +275,7 @@ def test_read_not_empty_wswm(self):
         input_tile = nexusproto.NexusTile()
         tile_summary = nexusproto.TileSummary()
         tile_summary.granule = "file:%s" % test_file
-        tile_summary.section_spec = "time:0:1,rivid:0:500"
+        tile_summary.section_spec = "time:0:5832,rivid:0:1"
         input_tile.summary.CopyFrom(tile_summary)
 
         results = list(wswm_reader.process(input_tile))
@@ -287,23 +287,25 @@ def test_read_not_empty_wswm(self):
             self.assertTrue(nexus_tile.tile.HasField('time_series_tile'))
 
             tile = nexus_tile.tile.time_series_tile
-            self.assertEqual(500, from_shaped_array(tile.latitude).size)
-            self.assertEqual(500, from_shaped_array(tile.longitude).size)
-            self.assertEqual((1, 500), 
from_shaped_array(tile.variable_data).shape)
+            self.assertEqual(1, from_shaped_array(tile.latitude).size)
+            self.assertEqual(1, from_shaped_array(tile.longitude).size)
+            self.assertEqual((5832, 1), 
from_shaped_array(tile.variable_data).shape)
 
         tile1_data = 
np.ma.masked_invalid(from_shaped_array(results[0].tile.time_series_tile.variable_data))
-        self.assertEqual(500, np.ma.count(tile1_data))
-        self.assertAlmostEqual(41.390,
+        self.assertEqual(5832, np.ma.count(tile1_data))
+        self.assertAlmostEqual(45.837,
                                np.ma.min(
                                    
np.ma.masked_invalid(from_shaped_array(results[0].tile.time_series_tile.latitude))),
                                places=3)
-        self.assertAlmostEqual(42.071,
+        self.assertAlmostEqual(-122.789,
                                np.ma.max(
-                                   
np.ma.masked_invalid(from_shaped_array(results[0].tile.time_series_tile.latitude))),
+                                   
np.ma.masked_invalid(from_shaped_array(results[0].tile.time_series_tile.longitude))),
                                places=3)
 
-        self.assertEqual(852098400, results[0].tile.time_series_tile.time)
-        self.assertAlmostEqual(0.009,
+        tile1_times = from_shaped_array(results[0].tile.time_series_tile.time)
+        self.assertEqual(852098400, tile1_times[0])
+        self.assertEqual(915073200, tile1_times[-1])
+        self.assertAlmostEqual(1.473,
                                
np.ma.masked_invalid(from_shaped_array(results[0].tile.time_series_tile.variable_data))[
                                    0, 0],
                                places=3)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Tile metadata does not have correct min/max times
> -------------------------------------------------
>
>                 Key: SDAP-30
>                 URL: https://issues.apache.org/jira/browse/SDAP-30
>             Project: Apache Science Data Analytics Platform
>          Issue Type: Sub-task
>          Components: nexus
>            Reporter: Frank Greguska
>            Assignee: Frank Greguska
>            Priority: Blocker
>
> When ingesting a tile with a time range instead of just 1 timestep, the 
> metadata in SOLR is not reflecting the min/max times correctly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to