From da27c2d74c128799502013a58810d5f63805ef6c Mon Sep 17 00:00:00 2001 From: Martin Lange <martin.lange@ufz.de> Date: Mon, 28 Nov 2022 10:59:17 +0100 Subject: [PATCH] fix docs and doctests for renamed arguments --- docs/source/finam-book/development/adapters.rst | 4 ++-- docs/source/finam-book/development/components.rst | 4 ++-- docs/source/finam-book/development/connect_phase.rst | 2 +- .../finam-book/development/special_components.rst | 4 ++-- docs/source/finam-book/usage/coupling_scripts.rst | 4 ++-- src/finam/schedule.py | 10 +++++----- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/source/finam-book/development/adapters.rst b/docs/source/finam-book/development/adapters.rst index ff369964..6d7472cb 100644 --- a/docs/source/finam-book/development/adapters.rst +++ b/docs/source/finam-book/development/adapters.rst @@ -70,7 +70,7 @@ File ``src/scale.py``: generator.outputs["Value"] >> adapter >> consumer.inputs["Input"] - comp.run(t_max=datetime(2000, 1, 2)) + comp.run(end=datetime(2000, 1, 2)) print(fm.data.strip_data(consumer.data["Input"])) @@ -244,7 +244,7 @@ In :meth:`.Adapter._get_data`, we can now do the interpolation whenever data is generator.outputs["Value"] >> adapter >> consumer.inputs["Input"] - comp.run(t_max=datetime(2000, 1, 15)) + comp.run(end=datetime(2000, 1, 15)) print(fm.data.strip_data(consumer.data["Input"])) diff --git a/docs/source/finam-book/development/components.rst b/docs/source/finam-book/development/components.rst index 784ee29a..a0d4bac9 100644 --- a/docs/source/finam-book/development/components.rst +++ b/docs/source/finam-book/development/components.rst @@ -320,7 +320,7 @@ In :meth:`.TimeComponent._update`, we get the component's input data, do a "mode def test_dummy_model(self): # ... - composition.run(t_max=datetime(2000, 12, 31)) + composition.run(end=datetime(2000, 12, 31)) The test should fail, as we still need to implement the :meth:`.TimeComponent._finalize()` method. @@ -442,7 +442,7 @@ Here is the final code of the completed component. self.assertEqual(consumer.data, {"Sum": 0}) - composition.run(t_max=datetime(2000, 12, 31)) + composition.run(end=datetime(2000, 12, 31)) if __name__ == "__main__": unittest.main() diff --git a/docs/source/finam-book/development/connect_phase.rst b/docs/source/finam-book/development/connect_phase.rst index 2b9b2ff9..ffed666f 100644 --- a/docs/source/finam-book/development/connect_phase.rst +++ b/docs/source/finam-book/development/connect_phase.rst @@ -243,7 +243,7 @@ and the initial data should be generated from it. push_infos["Area"] = info push_data["Area"] = _generate_data(info) - self.try_connect(time=start_time, + self.try_connect(start_time=start_time, push_infos=push_infos, push_data=push_data) diff --git a/docs/source/finam-book/development/special_components.rst b/docs/source/finam-book/development/special_components.rst index 1f754af8..6e32fb67 100644 --- a/docs/source/finam-book/development/special_components.rst +++ b/docs/source/finam-book/development/special_components.rst @@ -82,7 +82,7 @@ Push-based components can use :class:`.CallbackInput` to get informed about inco generator.outputs["Value"] >> push_comp.inputs["Input"] - comp.run(t_max=datetime(2000, 1, 15)) + comp.run(end=datetime(2000, 1, 15)) In ``_initialize()``, a :class:`.CallbackInput` is added that calls ``_data_changed()`` when notified about new data. @@ -153,7 +153,7 @@ Push-based components can use :class:`.CallbackOutput` to intercept data pulls. pull_comp.outputs["Output"] >> consumer.inputs["Input"] - comp.run(t_max=datetime(2000, 1, 15)) + comp.run(end=datetime(2000, 1, 15)) In ``_initialize()``, a :class:`.CallbackOutput` is added that calls ``_get_data()`` when pulled. ``_get_data()`` must return the data that would normally be pushed to the output. diff --git a/docs/source/finam-book/usage/coupling_scripts.rst b/docs/source/finam-book/usage/coupling_scripts.rst index 8d980964..d7fdcd7d 100644 --- a/docs/source/finam-book/usage/coupling_scripts.rst +++ b/docs/source/finam-book/usage/coupling_scripts.rst @@ -43,7 +43,7 @@ Here is a simple example coupling two components: generator.outputs["Noise"] >> consumer.inputs["Value"] # Run the composition until June 2000 - composition.run(t_max=datetime(2000, 6, 30)) # doctest: +ELLIPSIS + composition.run(end=datetime(2000, 6, 30)) # doctest: +ELLIPSIS .. testoutput:: simple-example :hide: @@ -149,7 +149,7 @@ time steps and an adapter: ) # Run the composition until June 2000 - composition.run(t_max=datetime(2000, 6, 30)) # doctest: +ELLIPSIS + composition.run(end=datetime(2000, 6, 30)) # doctest: +ELLIPSIS .. testoutput:: adapter-example :hide: diff --git a/src/finam/schedule.py b/src/finam/schedule.py index efee5a5b..fa6e333a 100644 --- a/src/finam/schedule.py +++ b/src/finam/schedule.py @@ -55,7 +55,7 @@ class Composition(Loggable): comp_b.outputs["Out"] >> SomeAdapter() >> comp_b.inputs["In"] - composition.run(t_max=...) + composition.run(end=...) Parameters ---------- @@ -161,7 +161,7 @@ class Composition(Loggable): if len(time_modules) == 0: if start_time is not None: raise ValueError( - "t must be None for a composition without time components" + "start must be None for a composition without time components" ) else: if start_time is None: @@ -178,7 +178,7 @@ class Composition(Loggable): start_time = t_min if not isinstance(start_time, datetime): raise ValueError( - "t must be of type datetime for a composition with time components" + "start must be of type datetime for a composition with time components" ) self._validate_composition() @@ -216,12 +216,12 @@ class Composition(Loggable): if len(time_modules) == 0: if end is not None: raise ValueError( - "t_max must be None for a composition without time components" + "end must be None for a composition without time components" ) else: if not isinstance(end, datetime): raise ValueError( - "t_max must be of type datetime for a composition with time components" + "end must be of type datetime for a composition with time components" ) if not self.is_connected: -- GitLab