From 7ab49f93413eaad1773e955b397b74a4ef068aef Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Wed, 11 Sep 2024 14:29:24 -0400 Subject: [PATCH 1/2] Update ppt to 2.0.2 --- .copier-answers.yml | 2 +- .github/ISSUE_TEMPLATE/1-bug_report.md | 4 ++-- .pre-commit-config.yaml | 2 +- pyproject.toml | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 25977b6..ef36644 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v2.0.1 +_commit: v2.0.2 _src_path: gh:lincc-frameworks/python-project-template author_email: malanchev@cmu.edu author_name: LINCC Frameworks diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md index 220a63d..16b6b71 100644 --- a/.github/ISSUE_TEMPLATE/1-bug_report.md +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -13,5 +13,5 @@ assignees: '' Please check the following: - [ ] I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem. -- [ ] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead. -- [ ] If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list. \ No newline at end of file +- [ ] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a description of what I expected instead. +- [ ] If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d01dac1..b8a8974 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: # This hook should always pass. It will print a message if the local version # is out of date. - repo: https://github.com/lincc-frameworks/pre-commit-hooks - rev: v0.1.1 + rev: v0.1.2 hooks: - id: check-lincc-frameworks-template-version name: Check template version diff --git a/pyproject.toml b/pyproject.toml index d1570cd..bcf5c08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,8 @@ select = [ "D300", "D417", "D419", - + # Numpy v2.0 compatibility + "NPY201", ] ignore = [ From ddb418a39ad82495af11a5e7add30a6a74c5df1a Mon Sep 17 00:00:00 2001 From: Konstantin Malanchev Date: Wed, 11 Sep 2024 14:35:43 -0400 Subject: [PATCH 2/2] Apply ruff formatting changes --- docs/notebooks/boundaries.ipynb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/notebooks/boundaries.ipynb b/docs/notebooks/boundaries.ipynb index 0719b3e..73e1e77 100644 --- a/docs/notebooks/boundaries.ipynb +++ b/docs/notebooks/boundaries.ipynb @@ -93,34 +93,37 @@ "\n", "# return np.degrees(phi), z\n", "\n", + "\n", "def phi_z(k, kp):\n", " # return np.degrees(polar(k, kp)[0]), polar(k, kp)[1]\n", " eq_phi, eq_z = eq(k, kp)\n", " polar_phi, polar_z = polar(k, kp)\n", - " z = np.where(eq_z <= 2/3, eq_z, polar_z)\n", - " phi = np.where(eq_z <= 2/3, eq_phi, polar_phi)\n", + " z = np.where(eq_z <= 2 / 3, eq_z, polar_z)\n", + " phi = np.where(eq_z <= 2 / 3, eq_phi, polar_phi)\n", " return np.degrees(phi), z\n", "\n", + "\n", "def eq(k, kp):\n", - " z = 2/3 * (2 - (kp + k) / nside)\n", - " phi = np.pi/4/nside * (nside - kp + k)\n", + " z = 2 / 3 * (2 - (kp + k) / nside)\n", + " phi = np.pi / 4 / nside * (nside - kp + k)\n", " return phi, z\n", "\n", + "\n", "def polar(k, kp):\n", " j = np.abs(k) - 0.5\n", " i = np.abs(kp) + np.abs(k)\n", "\n", - " z = 1 - (i / nside)**2 / 3\n", + " z = 1 - (i / nside) ** 2 / 3\n", " phi = 0.5 * np.pi * (j + 0.5) / i\n", "\n", " eq_phi, eq_z = eq(np.abs(k), np.abs(kp))\n", - " \n", + "\n", " z = np.where(np.abs(kp) + np.abs(k) <= nside, z, eq_z)\n", " phi = np.where(np.abs(kp) + np.abs(k) <= nside, phi, eq_phi)\n", - " \n", + "\n", " phi = np.where(kp >= 0, phi, np.pi - phi)\n", " phi = np.where(k >= 0, phi, -phi)\n", - " \n", + "\n", " return phi, z\n", "\n", "\n",