Skip to content

Commit

Permalink
update cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Jul 8, 2024
1 parent f5f86d3 commit a6f4c99
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 2024.01.24
_commit: 2024.04.23
_src_path: gh:scientific-python/cookie
backend: hatch
email: [email protected]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ concurrency:
cancel-in-progress: true

env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3

jobs:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ concurrency:
cancel-in-progress: true

env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3

jobs:
Expand Down Expand Up @@ -66,4 +68,6 @@ jobs:
--durations=20
- name: Upload coverage report
uses: codecov/[email protected]
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy:
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/tests.yml

This file was deleted.

28 changes: 7 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ ci:

repos:
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.18.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.*]
additional_dependencies: [black==24.*]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v4.6.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -40,28 +40,14 @@ repos:
args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.2.2"
rev: "v0.5.1"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
hooks:
- id: mypy
files: src|tests
args: []
additional_dependencies:
- pytest

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
- id: codespell

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.9.0.6"
rev: "v0.10.0.1"
hooks:
- id: shellcheck

Expand All @@ -74,13 +60,13 @@ repos:
exclude: .pre-commit-config.yaml

- repo: https://github.com/abravalheri/validate-pyproject
rev: "v0.16"
rev: "v0.18"
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.28.0"
rev: "0.28.6"
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
17 changes: 8 additions & 9 deletions examples/00_Rectilinear/01._Multivariate_Interpolation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -490,20 +490,16 @@
" time_norm = timeit(fast_interp, x_approx, y_approx)\n",
" fast[i, j] = time_norm\n",
"\n",
" scipy_interp = MultivariateInterp(\n",
" z_cross, [data_grid, data_grid], backend=\"scipy\")\n",
" scipy_interp = MultivariateInterp(z_cross, [data_grid, data_grid], backend=\"scipy\")\n",
" scipy[i, j] = timeit(scipy_interp, x_approx, y_approx) / time_norm\n",
"\n",
" par_interp = MultivariateInterp(\n",
" z_cross, [data_grid, data_grid], backend=\"numba\")\n",
" par_interp = MultivariateInterp(z_cross, [data_grid, data_grid], backend=\"numba\")\n",
" parallel[i, j] = timeit(par_interp, x_approx, y_approx) / time_norm\n",
"\n",
" gpu_interp = MultivariateInterp(\n",
" z_cross, [data_grid, data_grid], backend=\"cupy\")\n",
" gpu_interp = MultivariateInterp(z_cross, [data_grid, data_grid], backend=\"cupy\")\n",
" gpu[i, j] = timeit(gpu_interp, x_approx, y_approx) / time_norm\n",
"\n",
" jax_interp = MultivariateInterp(\n",
" z_cross, [data_grid, data_grid], backend=\"jax\")\n",
" jax_interp = MultivariateInterp(z_cross, [data_grid, data_grid], backend=\"jax\")\n",
" jax[i, j] = timeit(jax_interp, x_approx, y_approx) / time_norm"
]
},
Expand Down Expand Up @@ -587,7 +583,10 @@
"\n",
"\n",
"cbar = fig.colorbar(\n",
" cbar, ax=ax, label=\"Relative Speed (faster - slower)\", location=\"bottom\"\n",
" cbar,\n",
" ax=ax,\n",
" label=\"Relative Speed (faster - slower)\",\n",
" location=\"bottom\",\n",
")\n",
"cbar.set_ticks([0, 0.1, 0.5, 1, 2, 5, 10])\n",
"cbar.set_ticklabels([\"0\", \"0.1\", \"0.5\", \"1\", \"2\", \"5\", \"10\"])\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,10 @@
"\n",
"\n",
"cbar = fig.colorbar(\n",
" cbar, ax=ax, label=\"Relative Speed (faster - slower)\", location=\"bottom\"\n",
" cbar,\n",
" ax=ax,\n",
" label=\"Relative Speed (faster - slower)\",\n",
" location=\"bottom\",\n",
")\n",
"cbar.set_ticks([0, 0.1, 0.5, 1, 2, 5, 10])\n",
"cbar.set_ticklabels([\"0\", \"0.1\", \"0.5\", \"1\", \"2\", \"5\", \"10\"])\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/01_Curvilinear/02._Warped_Interpolation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
],
"source": [
"points = np.array(\n",
" [[[1, 7], [3, 8], [5, 9]], [[2, 2], [4, 4], [6, 6]], [[7, 1], [8, 3], [9, 5]]]\n",
" [[[1, 7], [3, 8], [5, 9]], [[2, 2], [4, 4], [6, 6]], [[7, 1], [8, 3], [9, 5]]],\n",
").T\n",
"values = np.power(points[0] * points[1], 1 / 4)\n",
"points, values"
Expand Down
52 changes: 36 additions & 16 deletions examples/01_Curvilinear/03._Curvilinear_Interpolation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
"outputs": [],
"source": [
"grid_x, grid_y = np.meshgrid(\n",
" np.linspace(0, 1, 100), np.linspace(0, 1, 100), indexing=\"ij\"\n",
" np.linspace(0, 1, 100),\n",
" np.linspace(0, 1, 100),\n",
" indexing=\"ij\",\n",
")"
]
},
Expand Down Expand Up @@ -381,7 +383,9 @@
"outputs": [],
"source": [
"grid_x, grid_y = np.meshgrid(\n",
" np.linspace(-0.5, 0.5, 100), np.linspace(-0.5, 0.5, 100), indexing=\"ij\"\n",
" np.linspace(-0.5, 0.5, 100),\n",
" np.linspace(-0.5, 0.5, 100),\n",
" indexing=\"ij\",\n",
")"
]
},
Expand Down Expand Up @@ -476,8 +480,7 @@
}
],
"source": [
"plt.imshow(function_2(grid_x, grid_y),\n",
" extent=(-0.5, 0.5, -0.5, 0.5), origin=\"lower\")\n",
"plt.imshow(function_2(grid_x, grid_y), extent=(-0.5, 0.5, -0.5, 0.5), origin=\"lower\")\n",
"plt.plot(rand_x.flat, rand_y.flat, \"ok\", ms=2, label=\"input points\")\n",
"plt.title(\"Original\")\n",
"plt.legend(loc=\"lower right\")"
Expand Down Expand Up @@ -589,7 +592,9 @@
"outputs": [],
"source": [
"grid_x, grid_y = np.meshgrid(\n",
" np.linspace(0, 3, 100), np.linspace(0, 3, 100), indexing=\"ij\"\n",
" np.linspace(0, 3, 100),\n",
" np.linspace(0, 3, 100),\n",
" indexing=\"ij\",\n",
")"
]
},
Expand Down Expand Up @@ -805,7 +810,9 @@
"outputs": [],
"source": [
"grid_x, grid_y = np.meshgrid(\n",
" np.linspace(0, 5, 100), np.linspace(0, 5, 100), indexing=\"ij\"\n",
" np.linspace(0, 5, 100),\n",
" np.linspace(0, 5, 100),\n",
" indexing=\"ij\",\n",
")"
]
},
Expand Down Expand Up @@ -984,8 +991,7 @@
" return np.maximum(\n",
" 0.0,\n",
" 1.0\n",
" - np.exp(0.5 - np.prod(np.asarray(args) +\n",
" 0.2, axis=0) ** (1.0 / len(args))),\n",
" - np.exp(0.5 - np.prod(np.asarray(args) + 0.2, axis=0) ** (1.0 / len(args))),\n",
" )"
]
},
Expand Down Expand Up @@ -1028,7 +1034,9 @@
"outputs": [],
"source": [
"grid_x, grid_y = np.meshgrid(\n",
" np.linspace(0, 1, 100), np.linspace(0, 1, 100), indexing=\"ij\"\n",
" np.linspace(0, 1, 100),\n",
" np.linspace(0, 1, 100),\n",
" indexing=\"ij\",\n",
")"
]
},
Expand Down Expand Up @@ -1156,8 +1164,7 @@
" cmap=\"viridis\",\n",
" edgecolor=\"none\",\n",
")\n",
"ax.scatter(rand_x, rand_y, values, c=values,\n",
" cmap=\"viridis\", label=\"input points\")\n",
"ax.scatter(rand_x, rand_y, values, c=values, cmap=\"viridis\", label=\"input points\")\n",
"plt.title(\"Original\")\n",
"plt.legend(loc=\"lower right\")"
]
Expand Down Expand Up @@ -1192,7 +1199,13 @@
"\n",
"for ax, title, grid in zip(axs.flat, titles, grids):\n",
" im = ax.plot_surface(\n",
" grid_x, grid_y, grid, rstride=1, cstride=1, cmap=\"viridis\", edgecolor=\"none\"\n",
" grid_x,\n",
" grid_y,\n",
" grid,\n",
" rstride=1,\n",
" cstride=1,\n",
" cmap=\"viridis\",\n",
" edgecolor=\"none\",\n",
" )\n",
" ax.set_title(title)\n",
"\n",
Expand Down Expand Up @@ -1256,7 +1269,9 @@
"outputs": [],
"source": [
"grid_x, grid_y = np.meshgrid(\n",
" np.linspace(0, 1, 100), np.linspace(0, 1, 100), indexing=\"ij\"\n",
" np.linspace(0, 1, 100),\n",
" np.linspace(0, 1, 100),\n",
" indexing=\"ij\",\n",
")"
]
},
Expand Down Expand Up @@ -1376,8 +1391,7 @@
" cmap=\"viridis\",\n",
" edgecolor=\"none\",\n",
")\n",
"ax.scatter(rand_x, rand_y, values, c=values,\n",
" cmap=\"viridis\", label=\"input points\", s=1)\n",
"ax.scatter(rand_x, rand_y, values, c=values, cmap=\"viridis\", label=\"input points\", s=1)\n",
"ax.view_init(30, 150)\n",
"plt.title(\"Original\")\n",
"plt.legend(loc=\"lower right\")"
Expand Down Expand Up @@ -1413,7 +1427,13 @@
"\n",
"for ax, title, grid in zip(axs.flat, titles, grids):\n",
" im = ax.plot_surface(\n",
" grid_x, grid_y, grid, rstride=1, cstride=1, cmap=\"viridis\", edgecolor=\"none\"\n",
" grid_x,\n",
" grid_y,\n",
" grid,\n",
" rstride=1,\n",
" cstride=1,\n",
" cmap=\"viridis\",\n",
" edgecolor=\"none\",\n",
" )\n",
" ax.set_title(title)\n",
" ax.view_init(30, 150)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,7 @@
}
],
"source": [
"cond = np.logical_and.reduce(\n",
" (x_mat <= 10, y_mat <= 10, x_mat >= 1, y_mat >= 1))\n",
"cond = np.logical_and.reduce((x_mat <= 10, y_mat <= 10, x_mat >= 1, y_mat >= 1))\n",
"plt.scatter(x_mat, y_mat, c=u_mat)\n",
"plt.scatter(x_mat[cond], y_mat[cond], s=20)\n",
"plt.ylim(0, 100)"
Expand Down
Loading

0 comments on commit a6f4c99

Please sign in to comment.