From 811d6146f88508163bf3f36a6f03526adcc0a499 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Mon, 16 Sep 2024 09:56:52 -0500 Subject: [PATCH 1/5] Add missing class docstrings in resources module --- docs/source/resources.rst | 5 ++++- fabrictestbed_extensions/fablib/resources.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/source/resources.rst b/docs/source/resources.rst index c0ddc9e6..c478687e 100644 --- a/docs/source/resources.rst +++ b/docs/source/resources.rst @@ -6,12 +6,15 @@ resources .. autoclass:: fabrictestbed_extensions.fablib.resources.Resources :members: + :no-index: :special-members: __str__ .. autoclass:: fabrictestbed_extensions.fablib.resources.Links :members: + :no-index: :special-members: __str__ .. autoclass:: fabrictestbed_extensions.fablib.resources.FacilityPorts :members: - :special-members: __str__ \ No newline at end of file + :no-index: + :special-members: __str__ diff --git a/fabrictestbed_extensions/fablib/resources.py b/fabrictestbed_extensions/fablib/resources.py index 96201d85..afcbe6c7 100644 --- a/fabrictestbed_extensions/fablib/resources.py +++ b/fabrictestbed_extensions/fablib/resources.py @@ -45,6 +45,9 @@ class Resources: + """ + A class for working with FABRIC resources. + """ def __init__( self, fablib_manager, @@ -832,6 +835,10 @@ def validate_requested_ero_path(self, source: str, end: str, hops: List[str]): class Links(Resources): + """ + A class for working with network links. + """ + link_pretty_names = { "site_names": "Sites", "node_id": "Link Name", @@ -933,6 +940,10 @@ def list_links( class FacilityPorts(Resources): + """ + A class for working with FABRIC facility ports. + """ + link_pretty_names = { "name": "Name", "site_name": "Site", From 24c426c9739667878bdee9a6662a026439276fd6 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Mon, 16 Sep 2024 10:05:11 -0500 Subject: [PATCH 2/5] Trim whitespace --- docs/source/network_service.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/network_service.rst b/docs/source/network_service.rst index c9b8fc49..631a50dc 100644 --- a/docs/source/network_service.rst +++ b/docs/source/network_service.rst @@ -6,5 +6,5 @@ network_service .. autoclass:: fabrictestbed_extensions.fablib.network_service.NetworkService :members: - :no-index: + :no-index: :special-members: __str__ From bfe72e2f74637ad26acf106cf55b0343133a2bca Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Mon, 16 Sep 2024 10:05:53 -0500 Subject: [PATCH 3/5] Address warnings when building docs These are the warnings: > fabrictestbed_extensions/fablib/fablib.py:docstring of > fabrictestbed_extensions.fablib.fablib.FablibManager.get_slice_manager:8:Field > list ends without a blank line; unexpected unindent. [docutils] and: > fabrictestbed_extensions/fablib/fablib.py:docstring of > fabrictestbed_extensions.fablib.fablib.FablibManager.set_slice_manager:7:Field > list ends without a blank line; unexpected unindent. [docutils] --- fabrictestbed_extensions/fablib/fablib.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fabrictestbed_extensions/fablib/fablib.py b/fabrictestbed_extensions/fablib/fablib.py index c34b8294..c32310ff 100644 --- a/fabrictestbed_extensions/fablib/fablib.py +++ b/fabrictestbed_extensions/fablib/fablib.py @@ -1728,7 +1728,9 @@ def set_slice_manager(self, slice_manager: FabricManager): :param slice_manager: the slice manager to set :type slice_manager: SliceManager - .. deprecated:: 1.7.3 Use `set_manager()` instead. + + .. deprecated:: 1.7.3 + Use `set_manager()` instead. """ self.set_manager(manager=slice_manager) @@ -1736,13 +1738,14 @@ def get_slice_manager(self) -> FabricManager: """ Not intended as API call - Gets the slice manager of this fablib object. :return: the slice manager on this fablib object :rtype: SliceManager - .. deprecated:: 1.7.3 Use `get_manager()` instead. - """ + + .. deprecated:: 1.7.3 + Use `get_manager()` instead. + """ return self.get_manager() def set_manager(self, manager: FabricManager): From a40cfaaf610e7eeed2c6fe449986fa20b08085ba Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Mon, 16 Sep 2024 10:08:14 -0500 Subject: [PATCH 4/5] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64474ea9..0db7e1f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Artifact Manager Support (Issue [#358](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/358)) - FabNet user specified subnets (Issue [#361](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/361)) - Print a hint when bastion probe fails (Issue [#363](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/363)) +- Missing docstrings in resources module (Issue [#313](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/315)) ## [1.7.3] - 08/05/2024 ### Fixed From 120be0350837b6a1e2f491cc87fd8d27096f3526 Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Mon, 16 Sep 2024 10:20:32 -0500 Subject: [PATCH 5/5] Reformat --- fabrictestbed_extensions/fablib/fablib.py | 2 +- fabrictestbed_extensions/fablib/resources.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fabrictestbed_extensions/fablib/fablib.py b/fabrictestbed_extensions/fablib/fablib.py index c32310ff..0a0c74aa 100644 --- a/fabrictestbed_extensions/fablib/fablib.py +++ b/fabrictestbed_extensions/fablib/fablib.py @@ -1745,7 +1745,7 @@ def get_slice_manager(self) -> FabricManager: .. deprecated:: 1.7.3 Use `get_manager()` instead. - """ + """ return self.get_manager() def set_manager(self, manager: FabricManager): diff --git a/fabrictestbed_extensions/fablib/resources.py b/fabrictestbed_extensions/fablib/resources.py index afcbe6c7..88305f02 100644 --- a/fabrictestbed_extensions/fablib/resources.py +++ b/fabrictestbed_extensions/fablib/resources.py @@ -48,6 +48,7 @@ class Resources: """ A class for working with FABRIC resources. """ + def __init__( self, fablib_manager, @@ -838,7 +839,7 @@ class Links(Resources): """ A class for working with network links. """ - + link_pretty_names = { "site_names": "Sites", "node_id": "Link Name", @@ -943,7 +944,7 @@ class FacilityPorts(Resources): """ A class for working with FABRIC facility ports. """ - + link_pretty_names = { "name": "Name", "site_name": "Site",