Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
35c029a0
Commit
35c029a0
authored
5 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
removed depricated as_matrix function
parent
0238f763
No related branches found
No related tags found
1 merge request
!157
Fix sympy 1.6
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/fd/derivation.py
+0
-12
0 additions, 12 deletions
pystencils/fd/derivation.py
pystencils_tests/test_fd_derivation.ipynb
+30
-29
30 additions, 29 deletions
pystencils_tests/test_fd_derivation.ipynb
with
30 additions
and
41 deletions
pystencils/fd/derivation.py
+
0
−
12
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
())
...
...
This diff is collapsed.
Click to expand it.
pystencils_tests/test_fd_derivation.ipynb
+
30
−
29
View file @
35c029a0
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