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
36 changes: 18 additions & 18 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1338,8 +1338,24 @@
{
"code": "reportAny",
"range": {
"startColumn": 16,
"endColumn": 23,
"startColumn": 12,
"endColumn": 19,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 26,
"endColumn": 33,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 35,
"endColumn": 50,
"lineCount": 1
}
},
Expand Down Expand Up @@ -4659,22 +4675,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 11,
"endColumn": 38,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 11,
"endColumn": 40,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
Expand Down
1 change: 0 additions & 1 deletion contrib/weights-from-fortran.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#! /usr/bin/env python
from __future__ import annotations

import re
Expand Down
2 changes: 1 addition & 1 deletion contrib/weights-from-txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


with open(sys.argv[1]) as inf:
lines = [ln.strip() for ln in inf.readlines() if ln.strip()]
lines = [ln.strip() for ln in inf if ln.strip()]

rule_name = sys.argv[2]

Expand Down
7 changes: 2 additions & 5 deletions modepy/modal_decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ def create_decay_baseline(

modal_coefficients = np.asarray(mode_number_vector, dtype=np.float64)**(-n)
modal_coefficients[zeros] = 1.0 # irrelevant, just keeps log from NaNing
modal_coefficients = modal_coefficients / la.norm(modal_coefficients)

return modal_coefficients
return modal_coefficients / la.norm(modal_coefficients)


def get_decay_fit_matrix(
Expand Down Expand Up @@ -152,8 +150,7 @@ def skyline_pessimize(modal_values: ArrayF) -> ArrayF:
cur_val = max(my_modes[-1], my_modes[-2])

for imode in range(nmodes-1, -1, -1):
if my_modes[imode] > cur_val:
cur_val = my_modes[imode]
cur_val = max(cur_val, my_modes[imode])

result[iel, imode] = cur_val

Expand Down
8 changes: 4 additions & 4 deletions modepy/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

import numpy as np
import numpy.linalg as la
from typing_extensions import override
from typing_extensions import Self, override

from pytools import memoize_method

Expand Down Expand Up @@ -292,7 +292,7 @@ def plot_element_values(
pt.plot(orig_nodes[0], orig_values, "x")
elif dims == 2:
import matplotlib.pyplot as pt
import matplotlib.tri as tri
from matplotlib import tri

triangulation = tri.Triangulation(nodes[0], nodes[1], triangles=submesh)
ax = pt.subplot(1, 1, 1, projection="3d")
Expand Down Expand Up @@ -414,8 +414,8 @@ class Reshapeable(Protocol):
def shape(self) -> tuple[int, ...]: ...

def reshape(
self: ReshapeableT, *newshape: tuple[int, ...], order: str
) -> ReshapeableT:
self, *newshape: tuple[int, ...], order: str
) -> Self:
...


Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ extend-ignore = [
"E402", # module level import not at the top of file
"N818", # error suffix in exception names
"RUF067", # no code in __init__ *shrug*
"TRY004",
]
allowed-confusables = ["‐", "–"]

Expand All @@ -102,6 +103,8 @@ multiline-quotes = "double"

[tool.ruff.lint.per-file-ignores]
"modepy/quadrature/jaskowiec_sukumar_tet_data.py" = ["E202", "E203"]
"modepy/test/test_*.py" = ["S102"]
"doc/conf.py" = ["S102"]

[tool.ruff.lint.isort]
combine-as-imports = true
Expand Down
Loading