Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ repos:
hooks:
- id: ruff-check
- id: ruff-format
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.20.0
hooks:
- id: blacken-docs
additional_dependencies:
- black
types_or:
- jupyter
- markdown
- pyi
- python
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.4
hooks:
Expand Down
2 changes: 1 addition & 1 deletion glass/harmonics.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def multalm(
00,
10, 11,
20, 21, 22,
30, 31, 32, 33,
30, 31, 32, 33
...
]

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ show-fixes = true
src = [
"glass",
]
format.docstring-code-format = true
format.preview = true
lint.allowed-confusables = [
"α",
"γ",
Expand Down
48 changes: 21 additions & 27 deletions tests/core/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,38 +763,32 @@ def test_cov_from_spectra(

def test_check_posdef_spectra(xp: ModuleType) -> None:
# posdef spectra
assert glass.check_posdef_spectra(
[
xp.asarray(x)
for x in [
[1.0, 1.0, 1.0],
[1.0, 1.0, 1.0],
[0.9, 0.9, 0.9],
]
assert glass.check_posdef_spectra([
xp.asarray(x)
for x in [
[1.0, 1.0, 1.0],
[1.0, 1.0, 1.0],
[0.9, 0.9, 0.9],
]
)
])
# semidef spectra
assert glass.check_posdef_spectra(
[
xp.asarray(x)
for x in [
[1.0, 1.0, 1.0],
[1.0, 1.0, 0.0],
[0.9, 1.0, 0.0],
]
assert glass.check_posdef_spectra([
xp.asarray(x)
for x in [
[1.0, 1.0, 1.0],
[1.0, 1.0, 0.0],
[0.9, 1.0, 0.0],
]
)
])
# indef spectra
assert not glass.check_posdef_spectra(
[
xp.asarray(x)
for x in [
[1.0, 1.0, 1.0],
[1.0, 1.0, 1.0],
[1.1, 1.1, 1.1],
]
assert not glass.check_posdef_spectra([
xp.asarray(x)
for x in [
[1.0, 1.0, 1.0],
[1.0, 1.0, 1.0],
[1.1, 1.1, 1.1],
]
)
])


def test_regularized_spectra(
Expand Down
Loading