Links
AI / Agents
gdtest-big-class
Package with a class that has >5 methods, testing separate method section generation in Great Docs.
DataProcessor class has 8 public methods, exceeding the threshold for expanded rendering. On the Reference page you should see three sections: ‘Classes’, ‘DataProcessor Methods’ (a dedicated subsection listing all 8 methods), and ‘Functions’ (load_data, save_data). The key test: big-class method extraction into a separate section.
Source files
gdtest_big_class/
__init__.py
"""Package with a large class to test method-section generation."""
__version__ = "0.1.0"
__all__ = ["DataProcessor", "load_data", "save_data"]
class DataProcessor:
"""
A data processing pipeline with many operations.
Parameters
----------
name
The name of this processor instance.
Examples
--------
>>> dp = DataProcessor("etl")
>>> dp.name
'etl'
"""
def __init__(self, name: str):
self.name = name
self._data = None
def load(self, path: str) -> None:
"""
Load data from a file path.
Parameters
----------
path
Path to the data file.
"""
self._data = path
def transform(self, func) -> "DataProcessor":
"""
Apply a transformation function to the data.
Parameters
----------
func
A callable that transforms the data.
Returns
-------
DataProcessor
Self, for method chaining.
"""
return self
def filter(self, predicate) -> "DataProcessor":
"""
Filter data based on a predicate.
Parameters
----------
predicate
A callable returning True for rows to keep.
Returns
-------
DataProcessor
Self, for method chaining.
"""
return self
def sort(self, key: str, ascending: bool = True) -> "DataProcessor":
"""
Sort data by a key.
Parameters
----------
key
The column/field to sort by.
ascending
Sort ascending if True, descending if False.
Returns
-------
DataProcessor
Self, for method chaining.
"""
return self
def aggregate(self, func, column: str) -> "DataProcessor":
"""
Aggregate data by applying a function to a column.
Parameters
----------
func
Aggregation function (e.g., sum, mean).
column
Column to aggregate.
Returns
-------
DataProcessor
Self, for method chaining.
"""
return self
def validate(self) -> bool:
"""
Validate the current data state.
Returns
-------
bool
True if data is valid.
"""
return self._data is not None
def export(self, path: str, fmt: str = "csv") -> None:
"""
Export data to a file.
Parameters
----------
path
Output file path.
fmt
Output format (csv, json, parquet).
"""
pass
def summary(self) -> dict:
"""
Return a summary of the data.
Returns
-------
dict
A dictionary with summary statistics.
"""
return {"name": self.name, "has_data": self._data is not None}
def load_data(path: str) -> DataProcessor:
"""
Convenience function to create a processor and load data.
Parameters
----------
path
Path to the data file.
Returns
-------
DataProcessor
A new processor with data loaded.
"""
dp = DataProcessor("default")
dp.load(path)
return dp
def save_data(processor: DataProcessor, path: str) -> None:
"""
Save processor data to a file.
Parameters
----------
processor
The data processor whose data to save.
path
Output file path.
"""
processor.export(path)README.md
# gdtest-big-class Package with a class that has >5 methods, testing separate method section generation in Great Docs.
great-docs.yml generated
# Great Docs Configuration
# See https://posit-dev.github.io/great-docs/user-guide/configuration.html
# Module Name (optional)
# ----------------------
# Set this if your importable module name differs from the project name.
# Example: project 'py-yaml12' with module name 'yaml12'
# module: yaml12
# Docstring Parser
# ----------------
# The docstring format used in your package (numpy, google, or sphinx)
parser: numpy
# Dynamic Introspection
# ---------------------
# Use runtime introspection for more accurate documentation (default: true)
# Set to false if your package has cyclic alias issues (e.g., PyO3/Rust bindings)
dynamic: true
# API Discovery Settings
# ----------------------
# Exclude items from auto-documentation
# exclude:
# - InternalClass
# - helper_function
# Logo & Favicon
# ---------------
# Point to a single logo file (replaces the text title in the navbar):
# logo: assets/logo.svg
#
# For light/dark variants:
# logo:
# light: assets/logo-light.svg
# dark: assets/logo-dark.svg
#
# To show the text title alongside the logo, add: show_title: true
# Funding / Copyright Holder
# --------------------------
# Credit the organization that funds or holds copyright for this package.
# Displays in sidebar and footer. Homepage and ROR provide links.
# funding:
# name: "Posit Software, PBC"
# roles:
# - Copyright holder
# - funder
# homepage: https://posit.co
# ror: https://ror.org/03wc8by49
# API Reference Structure
# -----------------------
# Customize the sections below to organize your API documentation.
# - Reorder items within a section to change their display order
# - Move items between sections or create new sections
# - Use 'members: false' to exclude methods from documentation
# - Add 'desc:' to sections for descriptions
reference:
- title: Classes
desc: Main classes provided by the package
contents:
- name: DataProcessor
members: false # 8 methods listed below
- title: DataProcessor Methods
desc: Methods for the DataProcessor class
contents:
- DataProcessor.load
- DataProcessor.transform
- DataProcessor.filter
- DataProcessor.sort
- DataProcessor.aggregate
- DataProcessor.validate
- DataProcessor.export
- DataProcessor.summary
- title: Functions
desc: Utility functions
contents:
- load_data
- save_data
# Site URL
# --------
# Canonical address of the deployed documentation site.
# Required for subdirectory deployments, skills page install commands,
# .well-known/ discovery, and sitemaps.
# site_url: "https://your-org.github.io/your-package/"
# Site Settings
# -------------
# site:
# theme: flatly # Quarto theme (default: flatly)
# toc: true # Show table of contents (default: true)
# toc-depth: 2 # TOC heading depth (default: 2)
# toc-title: On this page # TOC title (default: "On this page")
# Jupyter Kernel
# --------------
# Jupyter kernel to use for executing code cells in .qmd files.
# This is set at the project level so it applies to all pages, including
# auto-generated API reference pages. Can be overridden in individual .qmd
# file frontmatter if needed for special cases.
jupyter: python3
# CLI Documentation
# -----------------
# cli:
# enabled: true # Enable CLI documentation
# module: my_package.cli # Module containing Click commands
# name: cli # Name of the Click command object