Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
grudge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
grudge
Commits
48da03e6
Commit
48da03e6
authored
3 years ago
by
Thomas Gibson
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated np.bool and np.object aliasing
parent
feda66bb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
grudge/eager.py
+1
-1
1 addition, 1 deletion
grudge/eager.py
grudge/execution.py
+1
-1
1 addition, 1 deletion
grudge/execution.py
grudge/symbolic/primitives.py
+5
-5
5 additions, 5 deletions
grudge/symbolic/primitives.py
with
7 additions
and
7 deletions
grudge/eager.py
+
1
−
1
View file @
48da03e6
...
@@ -144,7 +144,7 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries):
...
@@ -144,7 +144,7 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries):
def
_div_helper
(
self
,
diff_func
,
vecs
):
def
_div_helper
(
self
,
diff_func
,
vecs
):
if
not
isinstance
(
vecs
,
np
.
ndarray
):
if
not
isinstance
(
vecs
,
np
.
ndarray
):
raise
TypeError
(
"
argument must be an object array
"
)
raise
TypeError
(
"
argument must be an object array
"
)
assert
vecs
.
dtype
==
np
.
object
assert
vecs
.
dtype
==
object
if
vecs
.
shape
[
-
1
]
!=
self
.
ambient_dim
:
if
vecs
.
shape
[
-
1
]
!=
self
.
ambient_dim
:
raise
ValueError
(
"
last dimension of *vecs* argument must match
"
raise
ValueError
(
"
last dimension of *vecs* argument must match
"
...
...
This diff is collapsed.
Click to expand it.
grudge/execution.py
+
1
−
1
View file @
48da03e6
...
@@ -179,7 +179,7 @@ class ExecutionMapper(mappers.Evaluator,
...
@@ -179,7 +179,7 @@ class ExecutionMapper(mappers.Evaluator,
if
isinstance
(
bool_crit
,
DOFArray
):
if
isinstance
(
bool_crit
,
DOFArray
):
# continues below
# continues below
pass
pass
elif
isinstance
(
bool_crit
,
(
np
.
bool
_
,
np
.
bool
,
np
.
number
)):
elif
isinstance
(
bool_crit
,
(
bool
,
np
.
bool
_
,
np
.
number
)):
if
bool_crit
:
if
bool_crit
:
return
self
.
rec
(
expr
.
then
)
return
self
.
rec
(
expr
.
then
)
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
grudge/symbolic/primitives.py
+
5
−
5
View file @
48da03e6
...
@@ -649,7 +649,7 @@ def forward_metric_derivative_mat(ambient_dim, dim=None, dd=None):
...
@@ -649,7 +649,7 @@ def forward_metric_derivative_mat(ambient_dim, dim=None, dd=None):
if
dim
is
None
:
if
dim
is
None
:
dim
=
ambient_dim
dim
=
ambient_dim
result
=
np
.
zeros
((
ambient_dim
,
dim
),
dtype
=
np
.
object
)
result
=
np
.
zeros
((
ambient_dim
,
dim
),
dtype
=
object
)
for
j
in
range
(
dim
):
for
j
in
range
(
dim
):
result
[:,
j
]
=
forward_metric_derivative_vector
(
ambient_dim
,
j
,
dd
=
dd
)
result
[:,
j
]
=
forward_metric_derivative_vector
(
ambient_dim
,
j
,
dd
=
dd
)
...
@@ -660,7 +660,7 @@ def inverse_metric_derivative_mat(ambient_dim, dim=None, dd=None):
...
@@ -660,7 +660,7 @@ def inverse_metric_derivative_mat(ambient_dim, dim=None, dd=None):
if
dim
is
None
:
if
dim
is
None
:
dim
=
ambient_dim
dim
=
ambient_dim
result
=
np
.
zeros
((
ambient_dim
,
dim
),
dtype
=
np
.
object
)
result
=
np
.
zeros
((
ambient_dim
,
dim
),
dtype
=
object
)
for
i
in
range
(
dim
):
for
i
in
range
(
dim
):
for
j
in
range
(
ambient_dim
):
for
j
in
range
(
ambient_dim
):
result
[
i
,
j
]
=
inverse_metric_derivative
(
result
[
i
,
j
]
=
inverse_metric_derivative
(
...
@@ -688,12 +688,12 @@ def inverse_first_fundamental_form(ambient_dim, dim=None, dd=None):
...
@@ -688,12 +688,12 @@ def inverse_first_fundamental_form(ambient_dim, dim=None, dd=None):
form1
=
first_fundamental_form
(
ambient_dim
,
dim
,
dd
)
form1
=
first_fundamental_form
(
ambient_dim
,
dim
,
dd
)
if
dim
==
1
:
if
dim
==
1
:
inv_form1
=
np
.
array
([[
1.0
/
form1
[
0
,
0
]]],
dtype
=
np
.
object
)
inv_form1
=
np
.
array
([[
1.0
/
form1
[
0
,
0
]]],
dtype
=
object
)
elif
dim
==
2
:
elif
dim
==
2
:
(
E
,
F
),
(
_
,
G
)
=
form1
# noqa: N806
(
E
,
F
),
(
_
,
G
)
=
form1
# noqa: N806
inv_form1
=
1.0
/
(
E
*
G
-
F
*
F
)
*
np
.
array
([
inv_form1
=
1.0
/
(
E
*
G
-
F
*
F
)
*
np
.
array
([
[
G
,
-
F
],
[
-
F
,
E
]
[
G
,
-
F
],
[
-
F
,
E
]
],
dtype
=
np
.
object
)
],
dtype
=
object
)
else
:
else
:
raise
ValueError
(
"
%dD surfaces not supported
"
%
dim
)
raise
ValueError
(
"
%dD surfaces not supported
"
%
dim
)
...
@@ -732,7 +732,7 @@ def second_fundamental_form(ambient_dim, dim=None, dd=None):
...
@@ -732,7 +732,7 @@ def second_fundamental_form(ambient_dim, dim=None, dd=None):
raise
ValueError
(
"
%dD surfaces not supported
"
%
dim
)
raise
ValueError
(
"
%dD surfaces not supported
"
%
dim
)
from
pytools
import
flatten
from
pytools
import
flatten
form2
=
np
.
empty
((
dim
,
dim
),
dtype
=
np
.
object
)
form2
=
np
.
empty
((
dim
,
dim
),
dtype
=
object
)
for
ref_axes
in
second_ref_axes
:
for
ref_axes
in
second_ref_axes
:
i
,
j
=
flatten
([
rst_axis
]
*
n
for
rst_axis
,
n
in
ref_axes
)
i
,
j
=
flatten
([
rst_axis
]
*
n
for
rst_axis
,
n
in
ref_axes
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment