sparse-grid 0.1.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.
- sparse_grid-0.1.0/.github/dependabot.yml +14 -0
- sparse_grid-0.1.0/.github/workflows/code_style.yml +36 -0
- sparse_grid-0.1.0/.github/workflows/code_test.yml +96 -0
- sparse_grid-0.1.0/.github/workflows/dist_build.yml +40 -0
- sparse_grid-0.1.0/.github/workflows/docs_build.yml +52 -0
- sparse_grid-0.1.0/.github/workflows/publish_dist.yml +56 -0
- sparse_grid-0.1.0/.gitignore +207 -0
- sparse_grid-0.1.0/.python-version +1 -0
- sparse_grid-0.1.0/LICENSE +28 -0
- sparse_grid-0.1.0/PKG-INFO +38 -0
- sparse_grid-0.1.0/README.md +2 -0
- sparse_grid-0.1.0/docs/api/grid.md +3 -0
- sparse_grid-0.1.0/docs/api/index.md +10 -0
- sparse_grid-0.1.0/docs/api/point.md +3 -0
- sparse_grid-0.1.0/docs/api/utils.md +3 -0
- sparse_grid-0.1.0/docs/getting-started.md +44 -0
- sparse_grid-0.1.0/docs/index.md +35 -0
- sparse_grid-0.1.0/docs/user-guide.md +28 -0
- sparse_grid-0.1.0/mkdocs.yml +35 -0
- sparse_grid-0.1.0/pyproject.toml +126 -0
- sparse_grid-0.1.0/sparse_grid/__init__.py +11 -0
- sparse_grid-0.1.0/sparse_grid/grid.py +208 -0
- sparse_grid-0.1.0/sparse_grid/point.py +65 -0
- sparse_grid-0.1.0/sparse_grid/utils.py +48 -0
- sparse_grid-0.1.0/tests/test_sparse_grid_no_bound.py +99 -0
- sparse_grid-0.1.0/uv.lock +1029 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
# Maintain dependencies for GitHub Actions
|
|
4
|
+
- package-ecosystem: "github-actions"
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "weekly"
|
|
8
|
+
day: "friday"
|
|
9
|
+
|
|
10
|
+
- package-ecosystem: "uv"
|
|
11
|
+
directory: "/"
|
|
12
|
+
schedule:
|
|
13
|
+
interval: "weekly"
|
|
14
|
+
day: "friday"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Lint and Format
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main ]
|
|
9
|
+
paths: [ '**/*.py' ]
|
|
10
|
+
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ${{ github.workflow }}/${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
python-format:
|
|
19
|
+
name: Ruff Lint and Format
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout Repository
|
|
24
|
+
uses: actions/checkout@v6
|
|
25
|
+
|
|
26
|
+
- name: Setup Ruff
|
|
27
|
+
uses: astral-sh/ruff-action@v3
|
|
28
|
+
with:
|
|
29
|
+
args: --version
|
|
30
|
+
|
|
31
|
+
- name: Enforce Lint
|
|
32
|
+
run: ruff check .
|
|
33
|
+
|
|
34
|
+
- name: Enforce Format
|
|
35
|
+
run: |
|
|
36
|
+
ruff format --diff .
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
name: Code Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main ]
|
|
9
|
+
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
workflow_call:
|
|
12
|
+
outputs:
|
|
13
|
+
artifact_name:
|
|
14
|
+
value: ${{ jobs.fresh_build.outputs.artifact_name }}
|
|
15
|
+
artifact_run_id:
|
|
16
|
+
value: ${{ jobs.fresh_build.outputs.run_id }}
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
|
|
24
|
+
setup:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Fetch Supported Python
|
|
29
|
+
id: fetch-versions
|
|
30
|
+
run: |
|
|
31
|
+
versions=$(curl -fsSL https://endoflife.date/api/v1/products/python/ \
|
|
32
|
+
| jq '[ .result.releases[] | select(.isEol == false) | .label ]')
|
|
33
|
+
|
|
34
|
+
echo "supported_versions=$(echo $versions |jq -c '.')" >> $GITHUB_OUTPUT
|
|
35
|
+
echo "bound_versions=$(echo $versions |jq -c '[.[0],.[-1]]')" >> $GITHUB_OUTPUT
|
|
36
|
+
|
|
37
|
+
outputs:
|
|
38
|
+
supported_versions: ${{ steps.fetch-versions.outputs.supported_versions }}
|
|
39
|
+
bound_versions: ${{ steps.fetch-versions.outputs.bound_versions }}
|
|
40
|
+
|
|
41
|
+
fresh_build:
|
|
42
|
+
uses: ./.github/workflows/dist_build.yml
|
|
43
|
+
|
|
44
|
+
testing:
|
|
45
|
+
runs-on: ${{ matrix.os }}
|
|
46
|
+
|
|
47
|
+
permissions:
|
|
48
|
+
id-token: write # for working of oidc of codecov
|
|
49
|
+
|
|
50
|
+
strategy:
|
|
51
|
+
matrix:
|
|
52
|
+
os: [ ubuntu-latest ]
|
|
53
|
+
py-version: ${{ fromJson(needs.setup.outputs.supported_versions) }}
|
|
54
|
+
include:
|
|
55
|
+
- os: windows-latest
|
|
56
|
+
py-version: ${{ fromJson(needs.setup.outputs.bound_versions)[0] }}
|
|
57
|
+
- os: windows-latest
|
|
58
|
+
py-version: ${{ fromJson(needs.setup.outputs.bound_versions)[1] }}
|
|
59
|
+
- os: macos-latest
|
|
60
|
+
py-version: ${{ fromJson(needs.setup.outputs.bound_versions)[0] }}
|
|
61
|
+
- os: macos-latest
|
|
62
|
+
py-version: ${{ fromJson(needs.setup.outputs.bound_versions)[1] }}
|
|
63
|
+
|
|
64
|
+
needs:
|
|
65
|
+
- fresh_build
|
|
66
|
+
- setup
|
|
67
|
+
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v6
|
|
70
|
+
|
|
71
|
+
- name: Download Build Artifacts
|
|
72
|
+
uses: actions/download-artifact@v7
|
|
73
|
+
with:
|
|
74
|
+
name: ${{ needs.fresh_build.outputs.artifact_name }}
|
|
75
|
+
run-id: ${{ needs.fresh_build.outputs.run_id }}
|
|
76
|
+
path: ./dist
|
|
77
|
+
|
|
78
|
+
- uses: astral-sh/setup-uv@v7
|
|
79
|
+
with:
|
|
80
|
+
python-version: ${{ matrix.py-version }}
|
|
81
|
+
|
|
82
|
+
- name: Install Packages
|
|
83
|
+
shell: bash
|
|
84
|
+
run: |
|
|
85
|
+
uv sync --no-dev --group test
|
|
86
|
+
uv pip install -v ./dist/*.whl
|
|
87
|
+
|
|
88
|
+
- name: Run Tests
|
|
89
|
+
run: uv run --no-sync pytest -v -n auto --cov --cov-report=xml
|
|
90
|
+
|
|
91
|
+
- name: Upload coverage to Codecov
|
|
92
|
+
uses: codecov/codecov-action@v5
|
|
93
|
+
with:
|
|
94
|
+
fail_ci_if_error: true
|
|
95
|
+
use_oidc: true
|
|
96
|
+
verbose: true
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Build Distribution
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
outputs:
|
|
6
|
+
artifact_name:
|
|
7
|
+
value: ${{ jobs.build.outputs.artifact_name }}
|
|
8
|
+
run_id:
|
|
9
|
+
value: ${{ github.run_id }}
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
|
|
20
|
+
- name: Setup uv
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
22
|
+
|
|
23
|
+
- name: Build distribution
|
|
24
|
+
run: uv build -v --clear .
|
|
25
|
+
|
|
26
|
+
- name: Set Artifact Name
|
|
27
|
+
id: artifact-name
|
|
28
|
+
run: |
|
|
29
|
+
echo "artifact_name=${{ github.run_id }}[${{ github.run_attempt }}]--build-artifacts" \
|
|
30
|
+
| tee -a $GITHUB_OUTPUT
|
|
31
|
+
|
|
32
|
+
- name: Upload Build Artifacts
|
|
33
|
+
uses: actions/upload-artifact@v6
|
|
34
|
+
with:
|
|
35
|
+
name: ${{ steps.artifact-name.outputs.artifact_name }}
|
|
36
|
+
path: dist
|
|
37
|
+
if-no-files-found: error
|
|
38
|
+
|
|
39
|
+
outputs:
|
|
40
|
+
artifact_name: ${{ steps.artifact-name.outputs.artifact_name }}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Build Documentation
|
|
2
|
+
permissions:
|
|
3
|
+
pages: write
|
|
4
|
+
id-token: write
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main ]
|
|
9
|
+
workflow_call:
|
|
10
|
+
inputs: &build-docs-inputs
|
|
11
|
+
deploy:
|
|
12
|
+
type: boolean
|
|
13
|
+
required: false
|
|
14
|
+
default: false
|
|
15
|
+
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
inputs: *build-docs-inputs
|
|
18
|
+
|
|
19
|
+
concurrency:
|
|
20
|
+
group: docs-build
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
|
|
24
|
+
build:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v6
|
|
29
|
+
|
|
30
|
+
- name: Setup uv
|
|
31
|
+
uses: astral-sh/setup-uv@v7
|
|
32
|
+
|
|
33
|
+
- name: Build Documentation
|
|
34
|
+
run: uv run --no-dev --group docs mkdocs build --clean --strict
|
|
35
|
+
|
|
36
|
+
- name: Set Artifact Name
|
|
37
|
+
id: artifact-name
|
|
38
|
+
run: |
|
|
39
|
+
echo "artifact_name=${{ github.run_id }}[${{ github.run_attempt }}]--docs-artifacts" \
|
|
40
|
+
| tee -a $GITHUB_OUTPUT
|
|
41
|
+
|
|
42
|
+
- name: Upload Pages Artifacts
|
|
43
|
+
uses: actions/upload-pages-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: ${{ steps.artifact-name.outputs.artifact_name }}
|
|
46
|
+
path: site/
|
|
47
|
+
|
|
48
|
+
- name: Deploy to GitHub Pages
|
|
49
|
+
if: ${{ inputs.deploy }}
|
|
50
|
+
uses: actions/deploy-pages@v4
|
|
51
|
+
with:
|
|
52
|
+
artifact_name: ${{ steps.artifact-name.outputs.artifact_name }}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
id-token: write
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
testing:
|
|
15
|
+
uses: ./.github/workflows/code_test.yml
|
|
16
|
+
|
|
17
|
+
publish-to-pypi:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
|
|
20
|
+
environment:
|
|
21
|
+
name: pypi
|
|
22
|
+
|
|
23
|
+
needs: testing
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
|
|
27
|
+
- &download_dist
|
|
28
|
+
name: Download Distributions
|
|
29
|
+
uses: actions/download-artifact@v7
|
|
30
|
+
with:
|
|
31
|
+
name: ${{ needs.testing.outputs.artifact_name }}
|
|
32
|
+
run-id: ${{ needs.testing.outputs.artifact_run_id }}
|
|
33
|
+
path: ./dist
|
|
34
|
+
|
|
35
|
+
- name: Publish to PyPI
|
|
36
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
37
|
+
with:
|
|
38
|
+
verbose: true
|
|
39
|
+
|
|
40
|
+
- name: Smoke Test on PyPI
|
|
41
|
+
shell: bash
|
|
42
|
+
run: |
|
|
43
|
+
sleep 60
|
|
44
|
+
pip install -v --index-url https://pypi.org/simple/ sparse_grid
|
|
45
|
+
python -c "import sparse_grid;print(sparse_grid.__version__)"
|
|
46
|
+
|
|
47
|
+
publish_docs:
|
|
48
|
+
needs: publish-to-pypi
|
|
49
|
+
|
|
50
|
+
permissions:
|
|
51
|
+
pages: write
|
|
52
|
+
id-token: write
|
|
53
|
+
|
|
54
|
+
uses: ./.github/workflows/docs_build.yml
|
|
55
|
+
with:
|
|
56
|
+
deploy: true
|
|
@@ -0,0 +1,207 @@
|
|
|
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__/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.10
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, eggzec
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sparse_grid
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python Sparse Grid Package
|
|
5
|
+
Project-URL: homepage, https://eggzec.github.io/sparse_grid/
|
|
6
|
+
Project-URL: documentation, https://eggzec.github.io/sparse_grid/
|
|
7
|
+
Project-URL: source, https://github.com/eggzec/sparse_grid
|
|
8
|
+
Project-URL: releasenotes, https://github.com/eggzec/sparse_grid/releases/latest
|
|
9
|
+
Project-URL: issues, https://github.com/eggzec/sparse_grid/issues
|
|
10
|
+
Author-email: John Burkardt <jvb25@pitt.edu>
|
|
11
|
+
Maintainer-email: Saud Zahir <m.saud.zahir@gmail.com>, M Laraib Ali <laraibg786@outlook.com>
|
|
12
|
+
License-Expression: BSD-3-Clause
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: python,sparse grids
|
|
15
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
19
|
+
Classifier: Operating System :: MacOS
|
|
20
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Operating System :: POSIX
|
|
23
|
+
Classifier: Operating System :: Unix
|
|
24
|
+
Classifier: Programming Language :: Python
|
|
25
|
+
Classifier: Programming Language :: Python :: 3
|
|
26
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
29
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
30
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering
|
|
33
|
+
Classifier: Topic :: Software Development
|
|
34
|
+
Requires-Python: >=3.10
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# sparse_grid
|
|
38
|
+
A Python Sparse Grid Package
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install sparse_grid
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Create a sparse grid
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from sparse_grid import SparseGrid
|
|
13
|
+
|
|
14
|
+
sg = SparseGrid(dim=3, level=3)
|
|
15
|
+
sg.generate_points()
|
|
16
|
+
print(len(sg.indices))
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Assign nodal values
|
|
20
|
+
|
|
21
|
+
Populate nodal values (`fv`) at each sparse-grid point.
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
for index in sg.indices:
|
|
25
|
+
pos = sg.g_p[tuple(index)].pos
|
|
26
|
+
value = 1.0
|
|
27
|
+
for coord in pos:
|
|
28
|
+
value *= 4.0 * coord * (1.0 - coord)
|
|
29
|
+
sg.g_p[tuple(index)].fv = value
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Convert to hierarchical values
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
sg.nodal_2_hier()
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Evaluate the sparse-grid interpolant
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
x = [0.2, 0.4, 0.8]
|
|
42
|
+
y = sg.eval_funct(x)
|
|
43
|
+
print(y)
|
|
44
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# sparse_grid
|
|
2
|
+
|
|
3
|
+
`sparse_grid` is a compact Python implementation of regular sparse grids over
|
|
4
|
+
box domains.
|
|
5
|
+
|
|
6
|
+
It provides:
|
|
7
|
+
|
|
8
|
+
- sparse-grid index and point generation,
|
|
9
|
+
- nodal-to-hierarchical coefficient conversion,
|
|
10
|
+
- fast function evaluation using hierarchical basis functions.
|
|
11
|
+
|
|
12
|
+
## Documentation map
|
|
13
|
+
|
|
14
|
+
- **Getting Started**: installation and first working example.
|
|
15
|
+
- **User Guide**: core workflow and key data structures.
|
|
16
|
+
- **API Reference**: auto-generated module docs via `mkdocstrings`.
|
|
17
|
+
|
|
18
|
+
## Quick example
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
from sparse_grid import SparseGrid
|
|
22
|
+
|
|
23
|
+
sg = SparseGrid(dim=2, level=3)
|
|
24
|
+
sg.generate_points()
|
|
25
|
+
|
|
26
|
+
for index in sg.indices:
|
|
27
|
+
pos = sg.g_p[tuple(index)].pos
|
|
28
|
+
sg.g_p[tuple(index)].fv = (
|
|
29
|
+
4.0 * pos[0] * (1.0 - pos[0]) * 4.0 * pos[1] * (1.0 - pos[1])
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
sg.nodal_2_hier()
|
|
33
|
+
value = sg.eval_funct([0.25, 0.75])
|
|
34
|
+
print(value)
|
|
35
|
+
```
|