Skip to content

Commit

Permalink
pySTEL: Added deepcopy so multiple objects can be loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
lazersos committed Dec 7, 2024
1 parent 57ca057 commit c846fd3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pySTEL/libstell/boozer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def read_boozer(self,filename):
Path to wout file.
"""
import numpy as np
boozmn_dict = self.libStell.read_boozer(filename)
import copy
boozmn_dict = copy.deepcopy(self.libStell.read_boozer(filename))
for key in boozmn_dict:
setattr(self, key, boozmn_dict[key])
self.mboz_b = int(max(np.squeeze(self.ixm_b)))
Expand Down
6 changes: 4 additions & 2 deletions pySTEL/libstell/nescoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class with information from a nescin file.
file : str
Path to nescin file.
"""
nescin_dict = self.libStell.read_nescoil_input(filename)
import copy
nescin_dict = copy.deepcopy(self.libStell.read_nescoil_input(filename))
for key in nescin_dict:
setattr(self, key, nescin_dict[key])

Expand All @@ -57,7 +58,8 @@ class with information from a nescout file.
file : str
Path to nescout file.
"""
nescout_dict = self.libStell.read_nescout(filename)
import copy
nescout_dict = copy.deepcopy(self.libStell.read_nescout(filename))
for key in nescout_dict:
setattr(self, key, nescout_dict[key])

Expand Down
3 changes: 2 additions & 1 deletion pySTEL/libstell/vmec.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def read_wout(self,filename):
Path to wout file.
"""
import numpy as np
wout_dict = self.libStell.read_wout(filename)
import copy
wout_dict = copy.deepcopy(self.libStell.read_wout(filename))
for key in wout_dict:
setattr(self, key, wout_dict[key])
# (mu-nv) -> (mu+nv)
Expand Down

0 comments on commit c846fd3

Please sign in to comment.