Links
AI / Agents
gdtest-small-class
A synthetic test package with small classes (≤5 methods each).
Two small classes (Point, Color) each with ≤5 methods. On the Reference page you should see a ‘Classes’ section where methods are rendered inline within each class entry — there should be NO separate ‘Point Methods’ or ‘Color Methods’ subsection pages.
Source files
gdtest_small_class/
__init__.py
"""A test package with small classes (≤5 methods each)."""
__version__ = "0.1.0"
__all__ = ["Point", "Color"]
class Point:
"""
A 2D point.
Parameters
----------
x
The x coordinate.
y
The y coordinate.
"""
def __init__(self, x: float = 0.0, y: float = 0.0):
self.x = x
self.y = y
def distance_to(self, other: "Point") -> float:
"""
Calculate distance to another point.
Parameters
----------
other
The other point.
Returns
-------
float
Euclidean distance.
"""
return ((self.x - other.x) ** 2 + (self.y - other.y) ** 2) ** 0.5
def translate(self, dx: float, dy: float) -> "Point":
"""
Return a new point translated by (dx, dy).
Parameters
----------
dx
Horizontal offset.
dy
Vertical offset.
Returns
-------
Point
New translated point.
"""
return Point(self.x + dx, self.y + dy)
def as_tuple(self) -> tuple:
"""
Convert to a tuple.
Returns
-------
tuple
(x, y) tuple.
"""
return (self.x, self.y)
class Color:
"""
An RGB color.
Parameters
----------
r
Red channel (0-255).
g
Green channel (0-255).
b
Blue channel (0-255).
"""
def __init__(self, r: int = 0, g: int = 0, b: int = 0):
self.r = r
self.g = g
self.b = b
def to_hex(self) -> str:
"""
Convert to hex string.
Returns
-------
str
Hex color like ``#FF0000``.
"""
return f"#{self.r:02X}{self.g:02X}{self.b:02X}"
def lighten(self, amount: float = 0.1) -> "Color":
"""
Return a lighter version of this color.
Parameters
----------
amount
Lighten factor (0.0 to 1.0).
Returns
-------
Color
New lighter color.
"""
factor = 1 + amount
return Color(
min(255, int(self.r * factor)),
min(255, int(self.g * factor)),
min(255, int(self.b * factor)),
)
def brightness(self) -> float:
"""
Calculate perceived brightness.
Returns
-------
float
Brightness value (0.0 to 1.0).
"""
return (0.299 * self.r + 0.587 * self.g + 0.114 * self.b) / 255README.md
# gdtest-small-class A synthetic test package with small classes (≤5 methods each).
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:
- Color # 3 method(s)
- Point # 3 method(s)
# 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