Skip to content

Commit

Permalink
Hopefully formatting fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
reverendbedford committed Mar 22, 2024
1 parent 45acf99 commit 4f611f5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion pyoptmat/flowrules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=abstract-method, useless-super-delegation, line-too-long, duplicate-code, too-many-lines
# pylint: disable=abstract-method, useless-super-delegation, line-too-long, duplicate-code, too-many-lines, too-many-arguments, too-many-public-methods

"""
Module containing inelastic flow rules. These provide the rate of the
Expand Down Expand Up @@ -514,6 +514,9 @@ def f(self, T, e):
return (torch.tanh(self.sf * (self.g(T, e) - self.g0())) + 1.0) / 2.0

def g0(self):
"""
The intercept value
"""
return (self.C_scale.scale(self.C) - self.B_scale.scale(self.B)) / self.A_scale(
self.A
)
Expand Down
9 changes: 5 additions & 4 deletions pyoptmat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ def __init__(
base,
temps,
control,
*args,
bisect_first=False,
throw_on_scalar_fail=False,
*args,
**kwargs
):
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -566,12 +566,12 @@ def __init__(
srate_fn,
stress_fn,
T_fn,
*args,
min_erate=-1e2,
max_erate=1e3,
guess_erate=1.0e-3,
bisect_first=False,
throw_on_scalar_fail=False,
*args,
**kwargs
):
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -626,8 +626,9 @@ def RJ(erate):
t, torch.cat([cs.unsqueeze(-1), y[..., 1:]], dim=-1), erate, cT
)

# There is an annoying extra term that is the derivative of the history rate with respect to the
# solved for strain rate times the derivative of the strain rate with respect to history
# There is an annoying extra term that is the derivative of the
# history rate with respect to the solved for strain rate times
# the derivative of the strain rate with respect to history
t1 = Je[..., 1:].unsqueeze(-1)
t2 = utility.mbmm(1.0 / Je[..., :1].unsqueeze(-1), J[..., 0, 1:].unsqueeze(-2))
t3 = utility.mbmm(t1, t2)
Expand Down
2 changes: 1 addition & 1 deletion pyoptmat/ode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=too-many-arguments
# pylint: disable=too-many-arguments, too-many-instance-attributes

"""
Module defining the key objects and functions to integrate ODEs
Expand Down
2 changes: 2 additions & 0 deletions pyoptmat/optimize.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=too-many-instance-attributes, too-many-arguments, not-context-manager

"""
Objects and helper functions to help with deterministic model calibration
and statistical inference.
Expand Down
4 changes: 2 additions & 2 deletions pyoptmat/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def scalar_bisection(fn, a, b, atol=1.0e-6, miter=100):
c = (a + b) / 2.0
Rc, _ = fn(c)

for i in range(miter):
for _ in range(miter):
if torch.all(torch.abs(Rc) < atol):
break

Expand Down Expand Up @@ -60,7 +60,7 @@ def scalar_newton(fn, x0, atol=1.0e-6, miter=100, throw_on_fail=False):
x = x0
R, J = fn(x)

for i in range(miter):
for _ in range(miter):
if torch.all(torch.abs(R) < atol):
break

Expand Down

0 comments on commit 4f611f5

Please sign in to comment.