From 2f5cad3d05775afeb373cb6d5186e790f395be7a Mon Sep 17 00:00:00 2001 From: Nicolas Kruse Date: Wed, 18 Jun 2025 08:48:51 +0200 Subject: [PATCH] Docs and doc generation updated for the restructuring --- docs/source/floatarray.md | 4 ++-- docs/source/generate_class_list.py | 6 ++---- docs/source/ndfloat.md | 4 ++-- tests/test_to_pandas.py | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/source/floatarray.md b/docs/source/floatarray.md index 98c5e3c..1bfcc81 100644 --- a/docs/source/floatarray.md +++ b/docs/source/floatarray.md @@ -1,5 +1,5 @@ -# gaspype.FloatArray +# gaspype.typing.FloatArray ```{eval-rst} -.. autoclass:: gaspype.FloatArray +.. autoclass:: gaspype.typing.FloatArray ``` \ No newline at end of file diff --git a/docs/source/generate_class_list.py b/docs/source/generate_class_list.py index 951ffdb..f2e48f4 100644 --- a/docs/source/generate_class_list.py +++ b/docs/source/generate_class_list.py @@ -17,8 +17,7 @@ def write_classes(f: TextIOWrapper, patterns: list[str], module_name: str, title classes = [ name for name, obj in inspect.getmembers(module, inspect.isclass) - if (obj.__module__ == module_name and - any(fnmatch.fnmatch(name, pat) for pat in patterns if pat not in exclude) and + if (any(fnmatch.fnmatch(name, pat) for pat in patterns if pat not in exclude) and obj.__doc__ and '(Automatic generated stub)' not in obj.__doc__) ] @@ -45,8 +44,7 @@ def write_functions(f: TextIOWrapper, patterns: list[str], module_name: str, tit functions = [ name for name, obj in inspect.getmembers(module, inspect.isfunction) - if (obj.__module__ == module_name and - any(fnmatch.fnmatch(name, pat) for pat in patterns if pat not in exclude)) + if (any(fnmatch.fnmatch(name, pat) for pat in patterns if pat not in exclude)) ] if description: diff --git a/docs/source/ndfloat.md b/docs/source/ndfloat.md index 1ac7868..d2b091b 100644 --- a/docs/source/ndfloat.md +++ b/docs/source/ndfloat.md @@ -1,5 +1,5 @@ -# gaspype.NDFloat +# gaspype.typing.NDFloat ```{eval-rst} -.. autoclass:: gaspype.NDFloat +.. autoclass:: gaspype.typing.NDFloat ``` \ No newline at end of file diff --git a/tests/test_to_pandas.py b/tests/test_to_pandas.py index ed3d122..f6c4cf5 100644 --- a/tests/test_to_pandas.py +++ b/tests/test_to_pandas.py @@ -22,6 +22,7 @@ def test_elements(): df = pd.DataFrame(list(gp.elements(fl * np.array([1, 2, 3, 4])))) assert df.shape == (4, 2) + def test_iter(): fl = gp.fluid({'O2': 1, 'H2': 2, 'H2O': 3})