chuchichaestli 0.0.1.dev18__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 (52) hide show
  1. chuchichaestli-0.0.1.dev18/.github/ci.yaml +31 -0
  2. chuchichaestli-0.0.1.dev18/.github/workflows/publish-to-pypi.yaml +218 -0
  3. chuchichaestli-0.0.1.dev18/.github/workflows/python-package.yaml +46 -0
  4. chuchichaestli-0.0.1.dev18/.gitignore +160 -0
  5. chuchichaestli-0.0.1.dev18/.pre-commit-config.yaml +6 -0
  6. chuchichaestli-0.0.1.dev18/LICENSE +674 -0
  7. chuchichaestli-0.0.1.dev18/PKG-INFO +720 -0
  8. chuchichaestli-0.0.1.dev18/README.md +24 -0
  9. chuchichaestli-0.0.1.dev18/pyproject.toml +58 -0
  10. chuchichaestli-0.0.1.dev18/src/chuchichaestli/__about__.py +1 -0
  11. chuchichaestli-0.0.1.dev18/src/chuchichaestli/__init__.py +17 -0
  12. chuchichaestli-0.0.1.dev18/src/chuchichaestli/debug/__init__.py +92 -0
  13. chuchichaestli-0.0.1.dev18/src/chuchichaestli/debug/memory_usage.py +99 -0
  14. chuchichaestli-0.0.1.dev18/src/chuchichaestli/debug/visitor.py +137 -0
  15. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/__init__.py +23 -0
  16. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/__init__.py +28 -0
  17. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/base.py +161 -0
  18. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/bbdm.py +152 -0
  19. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/cfg_ddpm.py +191 -0
  20. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/ddim.py +103 -0
  21. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/ddpm.py +136 -0
  22. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/indi.py +145 -0
  23. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/prior_grad.py +141 -0
  24. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/ddpm/shift_ddpm.py +139 -0
  25. chuchichaestli-0.0.1.dev18/src/chuchichaestli/diffusion/distributions.py +83 -0
  26. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/__init__.py +1 -0
  27. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/activations.py +30 -0
  28. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/attention/__init__.py +29 -0
  29. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/attention/attention_gate.py +111 -0
  30. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/attention/self_attention.py +65 -0
  31. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/downsampling.py +52 -0
  32. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/maps.py +33 -0
  33. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/resnet.py +111 -0
  34. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/unet/__init__.py +5 -0
  35. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/unet/blocks.py +183 -0
  36. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/unet/time_embeddings.py +183 -0
  37. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/unet/unet.py +282 -0
  38. chuchichaestli-0.0.1.dev18/src/chuchichaestli/models/upsampling.py +52 -0
  39. chuchichaestli-0.0.1.dev18/tests/test_attention.py +53 -0
  40. chuchichaestli-0.0.1.dev18/tests/test_attention_gate.py +47 -0
  41. chuchichaestli-0.0.1.dev18/tests/test_bbdm.py +94 -0
  42. chuchichaestli-0.0.1.dev18/tests/test_cfgddpm.py +94 -0
  43. chuchichaestli-0.0.1.dev18/tests/test_ddim.py +62 -0
  44. chuchichaestli-0.0.1.dev18/tests/test_ddpm.py +93 -0
  45. chuchichaestli-0.0.1.dev18/tests/test_downsampling.py +57 -0
  46. chuchichaestli-0.0.1.dev18/tests/test_indi.py +93 -0
  47. chuchichaestli-0.0.1.dev18/tests/test_prior_grad.py +104 -0
  48. chuchichaestli-0.0.1.dev18/tests/test_resnet.py +89 -0
  49. chuchichaestli-0.0.1.dev18/tests/test_unet.py +316 -0
  50. chuchichaestli-0.0.1.dev18/tests/test_unet_blocks.py +19 -0
  51. chuchichaestli-0.0.1.dev18/tests/test_upsampling.py +57 -0
  52. chuchichaestli-0.0.1.dev18/tests/test_visitors.py +88 -0
@@ -0,0 +1,31 @@
1
+ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ build:
10
+ name: Build distribution 📦
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v4
17
+ with:
18
+ python-version: "3.x"
19
+ - name: Install pypa/build
20
+ run: >-
21
+ python3 -m
22
+ pip install
23
+ build
24
+ --user
25
+ - name: Build a binary wheel and a source tarball
26
+ run: python3 -m build
27
+ - name: Store the distribution packages
28
+ uses: actions/upload-artifact@v3
29
+ with:
30
+ name: python-package-distributions
31
+ path: dist/
@@ -0,0 +1,218 @@
1
+ # This workflow will build the package, and publish it on test-pypi and pypi (if tagged)
2
+ # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
3
+
4
+ name: Release 🐍 📦 on PyPI
5
+
6
+ on:
7
+ push:
8
+ paths-ignore:
9
+ - src/chuchichaestli/__about__.py
10
+
11
+
12
+ jobs:
13
+ build:
14
+ name: Build distribution 📦
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.x"
23
+ - name: Install pypa/build
24
+ run: |
25
+ python3 -m pip install build --user
26
+ - name: Build a binary wheel and a source tarball
27
+ run: |
28
+ python3 -m build
29
+ - name: Store the distribution packages
30
+ uses: actions/upload-artifact@v3
31
+ with:
32
+ name: python-package-distributions
33
+ path: dist/
34
+
35
+
36
+ publish-to-pypi:
37
+ name: Publish 🐍 📦 to PyPI
38
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
39
+ needs:
40
+ - build
41
+ runs-on: ubuntu-latest
42
+ environment:
43
+ name: pypi
44
+ url: https://pypi.org/p/chuchichaestli
45
+ permissions:
46
+ id-token: write # IMPORTANT: mandatory for trusted publishing
47
+
48
+ steps:
49
+ - name: Download 📦
50
+ uses: actions/download-artifact@v3
51
+ with:
52
+ name: python-package-distributions
53
+ path: dist/
54
+ - name: Upload 📦 to PyPI
55
+ uses: pypa/gh-action-pypi-publish@release/v1
56
+
57
+
58
+ github-release:
59
+ name: |
60
+ Sign the 🐍 📦 with Sigstore and upload them to GitHub Release
61
+ needs:
62
+ - publish-to-pypi
63
+ runs-on: ubuntu-latest
64
+
65
+ permissions:
66
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
67
+ id-token: write # IMPORTANT: mandatory for sigstore
68
+
69
+ steps:
70
+ - name: Download 📦
71
+ uses: actions/download-artifact@v3
72
+ with:
73
+ name: python-package-distributions
74
+ path: dist/
75
+ - name: Sign 📦 with Sigstore
76
+ uses: sigstore/gh-action-sigstore-python@v2.1.1
77
+ with:
78
+ inputs: |-
79
+ ./dist/*.tar.gz
80
+ ./dist/*.whl
81
+ - name: Create GitHub Release
82
+ env:
83
+ GITHUB_TOKEN: ${{ github.token }}
84
+ run: |-
85
+ gh release create '${{ github.ref_name }}'
86
+ --repo '${{ github.repository }}'
87
+ --notes ""
88
+ - name: Upload artifact signatures to GitHub Release
89
+ env:
90
+ GITHUB_TOKEN: ${{ github.token }}
91
+ # Upload to GitHub Release using the `gh` CLI.
92
+ # `dist/` contains the built packages, and the
93
+ # sigstore-produced signatures and certificates.
94
+ run: |-
95
+ gh release upload '${{ github.ref_name }}' dist/**
96
+ --repo '${{ github.repository }}'
97
+
98
+
99
+ publish-to-testpypi:
100
+ name: Publish 🐍 📦 to TestPyPI
101
+ if: ${{ ! startsWith(github.ref, 'refs/tags/') && github.event.pull_request.merged == false }}
102
+ needs:
103
+ - build
104
+ runs-on: ubuntu-latest
105
+
106
+ environment:
107
+ name: testpypi
108
+ url: https://test.pypi.org/p/chuchichaestli
109
+
110
+ permissions:
111
+ id-token: write # IMPORTANT: mandatory for trusted publishing
112
+
113
+ steps:
114
+ - name: Download 📦
115
+ uses: actions/download-artifact@v3
116
+ with:
117
+ name: python-package-distributions
118
+ path: dist/
119
+ - name: Upload 📦 to TestPyPI
120
+ uses: pypa/gh-action-pypi-publish@release/v1
121
+ with:
122
+ skip-existing: true
123
+ repository-url: https://test.pypi.org/legacy/
124
+
125
+
126
+ version-bump-dev:
127
+ name: Dev version bump ↗️
128
+ needs:
129
+ - publish-to-testpypi
130
+ runs-on: ubuntu-latest
131
+
132
+ permissions:
133
+ contents: write
134
+ pull-requests: write
135
+
136
+ steps:
137
+ - uses: actions/checkout@v4
138
+ with:
139
+ fetch-depth: 0
140
+ ref: ${{ github.event.pull_request.head.ref }}
141
+ persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN.
142
+ token: ${{ secrets.READ_WRITE_PAT }}
143
+ - name: Install hatch
144
+ run: |
145
+ python3 -m pip install hatch --user
146
+ - name: Bump version
147
+ run: |
148
+ git config --global user.name 'github-actions[bot]'
149
+ git config --global user.email 'github-actions[bot]@chuchichaestli.dev'
150
+ VERSION=`hatch version`
151
+ hatch version dev
152
+ NEW_VERSION=`hatch version`
153
+ git add src/chuchichaestli/__about__.py
154
+ git commit -m "Bump version: $VERSION → $NEW_VERSION"
155
+ - name: Push changes
156
+ uses: ad-m/github-push-action@master
157
+ with:
158
+ github_token: ${{ secrets.READ_WRITE_PAT }}
159
+ branch: version-bump
160
+ - name: Create Pull Request
161
+ uses: peter-evans/create-pull-request@v4
162
+ with:
163
+ branch: version-bump
164
+ title: 'Dev Version Bump'
165
+ body: 'Automated dev version bump'
166
+ base: main
167
+ head: version-bump
168
+
169
+
170
+ version-bump-release:
171
+ name: Release version bump ⬆️
172
+ # Only run this job on the master branch
173
+ if: github.ref == 'refs/heads/master'
174
+ needs:
175
+ - publish-to-pypi
176
+ runs-on: ubuntu-latest
177
+
178
+ permissions:
179
+ contents: write
180
+ pull-requests: write
181
+
182
+ steps:
183
+ - uses: actions/checkout@v4
184
+ if: github.event_name == 'pull_request'
185
+ with:
186
+ fetch-depth: 0
187
+ ref: ${{ github.event.pull_request.head.ref }}
188
+ persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN.
189
+ token: ${{ secrets.READ_WRITE_PAT }}
190
+ - uses: actions/checkout@v4
191
+ if: github.event_name == 'push'
192
+ with:
193
+ fetch-depth: 0
194
+ - name: Install hatch
195
+ run: |
196
+ python3 -m pip install hatch --user
197
+ - name: Bump version
198
+ run: |
199
+ git config --global user.name 'github-actions[bot]'
200
+ git config --global user.email 'github-actions[bot]@chuchichaestli.dev'
201
+ VERSION=`hatch version`
202
+ hatch version micro
203
+ NEW_VERSION=`hatch version`
204
+ git add src/chuchichaestli/__about__.py
205
+ git commit -m "Bump version: $VERSION → $NEW_VERSION"
206
+ - name: Push changes
207
+ uses: ad-m/github-push-action@master
208
+ with:
209
+ github_token: ${{ secrets.READ_WRITE_PAT }}
210
+ branch: version-bump
211
+ - name: Create Pull Request
212
+ uses: peter-evans/create-pull-request@v4
213
+ with:
214
+ branch: version-bump
215
+ title: 'Release Version Bump'
216
+ body: 'Automated version bump for release'
217
+ base: main
218
+ head: version-bump
@@ -0,0 +1,46 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python package
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ jobs:
13
+ build:
14
+
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.10", "3.11", "3.12"]
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v3
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ - name: Install dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ python -m pip install .[dev]
31
+ - name: Lint with ruff
32
+ run: |
33
+ # stop the build if there are Python syntax errors or undefined names
34
+ ruff check . --select=E9,F63,F7,F82 --output-format=github
35
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36
+ ruff check . --extend-select=D,UP --line-length=127 --output-format=github --exit-zero
37
+ - name: Test with pytest
38
+ run: |
39
+ pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml
40
+ - name: Upload pytest test results
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: pytest-results-${{ matrix.python-version }}
44
+ path: junit/test-results-${{ matrix.python-version }}.xml
45
+ # Use always() to always run this step to publish test results when there are test failures
46
+ if: ${{ always() }}
@@ -0,0 +1,160 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
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
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
@@ -0,0 +1,6 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.4.10
4
+ hooks:
5
+ - id: ruff
6
+ - id: ruff-format