Skip to content

Commit

Permalink
WIP: Experiment some more
Browse files Browse the repository at this point in the history
Actual dev thinking about this,
see
mkdocstrings/python#230 (comment)
  • Loading branch information
znicholls committed Jan 18, 2025
1 parent f69c3cb commit ec4b952
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions docs/griffe-ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions docs/pandas-accessors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec4b952

Please sign in to comment.