Tue 27 Jan 10:39:43 CET 2026
This commit is contained in:
parent
be0edb5d56
commit
b948765864
|
|
@ -10,6 +10,17 @@ from scipy.io import savemat
|
|||
import math
|
||||
import yaml
|
||||
|
||||
import re
|
||||
|
||||
def strip_python_tags(s):
|
||||
result = []
|
||||
|
||||
for line in s.splitlines():
|
||||
line = re.sub("!!python/[^ ]+","",line)
|
||||
line = re.sub("!![^ ]","",line)
|
||||
result.append(line)
|
||||
return '\n'.join(result)
|
||||
|
||||
class SnapShots:
|
||||
def __init__(self, Enable=False, Extension='.png', Step=200, Filename=None, File_path = None, dB=60, Color=0,
|
||||
Field = 0,
|
||||
|
|
@ -183,18 +194,16 @@ class SnapShots:
|
|||
savemat(FILE, S)
|
||||
|
||||
|
||||
def save_summary (self,dt,dx):
|
||||
def save_summary (self,data):
|
||||
if self.enableSummary == True:
|
||||
FILE = self.Filename + ("-simulation.yml")
|
||||
FILE_PATH = os.path.join(self.File_path, FILE)
|
||||
# save in yaml format
|
||||
data = dict (
|
||||
dt=dt,
|
||||
dx=dx
|
||||
)
|
||||
print("Saving simulation summary in "+FILE_PATH)
|
||||
yaml.encoding = None
|
||||
text = strip_python_tags(yaml.dump(data,default_flow_style=False))
|
||||
with open(FILE_PATH, 'w') as outfile:
|
||||
yaml.dump(data, outfile, default_flow_style=False)
|
||||
outfile.write(text)
|
||||
|
||||
def save_power(self, Vx, Vy, n):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user