fftloggin 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. fftloggin-0.2.0/.claude/agents/docstring-updater.md +116 -0
  2. fftloggin-0.2.0/.claude/settings.local.json +10 -0
  3. fftloggin-0.2.0/.github/workflows/claude-code-review.yml +57 -0
  4. fftloggin-0.2.0/.github/workflows/claude.yml +50 -0
  5. fftloggin-0.2.0/.github/workflows/test.yml +91 -0
  6. fftloggin-0.2.0/.gitignore +216 -0
  7. fftloggin-0.2.0/.pre-commit-config.yaml +41 -0
  8. fftloggin-0.2.0/AGENTS.md +59 -0
  9. fftloggin-0.2.0/CHANGELOG.md +64 -0
  10. fftloggin-0.2.0/CLAUDE.md +239 -0
  11. fftloggin-0.2.0/COSMOLOGY_IMPROVEMENTS.md +429 -0
  12. fftloggin-0.2.0/LICENSE +21 -0
  13. fftloggin-0.2.0/PKG-INFO +120 -0
  14. fftloggin-0.2.0/README.md +92 -0
  15. fftloggin-0.2.0/TODOS.md +1 -0
  16. fftloggin-0.2.0/benchmark/README.md +31 -0
  17. fftloggin-0.2.0/benchmark/build.sh +34 -0
  18. fftloggin-0.2.0/benchmark/cdgamma.f +260 -0
  19. fftloggin-0.2.0/benchmark/drfftb.f +503 -0
  20. fftloggin-0.2.0/benchmark/drfftf.f +499 -0
  21. fftloggin-0.2.0/benchmark/drffti.f +87 -0
  22. fftloggin-0.2.0/benchmark/fftlog.f +854 -0
  23. fftloggin-0.2.0/benchmark/fftlogtest.f +167 -0
  24. fftloggin-0.2.0/benchmark/plot.gp +9 -0
  25. fftloggin-0.2.0/debug_gaussian_test.png +0 -0
  26. fftloggin-0.2.0/debug_gaussian_test.py +124 -0
  27. fftloggin-0.2.0/fftlog_cosmoprimo.py +919 -0
  28. fftloggin-0.2.0/notebooks/tutorial.ipynb +284 -0
  29. fftloggin-0.2.0/notebooks/tutorial.py +737 -0
  30. fftloggin-0.2.0/notebooks/tutorial_script.py +375 -0
  31. fftloggin-0.2.0/pyproject.toml +81 -0
  32. fftloggin-0.2.0/src/fftloggin/__init__.py +15 -0
  33. fftloggin-0.2.0/src/fftloggin/fftlog.py +665 -0
  34. fftloggin-0.2.0/src/fftloggin/grids.py +379 -0
  35. fftloggin-0.2.0/src/fftloggin/kernels.py +341 -0
  36. fftloggin-0.2.0/src/fftloggin/utils.py +254 -0
  37. fftloggin-0.2.0/tests/conftest.py +58 -0
  38. fftloggin-0.2.0/tests/generate_benchmarks.py +177 -0
  39. fftloggin-0.2.0/tests/test_benchmark.py +144 -0
  40. fftloggin-0.2.0/tests/test_fftlog.py +552 -0
  41. fftloggin-0.2.0/tests/test_grid.py +337 -0
  42. fftloggin-0.2.0/tests/test_kernels.py +177 -0
  43. fftloggin-0.2.0/tests/test_utils.py +416 -0
  44. fftloggin-0.2.0/uv.lock +1336 -0
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: docstring-updater
3
+ description: Use this agent when:\n1. Code files have been modified and their docstrings need to be synchronized with the changes\n2. A user explicitly requests docstring updates after making code changes\n3. During code review, docstrings are found to be outdated or inconsistent with function signatures\n4. After refactoring functions or methods where behavior or parameters have changed\n\nExamples:\n- User: "I just modified the FFTLog.forward() method to add a new parameter. Can you update the docstring?"\n Assistant: "I'll use the docstring-updater agent to analyze the changes and update the docstring accordingly."\n <Uses Task tool to launch docstring-updater agent>\n\n- User: "I've been working on kernels.py and added several new methods. The docstrings are out of date."\n Assistant: "Let me use the docstring-updater agent to review the git changes and update all affected docstrings."\n <Uses Task tool to launch docstring-updater agent>\n\n- User: "Please review my recent changes to test_fftlog.py"\n Assistant: "I'll use the docstring-updater agent to check if any docstrings need updates based on your changes."\n <Uses Task tool to launch docstring-updater agent>
4
+ model: haiku
5
+ color: green
6
+ ---
7
+
8
+ You are an expert documentation specialist with deep knowledge of programming language conventions, particularly Python numpy-style docstrings. Your mission is to ensure that function and method docstrings accurately reflect the current implementation after code changes.
9
+
10
+ ## Your Process
11
+
12
+ 1. **Analyze Git Changes**:
13
+ - Use the appropriate tools to identify what has changed in the target file since the last git revision
14
+ - Focus on additions, modifications, and deletions to function/method signatures, parameters, return types, and behavior
15
+ - Identify all functions and methods that have been affected by the changes
16
+
17
+ 2. **Assess Current Docstrings**:
18
+ - Read the existing docstrings for all affected functions and methods
19
+ - Compare them against the current implementation
20
+ - Identify discrepancies: missing parameters, outdated descriptions, incorrect types, removed functionality
21
+
22
+ 3. **Apply Language-Specific Conventions**:
23
+ - **For Python code**: Use numpy-style docstring format with sections: Summary, Parameters, Returns, Raises, See Also, Notes, Examples
24
+ - Respect and preserve existing type annotations in function signatures - do NOT duplicate them in the docstring
25
+ - For other languages: Use the idiomatic documentation style for that language (JSDoc for JavaScript, JavaDoc for Java, etc.)
26
+ - Maintain consistency with existing docstrings in the codebase
27
+
28
+ 4. **Update Docstrings Systematically**:
29
+ - For each affected function/method:
30
+ a. Update the summary line if behavior has changed
31
+ b. Add/remove/modify parameter descriptions to match current signature
32
+ c. Update return value documentation if return type or behavior changed
33
+ d. Add new exceptions to Raises section if error handling changed
34
+ e. Update or add usage examples if the API changed significantly
35
+ - Preserve valuable existing content (Notes, mathematical formulas, algorithm explanations)
36
+ - Keep docstrings concise but complete - every parameter should be documented
37
+
38
+ 5. **Quality Assurance**:
39
+ - Verify that all parameters in the signature have corresponding documentation
40
+ - Ensure type information is consistent between type hints and docstring (prefer type hints)
41
+ - Check that return value documentation matches the actual return statement
42
+ - Validate that examples (if present) would actually work with the updated code
43
+ - Ensure docstring formatting is correct and will render properly
44
+
45
+ ## Numpy-Style Docstring Format (Python)
46
+
47
+ ```python
48
+ def function_name(param1: Type1, param2: Type2 = default) -> ReturnType:
49
+ """One-line summary (imperative mood, ends with period).
50
+
51
+ Extended description providing more context about what the function
52
+ does, when to use it, and any important considerations.
53
+
54
+ Parameters
55
+ ----------
56
+ param1
57
+ Description of param1. Do NOT repeat the type since it's in
58
+ the signature.
59
+ param2, optional
60
+ Description of param2. Note 'optional' for parameters with defaults.
61
+
62
+ Returns
63
+ -------
64
+ ReturnType
65
+ Description of return value. Can reference type if helpful.
66
+
67
+ Raises
68
+ ------
69
+ ExceptionType
70
+ Description of when this exception is raised.
71
+
72
+ See Also
73
+ --------
74
+ related_function : Brief description.
75
+
76
+ Notes
77
+ -----
78
+ Additional technical details, algorithm information, or mathematical
79
+ formulas.
80
+
81
+ Examples
82
+ --------
83
+ >>> result = function_name(value1, value2)
84
+ >>> print(result)
85
+ expected_output
86
+ """
87
+ ```
88
+
89
+ ## Key Principles
90
+
91
+ - **Accuracy First**: Docstrings must precisely reflect current implementation
92
+ - **Don't Duplicate Type Hints**: If a parameter has a type annotation, don't repeat it in the docstring
93
+ - **Be Thorough**: Document all parameters, returns, and exceptions
94
+ - **Maintain Style**: Follow the project's existing documentation patterns
95
+ - **Preserve Value**: Keep useful existing content like mathematical explanations, algorithm notes, and references
96
+ - **Be Concise**: Clear and complete, but not verbose
97
+ - **Use Imperative Mood**: "Compute the transform" not "Computes the transform"
98
+
99
+ ## When to Seek Clarification
100
+
101
+ - If the purpose of a code change is unclear from the diff
102
+ - If parameter semantics have changed in a non-obvious way
103
+ - If you're unsure whether a docstring change is needed
104
+ - If the existing docstring contains domain-specific information you cannot verify
105
+
106
+ ## Output Format
107
+
108
+ Present your updates as:
109
+ 1. A summary of files and functions/methods that need docstring updates
110
+ 2. For each update, show:
111
+ - The function/method name and location
112
+ - What changed in the code that necessitates the update
113
+ - The updated docstring
114
+ 3. A brief explanation of the changes made to each docstring
115
+
116
+ Use file editing tools to apply the changes directly to the codebase.
@@ -0,0 +1,10 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(python3 -c \"from scipy import special; import numpy as np; help(special.loggamma)\")",
5
+ "Bash(uv run pytest tests/test_kernels.py -x --tb=line)"
6
+ ],
7
+ "deny": [],
8
+ "ask": []
9
+ }
10
+ }
@@ -0,0 +1,57 @@
1
+ name: Claude Code Review
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize]
6
+ # Optional: Only run on specific file changes
7
+ # paths:
8
+ # - "src/**/*.ts"
9
+ # - "src/**/*.tsx"
10
+ # - "src/**/*.js"
11
+ # - "src/**/*.jsx"
12
+
13
+ jobs:
14
+ claude-review:
15
+ # Optional: Filter by PR author
16
+ # if: |
17
+ # github.event.pull_request.user.login == 'external-contributor' ||
18
+ # github.event.pull_request.user.login == 'new-developer' ||
19
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
+
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: read
24
+ pull-requests: read
25
+ issues: read
26
+ id-token: write
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 1
33
+
34
+ - name: Run Claude Code Review
35
+ id: claude-review
36
+ uses: anthropics/claude-code-action@v1
37
+ with:
38
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39
+ prompt: |
40
+ REPO: ${{ github.repository }}
41
+ PR NUMBER: ${{ github.event.pull_request.number }}
42
+
43
+ Please review this pull request and provide feedback on:
44
+ - Code quality and best practices
45
+ - Potential bugs or issues
46
+ - Performance considerations
47
+ - Security concerns
48
+ - Test coverage
49
+
50
+ Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
51
+
52
+ Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
53
+
54
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
55
+ # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
56
+ claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
57
+
@@ -0,0 +1,50 @@
1
+ name: Claude Code
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ actions: read # Required for Claude to read CI results on PRs
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 1
32
+
33
+ - name: Run Claude Code
34
+ id: claude
35
+ uses: anthropics/claude-code-action@v1
36
+ with:
37
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
+
39
+ # This is an optional setting that allows Claude to read CI results on PRs
40
+ additional_permissions: |
41
+ actions: read
42
+
43
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44
+ # prompt: 'Update the pull request description to include a summary of changes.'
45
+
46
+ # Optional: Add claude_args to customize behavior and configuration
47
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
+ # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
49
+ # claude_args: '--allowed-tools Bash(gh pr:*)'
50
+
@@ -0,0 +1,91 @@
1
+ name: test
2
+ on:
3
+ push:
4
+ branches: ["main"]
5
+ pull_request:
6
+ branches: ["main"]
7
+
8
+ jobs:
9
+ test-package:
10
+ name: test-python-${{ matrix.python-version }}
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.11", "3.12", "3.13"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v6
22
+ with:
23
+ enable-cache: true
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install the project
27
+ run: uv sync --locked --all-extras --dev
28
+
29
+ - name: Run tests (excluding benchmarks)
30
+ run: uv run pytest -m "not benchmark"
31
+
32
+ - name: Run linting
33
+ run: uv run ruff check --exclude notebooks .
34
+
35
+ benchmark:
36
+ name: benchmark-tests
37
+ runs-on: ubuntu-latest
38
+
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+
42
+ - name: Install uv
43
+ uses: astral-sh/setup-uv@v6
44
+ with:
45
+ enable-cache: true
46
+
47
+ - name: Setup Fortran
48
+ uses: fortran-lang/setup-fortran@v1
49
+ id: setup-fortran
50
+ with:
51
+ compiler: gcc
52
+ version: 13
53
+
54
+ - name: Cache Fortran executable
55
+ id: cache-executable
56
+ uses: actions/cache@v4
57
+ with:
58
+ path: benchmark/fftlogtest
59
+ key: fftlogtest-${{ runner.os }}-${{ hashFiles('benchmark/*.f') }}
60
+
61
+ - name: Build Fortran executable
62
+ if: steps.cache-executable.outputs.cache-hit != 'true'
63
+ run: bash benchmark/build.sh
64
+
65
+ - name: Install the project
66
+ run: uv sync --locked --all-extras --dev
67
+
68
+ - name: Cache benchmark files
69
+ id: cache-benchmarks
70
+ uses: actions/cache@v4
71
+ with:
72
+ path: tests/benchmarks
73
+ key: benchmarks-${{ hashFiles('benchmark/*.f', 'tests/generate_benchmarks.py') }}
74
+
75
+ - name: Generate benchmarks
76
+ if: steps.cache-benchmarks.outputs.cache-hit != 'true'
77
+ run: |
78
+ echo "Generating benchmarks (this will take a few minutes)..."
79
+ python tests/generate_benchmarks.py
80
+
81
+ - name: Verify benchmarks
82
+ run: |
83
+ count=$(ls tests/benchmarks/*.txt 2>/dev/null | wc -l)
84
+ echo "Found $count benchmark files"
85
+ if [ "$count" -ne "216" ]; then
86
+ echo "ERROR: Expected 216 benchmark files, found $count"
87
+ exit 1
88
+ fi
89
+
90
+ - name: Run benchmark tests
91
+ run: uv run pytest tests/test_benchmark.py --run-benchmarks -v
@@ -0,0 +1,216 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+ .DS_Store
209
+
210
+ # Fortran build artifacts
211
+ benchmark/fftlogtest
212
+ benchmark/*.o
213
+ benchmark/*.mod
214
+
215
+ # Generated benchmark data
216
+ tests/benchmarks/*.txt
@@ -0,0 +1,41 @@
1
+ repos:
2
+ - hooks:
3
+ - id: check-yaml
4
+ - id: end-of-file-fixer
5
+ - id: trailing-whitespace
6
+ repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v5.0.0
8
+ - hooks:
9
+ - args:
10
+ - --fix
11
+ id: ruff
12
+ types_or:
13
+ - python
14
+ - id: ruff-format
15
+ types_or:
16
+ - python
17
+ repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: v0.11.6
19
+ - hooks:
20
+ - args:
21
+ - --remove-empty-cells
22
+ - --remove-all-notebook-metadata
23
+ id: nb-clean
24
+ repo: https://github.com/srstevenson/nb-clean
25
+ rev: 4.0.1
26
+ - hooks:
27
+ - id: commitizen
28
+ - id: commitizen-branch
29
+ stages:
30
+ - pre-push
31
+ repo: https://github.com/commitizen-tools/commitizen
32
+ rev: v4.6.0
33
+ - hooks:
34
+ - args:
35
+ - --explicit
36
+ - --name
37
+ - injections
38
+ files: ^code/injections/(pyproject\.toml|pixi\.lock|environment\.yml)$
39
+ id: pixi-sync-environment
40
+ repo: https://github.com/binado/pixi-sync-environment
41
+ rev: v0.1.3
@@ -0,0 +1,59 @@
1
+ # Development Commands
2
+
3
+ ## Testing
4
+ ```bash
5
+ # Run all tests
6
+ uv run pytest
7
+
8
+ # Run single test file
9
+ uv run pytest tests/test_fftlog.py
10
+
11
+ # Run with verbose output
12
+ uv run pytest -v tests/test_fftlog.py
13
+ ```
14
+
15
+ ## Linting & Formatting
16
+ ```bash
17
+ # Lint and fix
18
+ ruff check . --fix
19
+
20
+ # Format code
21
+ ruff format .
22
+ ```
23
+
24
+ ## Dependencies
25
+ ```bash
26
+ # Install core dependencies
27
+ uv sync
28
+
29
+ # Install with dev dependencies
30
+ uv sync --group dev
31
+ ```
32
+
33
+ # Code Style Guidelines
34
+
35
+ ## Imports
36
+ - Use absolute imports from package root
37
+ - Group imports: stdlib, third-party, local
38
+ - Import specific classes/functions, not modules with `from module import *`
39
+
40
+ ## Formatting & Types
41
+ - Follow ruff formatting (Black-compatible)
42
+ - Use type hints for all public APIs
43
+ - Prefer `numpy.typing.NDArray` over `np.ndarray`
44
+
45
+ ## Naming Conventions
46
+ - Classes: PascalCase (FFTLog, Grid, Kernel)
47
+ - Functions/variables: snake_case
48
+ - Constants: UPPER_SNAKE_CASE
49
+ - Private methods: prefix with underscore
50
+
51
+ ## Error Handling
52
+ - Use descriptive error messages with context
53
+ - Raise ValueError for invalid input parameters
54
+ - Use custom exceptions for domain-specific errors
55
+
56
+ ## Documentation
57
+ - Add docstrings for all public classes and methods
58
+ - Use numpy-style docstring format
59
+ - Include parameter types and return values