From 1765a1c9e8f3d975c442eeb6d93b8149774859cc Mon Sep 17 00:00:00 2001 From: Marian Denes Date: Fri, 27 Mar 2020 18:47:24 +0100 Subject: [PATCH 1/6] DOC: Added docstring for show_versions() --- pandas/util/_print_versions.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index 7fc85a04e7d84..f7049711d9aec 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -88,6 +88,22 @@ def _get_dependency_info() -> Dict[str, JSONSerializable]: def show_versions(as_json: Union[str, bool] = False) -> None: + """ + Provides information about hosting operation system, pandas version, + and versions of other installed relative packages. + + Parameters + ---------- + as_json : str or bool, default False + * If False, outputs info in a human readable form to the console. + * If str, it will be considered as a path to a file. + Info will be written to that file in JSON format. + * If True, outputs info in JSON format to the console. + + Returns + ------- + None + """ sys_info = _get_sys_info() deps = _get_dependency_info() From 96ba47f02184c275e711c427c1b73233e24bf6d5 Mon Sep 17 00:00:00 2001 From: Marian Denes Date: Fri, 27 Mar 2020 21:21:38 +0100 Subject: [PATCH 2/6] DOC: Updating docstring for show_versions() --- pandas/util/_print_versions.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index f7049711d9aec..7e8c1433121f2 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -89,8 +89,7 @@ def _get_dependency_info() -> Dict[str, JSONSerializable]: def show_versions(as_json: Union[str, bool] = False) -> None: """ - Provides information about hosting operation system, pandas version, - and versions of other installed relative packages. + Provides information about hosting operation system, pandas version, and versions of other installed relative packages. Parameters ---------- @@ -99,10 +98,6 @@ def show_versions(as_json: Union[str, bool] = False) -> None: * If str, it will be considered as a path to a file. Info will be written to that file in JSON format. * If True, outputs info in JSON format to the console. - - Returns - ------- - None """ sys_info = _get_sys_info() deps = _get_dependency_info() From 32c00b9d6a6019f85d472246ebd04b3fdf37baaa Mon Sep 17 00:00:00 2001 From: Marian Denes Date: Fri, 27 Mar 2020 21:39:34 +0100 Subject: [PATCH 3/6] DOC: Fixed docstring for show_versions() --- pandas/util/_print_versions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index 7e8c1433121f2..c720f2b8670fe 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -89,7 +89,10 @@ def _get_dependency_info() -> Dict[str, JSONSerializable]: def show_versions(as_json: Union[str, bool] = False) -> None: """ - Provides information about hosting operation system, pandas version, and versions of other installed relative packages. + Provides useful information, important for bug reports. + + It comprises info about hosting operation system, pandas version, + and versions of other installed relative packages. Parameters ---------- From 1c07c53b225769cf5589306edfa016871332ec8a Mon Sep 17 00:00:00 2001 From: Marian Denes Date: Fri, 27 Mar 2020 23:20:05 +0100 Subject: [PATCH 4/6] DOC: Fixed superfluous whitespaces in docstring --- pandas/util/_print_versions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index c720f2b8670fe..757620e4d561d 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -90,8 +90,8 @@ def _get_dependency_info() -> Dict[str, JSONSerializable]: def show_versions(as_json: Union[str, bool] = False) -> None: """ Provides useful information, important for bug reports. - - It comprises info about hosting operation system, pandas version, + + It comprises info about hosting operation system, pandas version, and versions of other installed relative packages. Parameters From 1cae13a664ea6e4a00232fe13892d9e0648d634e Mon Sep 17 00:00:00 2001 From: Marian Denes Date: Sun, 29 Mar 2020 16:32:54 +0200 Subject: [PATCH 5/6] DOC: Added show_versions() to API docs --- doc/source/reference/general_utility_functions.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/source/reference/general_utility_functions.rst b/doc/source/reference/general_utility_functions.rst index 0d9e0b0f4c668..9fb657b707707 100644 --- a/doc/source/reference/general_utility_functions.rst +++ b/doc/source/reference/general_utility_functions.rst @@ -30,6 +30,13 @@ Testing functions testing.assert_index_equal testing.assert_extension_array_equal +Bug report function +------------------- +.. autosummary:: + :toctree: api/ + + show_versions + Exceptions and warnings ----------------------- .. autosummary:: From dc7d187ddc33fcc537a7992b8ccf8a2883979ede Mon Sep 17 00:00:00 2001 From: Marian Denes Date: Mon, 30 Mar 2020 16:22:32 +0200 Subject: [PATCH 6/6] DOC: show_versions() fix in docstring / API docs --- .../reference/general_utility_functions.rst | 15 ++++++++------- pandas/util/_print_versions.py | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/source/reference/general_utility_functions.rst b/doc/source/reference/general_utility_functions.rst index 9fb657b707707..575b82b4b06de 100644 --- a/doc/source/reference/general_utility_functions.rst +++ b/doc/source/reference/general_utility_functions.rst @@ -30,13 +30,6 @@ Testing functions testing.assert_index_equal testing.assert_extension_array_equal -Bug report function -------------------- -.. autosummary:: - :toctree: api/ - - show_versions - Exceptions and warnings ----------------------- .. autosummary:: @@ -115,3 +108,11 @@ Scalar introspection api.types.is_re api.types.is_re_compilable api.types.is_scalar + +Bug report function +------------------- +.. autosummary:: + :toctree: api/ + + show_versions + diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index 757620e4d561d..72003eeddf5ee 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -89,7 +89,7 @@ def _get_dependency_info() -> Dict[str, JSONSerializable]: def show_versions(as_json: Union[str, bool] = False) -> None: """ - Provides useful information, important for bug reports. + Provide useful information, important for bug reports. It comprises info about hosting operation system, pandas version, and versions of other installed relative packages.