Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.16.2
rev: v2.18.1
hooks:
- id: pyproject-fmt
- repo: https://github.com/lyz-code/yamlfix
Expand Down Expand Up @@ -46,8 +46,12 @@ repos:
rev: v1.38.0
hooks:
- id: yamllint
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.0
hooks:
- id: check-github-workflows
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
rev: v0.15.6
hooks:
- id: ruff-check
args:
Expand Down Expand Up @@ -79,6 +83,14 @@ repos:
args:
- --wrap
- '88'
files: (CLAUDE\.md|README\.md)
files: (AGENTS\.md|CLAUDE\.md|README\.md)
- id: mdformat
additional_dependencies:
- mdformat-myst
- mdformat-ruff
args:
- --wrap
- '88'
files: docs/.
ci:
autoupdate_schedule: monthly
73 changes: 73 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@https://raw.githubusercontent.com/OpenSourceEconomics/ai-instructions/make-submodule/profiles/tier-a.md

# dags

## Overview

**dags** is a Python library for creating executable DAGs (Directed Acyclic Graphs) from
interdependent functions. It provides tools to concatenate functions, manage type
annotations, and execute function graphs.

## Build & Test

This project uses [pixi](https://pixi.sh) for environment management.

```bash
pixi run -e py313 tests # Run tests with Python 3.13
pixi run -e py314 tests # Run tests with Python 3.14
pixi run -e py313 tests-with-cov # Run tests with coverage
pixi run ty # Type checking
prek run --all-files # Linting & formatting
pixi run -e docs build-docs # Build HTML docs with Jupyter Book
pixi run -e docs view-docs # Live preview of docs
```

Available Python environments: `py311`, `py312`, `py313`, `py314`

Documentation uses **Jupyter Book 2.0** with **MyST** markdown. Config is in
`docs/myst.yml`. Docs include executable Jupyter notebooks.

## Architecture

```
src/dags/
├── __init__.py # Main exports
├── annotations.py # Type annotation handling
├── dag.py # Core DAG functionality (concatenate_functions)
├── exceptions.py # Custom exceptions
├── output.py # Output processing utilities
├── signature.py # Function signature utilities
├── typing.py # Type definitions
├── utils.py # General utilities
└── tree/ # Tree-related utilities

docs/
├── myst.yml # Jupyter Book config
├── index.ipynb # Homepage
├── getting_started.ipynb # Getting started guide
├── usage_patterns.ipynb # Interactive examples notebook
├── tree.ipynb # Tree utilities docs
└── api.md # API reference

tests/
├── test_annotations.py # Annotation tests
├── test_dag.py # DAG concatenation tests
├── test_signature.py # Signature tests
└── ...
```

### Key Modules

- **annotations.py**: Handles function type annotations, including a workaround for
Python 3.14's `functools.wraps` annotation mismatch bug
- **dag.py**: Core `concatenate_functions()` for combining interdependent functions into
a single callable
- **exceptions.py**: `AnnotationMismatchError`, `NonStringAnnotationError`, etc.

## Code Style

- Does **not** use `from __future__ import annotations` or `TYPE_CHECKING` blocks
- Ruff for linting (target: Python 3.11)
- ty for type checking (all rules set to error)
- Google docstring convention
- User-facing APIs accept `Sequence` (not `list`) for input parameters
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ This is a record of all past dags releases and what went into them in reverse
chronological order. We follow [semantic versioning](https://semver.org/) and all
releases are available on [conda-forge](https://anaconda.org/conda-forge/dags).

## 0.5.1

- :gh:`79` Use AGENTS.md, update hooks and rules (:ghuser:`hmgaudecker`).

- :gh:`78` Fix `decorator_rename_arguments` by calling `get_free_arguments` inside the
decorator (:ghuser:`hmgaudecker`).

## 0.5.0

- :gh:`77` Fix `decorator_rename_arguments` by calling `get_free_arguments` inside the
Expand Down
89 changes: 1 addition & 88 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,88 +1 @@
# CLAUDE.md

## Project Overview

**dags** is a Python library for creating executable DAGs (Directed Acyclic Graphs) from
interdependent functions. It provides tools to concatenate functions, manage type
annotations, and execute function graphs.

## Development Setup

This project uses **pixi** for environment management.

### Running Tests

```bash
pixi run -e py313 tests # Run tests with Python 3.13
pixi run -e py314 tests # Run tests with Python 3.14
pixi run -e py313 tests-with-cov # Run tests with coverage
```

Available Python environments: `py311`, `py312`, `py313`, `py314`

### Type Checking

```bash
pixi run ty
```

### Linting & Formatting

```bash
pixi run prek run --all-files
```

### Building Docs

```bash
pixi run -e docs build-docs # Build HTML docs with Jupyter Book
pixi run -e docs view-docs # Live preview of docs
```

Documentation uses **Jupyter Book 2.0** with **MyST** markdown. Config is in
`docs/myst.yml`. Docs include executable Jupyter notebooks.

## Project Structure

```
src/dags/
├── __init__.py # Main exports
├── annotations.py # Type annotation handling
├── dag.py # Core DAG functionality (concatenate_functions)
├── exceptions.py # Custom exceptions
├── output.py # Output processing utilities
├── signature.py # Function signature utilities
├── typing.py # Type definitions
├── utils.py # General utilities
└── tree/ # Tree-related utilities

docs/
├── myst.yml # Jupyter Book config
├── index.ipynb # Homepage
├── getting_started.ipynb # Getting started guide
├── usage_patterns.ipynb # Interactive examples notebook
├── tree.ipynb # Tree utilities docs
└── api.md # API reference

tests/
├── test_annotations.py # Annotation tests
├── test_dag.py # DAG concatenation tests
├── test_signature.py # Signature tests
└── ...
```

## Key Modules

- **annotations.py**: Handles function type annotations, including a workaround for
Python 3.14's `functools.wraps` annotation mismatch bug
- **dag.py**: Core `concatenate_functions()` for combining interdependent functions into
a single callable
- **exceptions.py**: `AnnotationMismatchError`, `NonStringAnnotationError`, etc.

## Code Style

- Does **not** use `from __future__ import annotations` or `TYPE_CHECKING` blocks
- Ruff for linting (target: Python 3.11)
- ty for type checking (all rules set to error)
- Google docstring convention
- User-facing APIs accept `Sequence` (not `list`) for input parameters
@AGENTS.md
Loading
Loading