Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencils
Commits
35c029a0
Commit
35c029a0
authored
Jun 15, 2020
by
Markus Holzer
Browse files
removed depricated as_matrix function
parent
0238f763
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
pystencils/fd/derivation.py
View file @
35c029a0
...
...
@@ -172,18 +172,6 @@ class FiniteDifferenceStencilDerivation:
f
=
field_access
return
sum
(
f
.
get_shifted
(
*
offset
)
*
weight
for
offset
,
weight
in
zip
(
self
.
stencil
,
self
.
weights
))
def
as_matrix
(
self
):
warnings
.
warn
(
"as_matrix is deprecated and may be removed in the near future."
"Please use as_array instead which will return an MutableDenseNDimArray."
"as_array therefore can also work in 3 dimensions"
,
category
=
DeprecationWarning
)
dim
=
len
(
self
.
stencil
[
0
])
assert
dim
==
2
max_offset
=
max
(
max
(
abs
(
e
)
for
e
in
direction
)
for
direction
in
self
.
stencil
)
result
=
sp
.
Matrix
(
2
*
max_offset
+
1
,
2
*
max_offset
+
1
,
lambda
i
,
j
:
0
)
for
direction
,
weight
in
zip
(
self
.
stencil
,
self
.
weights
):
result
[
max_offset
-
direction
[
1
],
max_offset
+
direction
[
0
]]
=
weight
return
result
def
__array__
(
self
):
return
np
.
array
(
self
.
as_array
().
tolist
())
...
...
pystencils_tests/test_fd_derivation.ipynb
View file @
35c029a0
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment