degawong 0.1.2__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.
- degawong-0.1.2/.github/workflows/publish-pypi.yml +80 -0
- degawong-0.1.2/.gitignore +39 -0
- degawong-0.1.2/LICENSE +21 -0
- degawong-0.1.2/MANIFEST.in +2 -0
- degawong-0.1.2/PKG-INFO +126 -0
- degawong-0.1.2/README.md +105 -0
- degawong-0.1.2/pyproject.toml +41 -0
- degawong-0.1.2/setup.cfg +4 -0
- degawong-0.1.2/src/degawong/AGENTS.md +31 -0
- degawong-0.1.2/src/degawong/__init__.py +12 -0
- degawong-0.1.2/src/degawong/frequency_features/AGENTS.md +53 -0
- degawong-0.1.2/src/degawong/frequency_features/README.md +89 -0
- degawong-0.1.2/src/degawong/frequency_features/__init__.py +15 -0
- degawong-0.1.2/src/degawong/frequency_features/docs/research/frequency_methods.md +261 -0
- degawong-0.1.2/src/degawong/frequency_features/examples/__init__.py +1 -0
- degawong-0.1.2/src/degawong/frequency_features/examples/quickstart.py +53 -0
- degawong-0.1.2/src/degawong/frequency_features/frequency_feature.py +70 -0
- degawong-0.1.2/src/degawong/frequency_features/registry.py +86 -0
- degawong-0.1.2/src/degawong/frequency_features/strategies/__init__.py +1 -0
- degawong-0.1.2/src/degawong/frequency_features/strategies/haar_dwt.py +104 -0
- degawong-0.1.2/src/degawong/py.typed +1 -0
- degawong-0.1.2/src/degawong.egg-info/PKG-INFO +126 -0
- degawong-0.1.2/src/degawong.egg-info/SOURCES.txt +24 -0
- degawong-0.1.2/src/degawong.egg-info/dependency_links.txt +1 -0
- degawong-0.1.2/src/degawong.egg-info/requires.txt +1 -0
- degawong-0.1.2/src/degawong.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
# Prefix filter. This must stay a superset of pyproject.toml's
|
|
6
|
+
# [tool.setuptools_scm].tag_regex (dega.degawong.<version>); the exact
|
|
7
|
+
# format is validated against that single source of truth in the
|
|
8
|
+
# "Verify release tag and package version" step below.
|
|
9
|
+
tags:
|
|
10
|
+
- "dega.degawong.*"
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
publish:
|
|
17
|
+
name: Build and publish distributions
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
environment:
|
|
20
|
+
name: pypi
|
|
21
|
+
url: https://pypi.org/p/degawong
|
|
22
|
+
permissions:
|
|
23
|
+
id-token: write
|
|
24
|
+
contents: read
|
|
25
|
+
steps:
|
|
26
|
+
- name: Check out tagged release
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
- name: Set up Python
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.x"
|
|
34
|
+
- name: Install build tools
|
|
35
|
+
run: python -m pip install --upgrade build twine "setuptools-scm>=7,<8"
|
|
36
|
+
- name: Verify release tag and package version
|
|
37
|
+
env:
|
|
38
|
+
RELEASE_TAG: ${{ github.ref_name }}
|
|
39
|
+
run: |
|
|
40
|
+
python - <<'PY'
|
|
41
|
+
import os
|
|
42
|
+
import re
|
|
43
|
+
import sys
|
|
44
|
+
|
|
45
|
+
from setuptools_scm import _get_version
|
|
46
|
+
from setuptools_scm.config import Configuration
|
|
47
|
+
|
|
48
|
+
tag = os.environ["RELEASE_TAG"]
|
|
49
|
+
|
|
50
|
+
# Load the whole [tool.setuptools_scm] config from pyproject.toml.
|
|
51
|
+
# This is the single source of truth for the tag format and how
|
|
52
|
+
# setuptools-scm derives the package version. Do NOT call
|
|
53
|
+
# get_version() here -- it uses a default tag_regex that does not
|
|
54
|
+
# know about the dega.degawong. prefix and would fail to parse it.
|
|
55
|
+
config = Configuration.from_file("pyproject.toml")
|
|
56
|
+
tag_regex = config.tag_regex.pattern
|
|
57
|
+
|
|
58
|
+
match = re.fullmatch(tag_regex, tag)
|
|
59
|
+
if match is None or "version" not in match.groupdict():
|
|
60
|
+
sys.exit(
|
|
61
|
+
f"Invalid release tag {tag!r}; expected to match the "
|
|
62
|
+
f"setuptools-scm tag_regex {tag_regex!r} from pyproject.toml, "
|
|
63
|
+
"for example dega.degawong.0.1.0."
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
tag_version = match.group("version")
|
|
67
|
+
package_version = _get_version(config)
|
|
68
|
+
if package_version != tag_version:
|
|
69
|
+
sys.exit(
|
|
70
|
+
f"Tag version {tag_version} does not match package version "
|
|
71
|
+
f"{package_version} derived from the checked-out source."
|
|
72
|
+
)
|
|
73
|
+
print(f"Publishing degawong {package_version} from tag {tag}.")
|
|
74
|
+
PY
|
|
75
|
+
- name: Build source and wheel distributions
|
|
76
|
+
run: python -m build
|
|
77
|
+
- name: Validate distributions
|
|
78
|
+
run: python -m twine check dist/*
|
|
79
|
+
- name: Publish to PyPI with Trusted Publishing
|
|
80
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Python bytecode and packaging artifacts
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.build/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
pip-wheel-metadata/
|
|
9
|
+
|
|
10
|
+
# Local environments and credentials
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
.env
|
|
14
|
+
.env.*
|
|
15
|
+
!.env.example
|
|
16
|
+
|
|
17
|
+
# Editors and operating systems
|
|
18
|
+
.vscode/
|
|
19
|
+
.idea/
|
|
20
|
+
.DS_Store
|
|
21
|
+
Thumbs.db
|
|
22
|
+
|
|
23
|
+
# Test, type-check, and coverage caches
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.ruff_cache/
|
|
27
|
+
.tox/
|
|
28
|
+
.nox/
|
|
29
|
+
.coverage
|
|
30
|
+
.coverage.*
|
|
31
|
+
htmlcov/
|
|
32
|
+
|
|
33
|
+
# Temporary and local generated files
|
|
34
|
+
*.log
|
|
35
|
+
*.tmp
|
|
36
|
+
*.swp
|
|
37
|
+
*~
|
|
38
|
+
/outputs/
|
|
39
|
+
/sources/
|
degawong-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 degawong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
degawong-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: degawong
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Reusable PyTorch frequency-domain feature extraction modules
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Classifier: Development Status :: 3 - Alpha
|
|
7
|
+
Classifier: Intended Audience :: Science/Research
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: torch>=1.0
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# degawong
|
|
23
|
+
|
|
24
|
+
`degawong` is an installable Python package for reusable image and tensor utilities. The current release includes a frequency-domain feature extraction subpackage built with PyTorch.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
After the first release is published to PyPI:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
python -m pip install degawong
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For local development from a clone:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python -m pip install -e .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
degawong supports Python 3.8+ and PyTorch 1.0+. The frequency feature modules require PyTorch. It is declared as a package dependency so a normal install includes it.
|
|
41
|
+
|
|
42
|
+
## Import the package
|
|
43
|
+
|
|
44
|
+
The top-level namespace exposes subpackages. Each subpackage owns its own descriptive public API, which keeps names from colliding as the package grows:
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import degawong
|
|
48
|
+
|
|
49
|
+
extractor = (
|
|
50
|
+
degawong.frequency_features.create_frequency_feature_extractor("haar_dwt")
|
|
51
|
+
)
|
|
52
|
+
print(
|
|
53
|
+
degawong.frequency_features.FREQUENCY_FEATURE_EXTRACTOR_REGISTRY.keys()
|
|
54
|
+
)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You can import the frequency feature API directly:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from degawong.frequency_features import (
|
|
61
|
+
FREQUENCY_FEATURE_EXTRACTOR_REGISTRY,
|
|
62
|
+
create_frequency_feature_extractor,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
extractor = create_frequency_feature_extractor("haar_dwt")
|
|
66
|
+
print(FREQUENCY_FEATURE_EXTRACTOR_REGISTRY.keys())
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Run the generic example from the repository root:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
python -m degawong.frequency_features.examples.quickstart --help
|
|
73
|
+
python -m degawong.frequency_features.examples.quickstart --scheme haar_dwt
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The frequency package's module layout, automatic strategy discovery, and extension rules are documented in [its README](src/degawong/frequency_features/README.md) and [AGENTS.md](src/degawong/frequency_features/AGENTS.md).
|
|
77
|
+
|
|
78
|
+
## Package structure
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
src/degawong/
|
|
82
|
+
├── __init__.py
|
|
83
|
+
├── AGENTS.md
|
|
84
|
+
├── py.typed
|
|
85
|
+
└── frequency_features/
|
|
86
|
+
├── __init__.py
|
|
87
|
+
├── frequency_feature.py
|
|
88
|
+
├── registry.py
|
|
89
|
+
├── strategies/
|
|
90
|
+
└── examples/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`import degawong` exposes the subpackages deliberately imported by `degawong/__init__.py`; it does not scan or import future modules implicitly. Add each new public subpackage there and document its direct import path. Keep subpackage-specific factories and registries inside their own namespace, with names that identify the domain they serve.
|
|
94
|
+
|
|
95
|
+
## Build distributions
|
|
96
|
+
|
|
97
|
+
From the repository root:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
python -m pip install --upgrade build twine
|
|
101
|
+
python -m build
|
|
102
|
+
python -m twine check dist/*
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The project uses the standard `pyproject.toml` build configuration and the `src/` layout. `src/` is conventional, not mandatory; it separates the installable package from repository-level reference material and build files. Markdown agent guidance and the frequency-methods research report are included in source and wheel distributions as package data. Read the [research report](src/degawong/frequency_features/docs/research/frequency_methods.md).
|
|
106
|
+
|
|
107
|
+
## Publish through GitHub Actions
|
|
108
|
+
|
|
109
|
+
The workflow at `.github/workflows/publish-pypi.yml` publishes to PyPI with PyPI Trusted Publishing (OIDC) only when a version tag is pushed. The distribution version is derived from the tag by `setuptools-scm`, so the tag and package version stay in sync without editing a version field in `pyproject.toml`.
|
|
110
|
+
|
|
111
|
+
Before the first release:
|
|
112
|
+
|
|
113
|
+
1. Create/configure the `degawong` project on PyPI, or configure its pending publisher.
|
|
114
|
+
2. Add a PyPI Trusted Publisher for the GitHub owner/repository, workflow file `publish-pypi.yml`, and GitHub environment `pypi`.
|
|
115
|
+
3. The package is released under the MIT license (see `LICENSE`, declared as `license = "MIT"` in `pyproject.toml`). PyPI shows the license from that SPDX expression.
|
|
116
|
+
|
|
117
|
+
After committing and pushing the release contents, tag that commit with a `dega.degawong.`-prefixed PEP 440 version such as `dega.degawong.0.1.1` and push the tag:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
git tag dega.degawong.0.1.1
|
|
121
|
+
git push origin dega.degawong.0.1.1
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The tag naming rule is defined in **exactly one place**: the `tag_regex` in `[tool.setuptools_scm]` of `pyproject.toml`. It requires a `dega.degawong.MAJOR.MINOR.PATCH` tag (optionally with `aN`, `bN`, or `rcN`). `setuptools-scm` uses only the numeric version after the `dega.degawong.` prefix as the published package version, so `dega.degawong.0.1.1` publishes as `0.1.1` on PyPI. Anywhere that needs the version number (PyPI metadata, the runtime `__version__`, the publishing workflow) derives it from this same rule — never hard-code a second copy. A GitHub Release is not required. Never reuse a published version tag; create a new version tag for each release.
|
|
125
|
+
|
|
126
|
+
The GitHub repository is [degawong/pypi_pack](https://github.com/degawong/pypi_pack).
|
degawong-0.1.2/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# degawong
|
|
2
|
+
|
|
3
|
+
`degawong` is an installable Python package for reusable image and tensor utilities. The current release includes a frequency-domain feature extraction subpackage built with PyTorch.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
After the first release is published to PyPI:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
python -m pip install degawong
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For local development from a clone:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python -m pip install -e .
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
degawong supports Python 3.8+ and PyTorch 1.0+. The frequency feature modules require PyTorch. It is declared as a package dependency so a normal install includes it.
|
|
20
|
+
|
|
21
|
+
## Import the package
|
|
22
|
+
|
|
23
|
+
The top-level namespace exposes subpackages. Each subpackage owns its own descriptive public API, which keeps names from colliding as the package grows:
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
import degawong
|
|
27
|
+
|
|
28
|
+
extractor = (
|
|
29
|
+
degawong.frequency_features.create_frequency_feature_extractor("haar_dwt")
|
|
30
|
+
)
|
|
31
|
+
print(
|
|
32
|
+
degawong.frequency_features.FREQUENCY_FEATURE_EXTRACTOR_REGISTRY.keys()
|
|
33
|
+
)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
You can import the frequency feature API directly:
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from degawong.frequency_features import (
|
|
40
|
+
FREQUENCY_FEATURE_EXTRACTOR_REGISTRY,
|
|
41
|
+
create_frequency_feature_extractor,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
extractor = create_frequency_feature_extractor("haar_dwt")
|
|
45
|
+
print(FREQUENCY_FEATURE_EXTRACTOR_REGISTRY.keys())
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Run the generic example from the repository root:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python -m degawong.frequency_features.examples.quickstart --help
|
|
52
|
+
python -m degawong.frequency_features.examples.quickstart --scheme haar_dwt
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The frequency package's module layout, automatic strategy discovery, and extension rules are documented in [its README](src/degawong/frequency_features/README.md) and [AGENTS.md](src/degawong/frequency_features/AGENTS.md).
|
|
56
|
+
|
|
57
|
+
## Package structure
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
src/degawong/
|
|
61
|
+
├── __init__.py
|
|
62
|
+
├── AGENTS.md
|
|
63
|
+
├── py.typed
|
|
64
|
+
└── frequency_features/
|
|
65
|
+
├── __init__.py
|
|
66
|
+
├── frequency_feature.py
|
|
67
|
+
├── registry.py
|
|
68
|
+
├── strategies/
|
|
69
|
+
└── examples/
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`import degawong` exposes the subpackages deliberately imported by `degawong/__init__.py`; it does not scan or import future modules implicitly. Add each new public subpackage there and document its direct import path. Keep subpackage-specific factories and registries inside their own namespace, with names that identify the domain they serve.
|
|
73
|
+
|
|
74
|
+
## Build distributions
|
|
75
|
+
|
|
76
|
+
From the repository root:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
python -m pip install --upgrade build twine
|
|
80
|
+
python -m build
|
|
81
|
+
python -m twine check dist/*
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The project uses the standard `pyproject.toml` build configuration and the `src/` layout. `src/` is conventional, not mandatory; it separates the installable package from repository-level reference material and build files. Markdown agent guidance and the frequency-methods research report are included in source and wheel distributions as package data. Read the [research report](src/degawong/frequency_features/docs/research/frequency_methods.md).
|
|
85
|
+
|
|
86
|
+
## Publish through GitHub Actions
|
|
87
|
+
|
|
88
|
+
The workflow at `.github/workflows/publish-pypi.yml` publishes to PyPI with PyPI Trusted Publishing (OIDC) only when a version tag is pushed. The distribution version is derived from the tag by `setuptools-scm`, so the tag and package version stay in sync without editing a version field in `pyproject.toml`.
|
|
89
|
+
|
|
90
|
+
Before the first release:
|
|
91
|
+
|
|
92
|
+
1. Create/configure the `degawong` project on PyPI, or configure its pending publisher.
|
|
93
|
+
2. Add a PyPI Trusted Publisher for the GitHub owner/repository, workflow file `publish-pypi.yml`, and GitHub environment `pypi`.
|
|
94
|
+
3. The package is released under the MIT license (see `LICENSE`, declared as `license = "MIT"` in `pyproject.toml`). PyPI shows the license from that SPDX expression.
|
|
95
|
+
|
|
96
|
+
After committing and pushing the release contents, tag that commit with a `dega.degawong.`-prefixed PEP 440 version such as `dega.degawong.0.1.1` and push the tag:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git tag dega.degawong.0.1.1
|
|
100
|
+
git push origin dega.degawong.0.1.1
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The tag naming rule is defined in **exactly one place**: the `tag_regex` in `[tool.setuptools_scm]` of `pyproject.toml`. It requires a `dega.degawong.MAJOR.MINOR.PATCH` tag (optionally with `aN`, `bN`, or `rcN`). `setuptools-scm` uses only the numeric version after the `dega.degawong.` prefix as the published package version, so `dega.degawong.0.1.1` publishes as `0.1.1` on PyPI. Anywhere that needs the version number (PyPI metadata, the runtime `__version__`, the publishing workflow) derives it from this same rule — never hard-code a second copy. A GitHub Release is not required. Never reuse a published version tag; create a new version tag for each release.
|
|
104
|
+
|
|
105
|
+
The GitHub repository is [degawong/pypi_pack](https://github.com/degawong/pypi_pack).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "setuptools-scm[toml]>=7,<8", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "degawong"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Reusable PyTorch frequency-domain feature extraction modules"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
dependencies = ["torch>=1.0"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.8",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Image Processing",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[tool.setuptools_scm]
|
|
28
|
+
version_scheme = "no-guess-dev"
|
|
29
|
+
local_scheme = "no-local-version"
|
|
30
|
+
tag_regex = "^dega\\.degawong\\.(?P<version>\\d+\\.\\d+\\.\\d+(?:(?:a|b|rc)\\d+)?)$"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools]
|
|
33
|
+
package-dir = {"" = "src"}
|
|
34
|
+
include-package-data = true
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.packages.find]
|
|
37
|
+
where = ["src"]
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.package-data]
|
|
40
|
+
degawong = ["AGENTS.md", "py.typed"]
|
|
41
|
+
"degawong.frequency_features" = ["AGENTS.md", "README.md", "docs/research/*.md"]
|
degawong-0.1.2/setup.cfg
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# degawong Package Maintenance Rules
|
|
2
|
+
|
|
3
|
+
These rules apply to the installable package under `src/degawong/`. The repository-root `AGENTS.md` and `sources/` mirror are separate project context; never edit synced files under `sources/`.
|
|
4
|
+
|
|
5
|
+
## Packaging and imports
|
|
6
|
+
|
|
7
|
+
- `degawong` is the distribution name and import namespace. Keep Python sources under `src/degawong/`.
|
|
8
|
+
- A normal install must support `import degawong`; expose public subpackages intentionally from `src/degawong/__init__.py` and document direct imports such as `from degawong.frequency_features import ...`.
|
|
9
|
+
- Keep the top-level namespace focused on package metadata and subpackages. Do not re-export subpackage-specific factories, registries, or implementation classes from `degawong/__init__.py`.
|
|
10
|
+
- Give public helpers and constants names that identify their domain (for example, `create_frequency_feature_extractor` and `FREQUENCY_FEATURE_EXTRACTOR_REGISTRY`). Keep them in the owning subpackage so similarly shaped APIs can coexist across future modules.
|
|
11
|
+
- Do not import or scan every future subpackage implicitly. Update the top-level exports when a new public subpackage is added.
|
|
12
|
+
- Keep `pyproject.toml` metadata, `README.md`, `MANIFEST.in`, `py.typed`, package-data settings, and GitHub publishing workflow consistent.
|
|
13
|
+
- Keep repository-maintainer instructions inside `src/degawong/AGENTS.md` or a subpackage AGENTS file, and ensure Markdown guidance is included in source and wheel distributions.
|
|
14
|
+
- The supported Python baseline is 3.8 unless the user explicitly changes it. Add dependencies to `pyproject.toml` and explain material dependency effects in README.
|
|
15
|
+
- Do not choose a package license or invent a GitHub repository URL. Before publishing, ask the user to select a license if none is provided and configure the actual GitHub Trusted Publisher coordinates.
|
|
16
|
+
|
|
17
|
+
## Package quality
|
|
18
|
+
|
|
19
|
+
- Keep imports explicit and public APIs listed in each package's `__all__`.
|
|
20
|
+
- Use PEP 8 naming and type annotations where practical. Prefer short descriptive module names.
|
|
21
|
+
- Keep user examples in README or `examples/`, not in core implementation flows.
|
|
22
|
+
- When changing an API or path, update code, package exports, README commands, examples, agent guidance, and packaging inclusion rules together.
|
|
23
|
+
- Do not claim a build, example, or test succeeded unless it was actually run. Report dependency or environment blockers clearly.
|
|
24
|
+
|
|
25
|
+
## Release flow
|
|
26
|
+
|
|
27
|
+
- `pyproject.toml` is the source of truth for Python requirements, dependencies, and build configuration. The pushed version tag (for example `dega.degawong.0.1.1`) is the source of truth for published distribution versions; `setuptools-scm` derives the package version from the numeric version after the `dega.degawong.` prefix (the `tag_regex` named `version` group in `pyproject.toml`). Runtime `__version__` must read installed metadata with `importlib.metadata`; use `0+unknown` only when importing an uninstalled source checkout. Never duplicate a release version in Python code or hard-code one in `pyproject.toml`.
|
|
28
|
+
- The first public release must have a user-approved license and a configured PyPI Trusted Publisher.
|
|
29
|
+
- Release publishing runs only when a version tag matching `pyproject.toml`'s `[tool.setuptools_scm].tag_regex` is pushed. The workflow validates the tag-derived version before building and publishing; a GitHub Release is not required. Keep the GitHub workflow's tag validation reading the same `tag_regex` from `pyproject.toml` instead of duplicating a regex.
|
|
30
|
+
- Before release, build both sdist and wheel and inspect them with `twine check`; verify the `AGENTS.md` files and package README are present in the intended artifacts.
|
|
31
|
+
- `pyproject.toml` must declare a dynamic version backed by `setuptools-scm`, and the build must include Git tags. Never overwrite or re-upload an already released version; increment the tag for each release.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Top-level namespace for the degawong Python package."""
|
|
2
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
3
|
+
|
|
4
|
+
from . import frequency_features
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
__version__ = version("degawong")
|
|
8
|
+
except PackageNotFoundError:
|
|
9
|
+
# Source checkout has no installed distribution metadata yet.
|
|
10
|
+
__version__ = "0+unknown"
|
|
11
|
+
|
|
12
|
+
__all__ = ["__version__", "frequency_features"]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Agent Rules for `degawong.frequency_features`
|
|
2
|
+
|
|
3
|
+
These rules apply to this subpackage. Keep implementation, auto-discovery, public imports, README, research notes, and runnable examples coherent. Do not modify synced project references under the repository's `sources/` directory.
|
|
4
|
+
|
|
5
|
+
## Package layout
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
src/degawong/frequency_features/
|
|
9
|
+
├── AGENTS.md
|
|
10
|
+
├── README.md
|
|
11
|
+
├── __init__.py
|
|
12
|
+
├── frequency_feature.py
|
|
13
|
+
├── registry.py
|
|
14
|
+
├── strategies/ # concrete strategies only
|
|
15
|
+
├── examples/ # generic scheme-selectable example
|
|
16
|
+
└── docs/research/ # longer research/reference reports
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Strategy API and naming
|
|
20
|
+
|
|
21
|
+
- Concrete modules live under `strategies/`; inherit `FrequencyFeatureExtractor` and declare a unique class-level `scheme_name` in lowercase `snake_case`.
|
|
22
|
+
- Module names use short descriptive lowercase `snake_case`; class names use `PascalCase`.
|
|
23
|
+
- Implement paired `forward(BCHW Tensor) -> FrequencyFeatures` and `inverse(FrequencyFeatures) -> BCHW Tensor`. Do not fake an inverse for lossy features; propose a separate feature-only base if needed.
|
|
24
|
+
- `FrequencyFeatures` carries scheme ID, named bands, original dimensions, and reconstruction metadata. Document band meanings/order and all boundary/padding rules. Validate scheme IDs, shapes, dtype/device, and preserve autograd.
|
|
25
|
+
- The registry scans only modules in `strategies/`, rejects duplicate/malformed scheme IDs, and creates implementations through `create_frequency_feature_extractor()`. The public registry is `FREQUENCY_FEATURE_EXTRACTOR_REGISTRY`. Keep these frequency-domain names explicit; do not shorten them to generic names such as `create_extractor` or `EXTRACTOR_REGISTRY`.
|
|
26
|
+
- Preserve Python 3.8 compatibility and avoid new dependencies unless the algorithm needs them.
|
|
27
|
+
|
|
28
|
+
## Required synchronized updates
|
|
29
|
+
|
|
30
|
+
When adding or changing a strategy, update all relevant items in one change:
|
|
31
|
+
|
|
32
|
+
1. The concrete implementation under `strategies/`.
|
|
33
|
+
2. Public exports in `__init__.py` only when the public package API changes or a deliberate convenience export is wanted; the factory must work without a per-strategy root export.
|
|
34
|
+
3. `README.md`: principle, band names/shapes/order, inverse behavior, boundary handling, suitable use cases, limitations, dependencies, and selection command.
|
|
35
|
+
4. `examples/quickstart.py`: keep it generic; select by discovered `scheme_name`, never import or branch on concrete strategy classes. Add a strategy-specific example only if the shared example cannot explain a special flow.
|
|
36
|
+
5. Research documents under `docs/research/` when method comparisons or recommendations change. Use concise English filenames, link reports from README, and do not duplicate source code that belongs in strategy modules.
|
|
37
|
+
6. `pyproject.toml` package-data patterns and `MANIFEST.in` if adding files that must ship in the wheel or source distribution.
|
|
38
|
+
7. Search for stale module names, imports, and run commands after renames.
|
|
39
|
+
|
|
40
|
+
After `python -m pip install -e .` (or after installing the published package), the generic example runs from the repository root as:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
python -m degawong.frequency_features.examples.quickstart --help
|
|
44
|
+
python -m degawong.frequency_features.examples.quickstart --scheme <scheme_name>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Completion notes
|
|
48
|
+
|
|
49
|
+
Inspect the final package tree and imports. Report which examples/checks were actually run and any missing dependencies; never claim an unrun build or test succeeded. Summarize the scheme ID, code/docs/example updates, invocation command, and limitations.
|
|
50
|
+
|
|
51
|
+
## Reusable task prompt
|
|
52
|
+
|
|
53
|
+
> Follow `src/degawong/frequency_features/AGENTS.md`. Add the requested frequency strategy under `strategies/` with the shared API and a unique stable `scheme_name`. Ensure automatic discovery works without a manual registry entry. Use the descriptive frequency-specific factory and registry names. Update the public README, generic selection example if needed, related research notes, and package-data/manifest rules for any new documents. Document band order, boundaries, suitable uses and limitations; check stale paths and report exactly what was verified.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# 频域特征提取包
|
|
2
|
+
|
|
3
|
+
要求 Python 3.8+ 与 PyTorch 1.0+。
|
|
4
|
+
|
|
5
|
+
## 开发约定
|
|
6
|
+
|
|
7
|
+
新增或修改方案时,请遵循 [AGENTS.md](AGENTS.md)。其中规定了自动发现边界、类命名、公共接口以及实现、README 和示例的同步要求。
|
|
8
|
+
|
|
9
|
+
## 目录结构
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
frequency_features/
|
|
13
|
+
├── AGENTS.md
|
|
14
|
+
├── __init__.py
|
|
15
|
+
├── frequency_feature.py
|
|
16
|
+
├── registry.py
|
|
17
|
+
├── strategies/
|
|
18
|
+
│ └── haar_dwt.py
|
|
19
|
+
├── examples/
|
|
20
|
+
│ └── quickstart.py
|
|
21
|
+
├── docs/research/
|
|
22
|
+
│ └── frequency_methods.md
|
|
23
|
+
└── README.md
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 快速切换方案
|
|
27
|
+
|
|
28
|
+
在项目根目录完成 `python -m pip install -e .` 后运行;`--help` 会显示自动发现的方案名:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
python -m degawong.frequency_features.examples.quickstart --help
|
|
32
|
+
python -m degawong.frequency_features.examples.quickstart --scheme haar_dwt
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
通用示例不导入具体实现类。新增方案后,它会自动出现在 `--scheme` 的选项里。程序化调用通过频域模块中明确命名的工厂创建实例:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
import torch
|
|
39
|
+
from degawong.frequency_features import (
|
|
40
|
+
FREQUENCY_FEATURE_EXTRACTOR_REGISTRY,
|
|
41
|
+
create_frequency_feature_extractor,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
extractor = create_frequency_feature_extractor("haar_dwt")
|
|
45
|
+
image = torch.randn(2, 3, 255, 257) # BCHW
|
|
46
|
+
features = extractor(image)
|
|
47
|
+
reconstructed = extractor.inverse(features)
|
|
48
|
+
|
|
49
|
+
print(features.scheme_name)
|
|
50
|
+
print(FREQUENCY_FEATURE_EXTRACTOR_REGISTRY.keys())
|
|
51
|
+
for band_name, band in features.bands.items():
|
|
52
|
+
print(band_name, band.shape)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
子包专属工厂和注册表保留在 `degawong.frequency_features` 命名空间,不从 `degawong` 根包导出。这样未来其他子包可以拥有自己的工厂和注册表,而不会与频域模块的公共名称冲突。
|
|
56
|
+
|
|
57
|
+
## 自动发现约定
|
|
58
|
+
|
|
59
|
+
`registry.py` 只扫描 `degawong.frequency_features.strategies` 子包中的 Python 模块,导入模块后收集该模块自己定义的、非抽象 `FrequencyFeatureExtractor` 子类。每个实现需声明类级 `scheme_name`,如 `"haar_dwt"`;注册器会检查标记格式和重复名称。基类、工厂、README 与示例不在扫描目录内,因此不会被当作提取方案。
|
|
60
|
+
|
|
61
|
+
发现发生在包首次导入时,并缓存于当前 Python 进程。新增策略文件后,重新启动运行进程即可看到它。各策略模块应只定义方案实现和必要的纯函数,不应在导入时读写文件、启动任务或执行推理。
|
|
62
|
+
|
|
63
|
+
## 公共接口
|
|
64
|
+
|
|
65
|
+
所有注册方案继承 `FrequencyFeatureExtractor`,并遵循统一接口:`forward(BCHW Tensor) -> FrequencyFeatures` 和 `inverse(FrequencyFeatures) -> BCHW Tensor`。系数对象保存 `scheme_name`、命名子带、输入尺寸和逆变换所需的 metadata。逆变换拒绝其他方案产生的系数。
|
|
66
|
+
|
|
67
|
+
显式记录子带名称和顺序。拼接要求子带具有相同 batch/空间形状、设备和 dtype;只有这些条件兼容时才使用 `features.as_tensor(order)` 拼接通道,并明确传入顺序。通用 quickstart 会逐个显示 band 名称和形状,不假设所有方案返回相同子带或可以拼接。
|
|
68
|
+
|
|
69
|
+
## 当前方案:单层二维 Haar DWT
|
|
70
|
+
|
|
71
|
+
`HaarDWTFeatureExtractor` 对每个通道独立进行单层 Haar 离散小波变换,得到 `LL/LH/HL/HH` 四个子带。`LL` 表示低频近似,其他子带描述不同方向的局部变化。实现无可训练参数且可微;奇数高宽在底部/右侧补零,逆变换后裁剪回原尺寸。
|
|
72
|
+
|
|
73
|
+
小波拆分适合图像增强、去噪、去模糊、超分辨率等低层视觉任务,尤其当模型需要分别利用粗尺度结构与方向性边缘/纹理,或需要可逆下采样时。DWT 本身不会自动去噪;高频也可能包含文字、细线、毛发和小目标等有效信息。若关注全局周期或窄带谱峰,FFT/DCT 可能更直接;若边界或平移稳定性关键,应评估临界采样 DWT 及其边界策略。
|
|
74
|
+
|
|
75
|
+
SWANet 的公开说明提到通过小波注意力感知并抑制低照度增强中可能放大的噪声,并使用离散小波变换损失。这里提供的是通用 Haar 变换模块,不是 SWANet 完整网络的复刻。
|
|
76
|
+
|
|
77
|
+
## 源码路径说明
|
|
78
|
+
|
|
79
|
+
公开仓库页面列出了顶层 `transform/` 和 `WT/` 目录,但 GitHub 文件接口未能读取用户提到的 `ET/transform.py`(该路径返回 404)。因此当前实现不能保证与那份源码逐项一致;如需严格对齐,应依据实际源码核对滤波器、子带方向顺序和边界策略。
|
|
80
|
+
|
|
81
|
+
参考:
|
|
82
|
+
- https://github.com/hezhiquan/SWANet
|
|
83
|
+
- He et al., “Low-Light Image Enhancement With Multi-Scale Attention and Frequency-Domain Optimization,” IEEE TCSVT, 2024. DOI: 10.1109/TCSVT.2023.3313348.
|
|
84
|
+
|
|
85
|
+
## 调研报告
|
|
86
|
+
|
|
87
|
+
频域方法分类、适用场景与论文案例见 [frequency_methods.md](docs/research/frequency_methods.md)。
|
|
88
|
+
|
|
89
|
+
本子包包含的频域方法调研文档位于 docs/research/,其中的建议用于参考,新增实现仍需按目标任务验证。
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Extensible frequency-domain feature transforms."""
|
|
2
|
+
from .frequency_feature import FrequencyFeatures, FrequencyFeatureExtractor
|
|
3
|
+
from .registry import (
|
|
4
|
+
FREQUENCY_FEATURE_EXTRACTOR_REGISTRY,
|
|
5
|
+
create_frequency_feature_extractor,
|
|
6
|
+
)
|
|
7
|
+
from .strategies.haar_dwt import HaarDWTFeatureExtractor
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"FREQUENCY_FEATURE_EXTRACTOR_REGISTRY",
|
|
11
|
+
"FrequencyFeatures",
|
|
12
|
+
"FrequencyFeatureExtractor",
|
|
13
|
+
"HaarDWTFeatureExtractor",
|
|
14
|
+
"create_frequency_feature_extractor",
|
|
15
|
+
]
|