From ec4b9526eb44cd6b789bee0c0c6752e53a6d042a Mon Sep 17 00:00:00 2001 From: Zebedee Nicholls Date: Sat, 18 Jan 2025 19:48:44 +0100 Subject: [PATCH] WIP: Experiment some more Actual dev thinking about this, see https://github.com/mkdocstrings/python/issues/230#issuecomment-2599778130 --- docs/griffe-ext.py | 17 +++++++++-------- docs/pandas-accessors.md | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/griffe-ext.py b/docs/griffe-ext.py index 145a63f..fb94c59 100644 --- a/docs/griffe-ext.py +++ b/docs/griffe-ext.py @@ -43,11 +43,11 @@ def on_instance( modules = self.class_to_apply_to.split(".")[:-1] class_of_interest = self.class_to_apply_to.split(".")[0] - if isinstance(obj, griffe.Module) and obj.name in modules: - breakpoint() - - if isinstance(obj, griffe.Class) and obj.name == class_of_interest: - breakpoint() + # if isinstance(obj, griffe.Module) and obj.name in modules: + # breakpoint() + # + # if isinstance(obj, griffe.Class) and obj.name == class_of_interest: + # breakpoint() def on_package_loaded( self, *, pkg: griffe.Module, loader: griffe.GriffeLoader, **kwargs: Any @@ -65,10 +65,11 @@ def on_package_loaded( # self.namespace, # loader.modules_collection.get_member(self.class_to_apply_to_root_package), # ) + # breakpoint() - # Delete what it thinks it has loaded from modules_collection - # so it knows to re-load this module next time. - loader.modules_collection.del_member(self.class_to_apply_to_root_package) + # # Delete what it thinks it has loaded from modules_collection + # # so it knows to re-load this module next time. + # loader.modules_collection.del_member(self.class_to_apply_to_root_package) def on_class_members( self, diff --git a/docs/pandas-accessors.md b/docs/pandas-accessors.md index 3775144..23fb32c 100644 --- a/docs/pandas-accessors.md +++ b/docs/pandas-accessors.md @@ -34,11 +34,11 @@ register_pandas_accessor() The full accessor API is documented below. -::: continuous_timeseries.pandas_accessors.SeriesCTAccessor +::: pandas.Series.ct options: extensions: - "docs/griffe-ext.py:AccessorNamespace": - class_to_apply_to: continuous_timeseries.pandas_accessors.SeriesCTAccessor + class_to_pull_from: continuous_timeseries.pandas_accessors.SeriesCTAccessor namespace: "pd.Series.ct" preload_modules: - continuous_timeseries.pandas_accessors.SeriesCTAccessor