Skip to content

Commit

Permalink
Fix wrong array.
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoOinonen committed Dec 10, 2024
1 parent 8a7e795 commit 87f5e32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ppafm/HighLevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ def prepareArrays(FF, Vpot, parameters):
gridN = np.shape(FF)
parameters.gridN = gridN
core.setFF_Fpointer(FF)
weakref.finalize(FF, lambda: core.deleteFF_Fpointer()) # Set array pointer to NULL when garbage collector runs.
weakref.finalize(FF, core.deleteFF_Fpointer) # Set array pointer to NULL when garbage collector runs.
if Vpot:
V = np.zeros((gridN[2], gridN[1], gridN[0]))
core.setFF_Epointer(V)
weakref.finalize(FF, lambda: core.deleteFF_Epointer())
weakref.finalize(V, core.deleteFF_Epointer)
else:
V = None
return FF, V
Expand Down

0 comments on commit 87f5e32

Please sign in to comment.