Skip to content

Generated docstring format + install from GitHub URL - #5

Merged
egparedes merged 3 commits into
mainfrom
docstring-format-install
Oct 5, 2026
Merged

egparedes merged 3 commits into
mainfrom
docstring-format-install

Conversation

@egparedes

Copy link
Copy Markdown
Contributor

Two minor changes:

1. Generated-source docstring: triple quotes on their own lines

The embedded original source now renders in conventional docstring style — opening quotes, outer-level source lines, and the closing quotes all at function-body indent, inner lines keeping their relative indentation:

def add_vec(x, y):
    """
    def add(x, y):
        return x + y
    """
    xp = array_namespace(*[a for a in (x, y) if hasattr(a, '__array_namespace__')])
    return x + y
  • The docstring is cleandoc-exact: ast.get_docstring / inspect.getdoc on the generated function recover the original scalar source verbatim (added as a regression test).
  • All 42 golden snapshots regenerated (verified programmatically: pure 4-space re-indent of docstring lines, nothing else changed); generated-source examples in README and docs/index.md updated to match.

2. Installation instructions use the GitHub repo URL

README and docs/index.md now install via pip install "array-vectorize @ git+https://github.com/grAItools/array-vectorize.git" instead of assuming a local checkout (dev-from-checkout kept as a secondary note; PyPI note added).

Verification

make check (711 passed, coverage 96%), make docs strict — all green. Formatter considered and rejected for generated source: ast.unparse output stays the single deterministic renderer (no runtime formatting dependency).

@egparedes
egparedes merged commit c5c3734 into main Oct 5, 2026
5 checks passed
@egparedes
egparedes deleted the docstring-format-install branch October 6, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant