diff --git a/tests/adapters/test_base.py b/tests/adapters/test_base.py index 8438d9738e13b852a1a8a354270aa6fc4f95cf55..fbfa0537fdc7ab321c368d0fa85f4846869e1f94 100644 --- a/tests/adapters/test_base.py +++ b/tests/adapters/test_base.py @@ -88,7 +88,7 @@ class TestGridToValue(unittest.TestCase): self.adapter = GridToValue(func=np.ma.mean) self.source.outputs["Grid"] >> self.adapter - self.adapter.get_info(Info(None, grid=NoGrid())) + self.adapter.get_info(Info(None, grid=NoGrid(), units=None)) self.source.connect(datetime(2000, 1, 1)) self.source.connect(datetime(2000, 1, 1)) self.source.validate() @@ -100,7 +100,7 @@ class TestGridToValue(unittest.TestCase): self.adapter = GridToValue(func=np.ma.sum) self.source.outputs["Grid"] >> self.adapter - self.adapter.get_info(Info(None, grid=NoGrid())) + self.adapter.get_info(Info(None, grid=NoGrid(), units=None)) self.source.connect(datetime(2000, 1, 1)) self.source.connect(datetime(2000, 1, 1)) self.source.validate() @@ -131,7 +131,7 @@ class TestValueToGrid(unittest.TestCase): self.adapter = ValueToGrid(grid) self.source.outputs["Value"] >> self.adapter - self.adapter.get_info(Info(None, grid=grid)) + self.adapter.get_info(Info(None, grid=grid, units=None)) self.source.connect(datetime(2000, 1, 1)) self.source.connect(datetime(2000, 1, 1)) self.source.validate() @@ -149,7 +149,7 @@ class TestValueToGrid(unittest.TestCase): self.source.outputs["Value"] >> self.adapter with self.assertRaises(fm.FinamMetaDataError): - self.adapter.get_info(Info(None, grid=UniformGrid((2, 2)))) + self.adapter.get_info(Info(None, grid=UniformGrid((2, 2)), units=None)) def test_value_to_grid_from_target(self): grid, data = create_grid(10, 10, 1.0) @@ -157,7 +157,7 @@ class TestValueToGrid(unittest.TestCase): self.adapter = ValueToGrid(None) self.source.outputs["Value"] >> self.adapter - self.adapter.get_info(Info(None, grid=grid)) + self.adapter.get_info(Info(None, grid=grid, units=None)) self.source.connect(datetime(2000, 1, 1)) self.source.connect(datetime(2000, 1, 1)) self.source.validate() diff --git a/tests/adapters/test_regrid.py b/tests/adapters/test_regrid.py index 50c914c152a41b2e368ddbf160bdfc4d9eeeae00..49f0b5421685b2069cc060cf1003d960aade4098 100644 --- a/tests/adapters/test_regrid.py +++ b/tests/adapters/test_regrid.py @@ -51,7 +51,7 @@ class TestRegrid(unittest.TestCase): ) sink = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec)}, + {"Input": Info(None, grid=out_spec, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -104,7 +104,7 @@ class TestRegrid(unittest.TestCase): ) sink = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec)}, + {"Input": Info(None, grid=out_spec, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -148,7 +148,7 @@ class TestRegrid(unittest.TestCase): ) sink = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec)}, + {"Input": Info(None, grid=out_spec, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -192,7 +192,7 @@ class TestRegrid(unittest.TestCase): ) sink = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec)}, + {"Input": Info(None, grid=out_spec, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -237,7 +237,7 @@ class TestRegrid(unittest.TestCase): ) sink = debug.DebugConsumer( - {"Input": Info(None, grid=None)}, + {"Input": Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -281,7 +281,7 @@ class TestRegrid(unittest.TestCase): ) sink = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec)}, + {"Input": Info(None, grid=out_spec, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -321,12 +321,12 @@ class TestRegrid(unittest.TestCase): ) sink_1 = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec_1)}, + {"Input": Info(None, grid=out_spec_1, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) sink_2 = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec_2)}, + {"Input": Info(None, grid=out_spec_2, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -376,12 +376,12 @@ class TestRegrid(unittest.TestCase): ) sink_1 = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec_1)}, + {"Input": Info(None, grid=out_spec_1, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) sink_2 = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec_2)}, + {"Input": Info(None, grid=out_spec_2, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -434,7 +434,7 @@ class TestRegrid(unittest.TestCase): ) sink = debug.DebugConsumer( - {"Input": Info(None, grid=out_spec)}, + {"Input": Info(None, grid=out_spec, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) diff --git a/tests/adapters/test_stats.py b/tests/adapters/test_stats.py index e5acdf18fdc35c85f4e0d0b9fafd2cf6d6e3ebc4..c90d44ba6d5d7102fa7a089aae7c4510520bfbc0 100644 --- a/tests/adapters/test_stats.py +++ b/tests/adapters/test_stats.py @@ -18,7 +18,7 @@ class TestHistogram(unittest.TestCase): source = fm.modules.SimplexNoise(info=in_info) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=time, step=timedelta(days=1), ) diff --git a/tests/adapters/test_time_integration.py b/tests/adapters/test_time_integration.py index 0fb922588f53630b07bcd798f0b232f12aeaaeb9..088860c5475a026707f46a008d76f052db74d39c 100644 --- a/tests/adapters/test_time_integration.py +++ b/tests/adapters/test_time_integration.py @@ -33,7 +33,7 @@ class TestAvgOverTime(unittest.TestCase): self.source.initialize() self.source.outputs["Step"] >> self.adapter - self.adapter.get_info(Info(None, grid=NoGrid())) + self.adapter.get_info(Info(None, grid=NoGrid(), units=None)) self.source.connect(start) self.source.connect(start) @@ -110,7 +110,7 @@ class TestGridAvgOverTime(unittest.TestCase): self.source.initialize() self.source.outputs["Grid"] >> self.adapter - self.adapter.get_info(Info(None, grid=grid)) + self.adapter.get_info(Info(None, grid=grid, units=None)) self.source.connect(start) self.source.connect(start) diff --git a/tests/core/test_sdk.py b/tests/core/test_sdk.py index 1ca2e537f418c5d7cd4b15c6b9de08fb4c1a7d73..1f9c9a83efbbfb95d72bce6e41ac45850211bc22 100644 --- a/tests/core/test_sdk.py +++ b/tests/core/test_sdk.py @@ -687,7 +687,7 @@ class TestIOFails(unittest.TestCase): out.get_info(Info(time=t, grid=None)) with self.assertRaises(FinamMetaDataError): - out.get_info(Info(time=t, grid=NoGrid())) + out.get_info(Info(time=t, grid=NoGrid(), units=None)) with self.assertRaises(FinamMetaDataError): out.get_info(Info(time=t, grid=NoGrid(), units=None)) diff --git a/tests/data/test_tools.py b/tests/data/test_tools.py index 6479f8316c664e6fca970cc92b30568b3f64faae..b93c18f05d3dc055037946372f17b3140d569676 100644 --- a/tests/data/test_tools.py +++ b/tests/data/test_tools.py @@ -240,7 +240,7 @@ class TestDataTools(unittest.TestCase): finam.data.to_xarray( 1.0 * finam.UNITS.meter, "A", - finam.Info(time, grid=finam.NoGrid(), units="km"), + finam.Info(time, grid=finam.NoGrid(), units="m^3"), ) def test_assert_type(self): diff --git a/tests/modules/test_control.py b/tests/modules/test_control.py index 06b7ece26e5e2b2ac87da0eb58dcb2703342077c..b84ebf01b3d4bd5a6caeb713eefcd5e29334e984 100644 --- a/tests/modules/test_control.py +++ b/tests/modules/test_control.py @@ -20,7 +20,7 @@ class TestTimeTrigger(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) diff --git a/tests/modules/test_csv_reader.py b/tests/modules/test_csv_reader.py index 2ea1c800467b21a6be0f96ae87e4664205a569fb..efec51bebdfec86230a545a541596994678d5161 100644 --- a/tests/modules/test_csv_reader.py +++ b/tests/modules/test_csv_reader.py @@ -51,11 +51,11 @@ class TestCsvReader(unittest.TestCase): reader.connect(start) reader.connect(start) - sink1.exchange_info(Info(None, grid=NoGrid())) - sink2.exchange_info(Info(None, grid=NoGrid())) + sink1.exchange_info(Info(None, grid=NoGrid(), units=None)) + sink2.exchange_info(Info(None, grid=NoGrid(), units=None)) - reader.outputs["X"].get_info(Info(None, grid=NoGrid())) - reader.outputs["Y"].get_info(Info(None, grid=NoGrid())) + reader.outputs["X"].get_info(Info(None, grid=NoGrid(), units=None)) + reader.outputs["Y"].get_info(Info(None, grid=NoGrid(), units=None)) reader.connect(start) reader.connect(start) diff --git a/tests/modules/test_noise.py b/tests/modules/test_noise.py index 8c7d2066aca9068dba4da62e3d6a1824a93c2242..2932c2b08e93fa95d71e7e842f1ba3cd9557400a 100644 --- a/tests/modules/test_noise.py +++ b/tests/modules/test_noise.py @@ -22,7 +22,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -54,7 +54,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -86,7 +86,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -118,7 +118,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -150,7 +150,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -182,7 +182,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -214,7 +214,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -246,7 +246,7 @@ class TestNoise(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -287,7 +287,7 @@ class TestStaticNoise(unittest.TestCase): # We want to get to a point where this works sink = fm.modules.DebugPushConsumer( inputs={ - "Input": fm.Info(time=None, grid=fm.NoGrid()), + "Input": fm.Info(time=None, grid=fm.NoGrid(), units="m"), }, log_data="INFO", ) diff --git a/tests/modules/test_parametric.py b/tests/modules/test_parametric.py index bc50ab899fd079722c12129dbb9bd72088f238f6..858cecde023a3f35decaeb6ca5af1c7a643103e1 100644 --- a/tests/modules/test_parametric.py +++ b/tests/modules/test_parametric.py @@ -26,7 +26,7 @@ class TestParametricGrid(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -62,7 +62,7 @@ class TestParametricGrid(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -100,7 +100,7 @@ class TestParametricGrid(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -135,7 +135,7 @@ class TestParametricGrid(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -171,7 +171,7 @@ class TestParametricGrid(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -207,7 +207,7 @@ class TestParametricGrid(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -243,7 +243,7 @@ class TestParametricGrid(unittest.TestCase): step=timedelta(days=1), ) sink = fm.modules.DebugConsumer( - {"Input": fm.Info(None, grid=None)}, + {"Input": fm.Info(None, grid=None, units=None)}, start=datetime(2000, 1, 1), step=timedelta(days=1), ) @@ -272,7 +272,7 @@ class TestStaticParametricGrid(unittest.TestCase): ) sink = fm.modules.DebugPushConsumer( inputs={ - "Input": fm.Info(time=None, grid=in_info.grid), + "Input": fm.Info(time=None, grid=in_info.grid, units=None), }, log_data="INFO", ) diff --git a/tests/tools/test_connect.py b/tests/tools/test_connect.py index e84e5adceb6b54e8c39fec7cab9c3000fd2229d7..56a7a7ee68c553bccfbad546c8a3a7d319c36187 100644 --- a/tests/tools/test_connect.py +++ b/tests/tools/test_connect.py @@ -320,7 +320,7 @@ class TestConnectHelper(unittest.TestCase): sink.exchange_info(Info(time=time, grid=UniformGrid((10, 10)), units="m")) connector.connect(start_time=time) - sources[0].push_info(Info(time=time, grid=UniformGrid((10, 10)))) + sources[0].push_info(Info(time=time, grid=UniformGrid((10, 10)), units="m")) sources[1].push_info(Info(time=time, grid=NoGrid(), units="m")) connector.connect(start_time=time) @@ -328,7 +328,7 @@ class TestConnectHelper(unittest.TestCase): self.assertEqual( connector.in_infos, { - "In1": Info(time=time, grid=UniformGrid((10, 10))), + "In1": Info(time=time, grid=UniformGrid((10, 10)), units="m"), "In2": Info(time=time, grid=NoGrid(), units="m"), }, )