Skip to content

Commit

Permalink
Merge pull request #249 from yt-project/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
cphyc authored Apr 2, 2024
2 parents 9510175 + c94265a commit 617f2c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: check-toml

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.3.0
hooks:
- id: black

Expand All @@ -25,7 +25,7 @@ repos:
additional_dependencies: [black==23.9.1]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.3.4
hooks:
- id: ruff
args: [--fix]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ def calculate_light_cone_solution(self, seed=None, filename=None):
else:
# Same axis and center as previous slice,
# but with depth center shifted.
self.light_cone_solution[q][
"projection_axis"
] = self.light_cone_solution[q - 1]["projection_axis"]
self.light_cone_solution[q][
"projection_center"
] = self.light_cone_solution[q - 1]["projection_center"].copy()
self.light_cone_solution[q]["projection_axis"] = (
self.light_cone_solution[q - 1]["projection_axis"]
)
self.light_cone_solution[q]["projection_center"] = (
self.light_cone_solution[q - 1]["projection_center"].copy()
)
self.light_cone_solution[q]["projection_center"][
self.light_cone_solution[q]["projection_axis"]
] += 0.5 * (
Expand Down
3 changes: 1 addition & 2 deletions yt_astro_analysis/halo_analysis/halo_finding/halo_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ def _get_ellipsoid_parameters_basic(self):
te1 = np.cross(te2, e0_vector_copy)
length = np.abs(
-np.sum(rr * te1, axis=1)
* (1.0 - np.sum(rr * e0_vector_copy, axis=1) ** 2.0 * mag_A**-2.0)
** (-0.5)
* (1.0 - np.sum(rr * e0_vector_copy, axis=1) ** 2.0 * mag_A**-2.0) ** (-0.5)
)
# This problem apparently happens sometimes, that the NaNs are turned
# into infs, which messes up the nanargmax below.
Expand Down
4 changes: 1 addition & 3 deletions yt_astro_analysis/ppv_cube/tests/test_ppv.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ def test_ppv():
)

dv = cube.dv
v_th = np.sqrt(2.0 * kboltz * T_0 / (56.0 * mh) + 2.0 * sigma_v**2).in_units(
"km/s"
)
v_th = np.sqrt(2.0 * kboltz * T_0 / (56.0 * mh) + 2.0 * sigma_v**2).in_units("km/s")
a = cube.data.mean(axis=(0, 1)).v
b = dv * np.exp(-(((cube.vmid + v_shift) / v_th) ** 2)) / (np.sqrt(np.pi) * v_th)

Expand Down

0 comments on commit 617f2c8

Please sign in to comment.