4
4
5
5
import numpy as np
6
6
from numpy .polynomial import Chebyshev
7
+ # from scipy.interpolate import CubicSpline
7
8
8
9
from .const import CONST
9
10
@@ -75,14 +76,14 @@ def __init__(self) -> None:
75
76
# try to load values from json file
76
77
77
78
try :
78
- openfile = open (CONST .KENNFELDFILE , "r" )
79
+ openfile = open (CONST .KENNFELDFILE , "r" , encoding = "utf-8" )
79
80
except IOError :
80
81
kennfeld = {
81
82
"known_x" : self .known_x ,
82
83
"known_y" : self .known_y ,
83
84
"known_t" : self .known_t ,
84
85
}
85
- with open (CONST .KENNFELDFILE , "w" ) as outfile :
86
+ with open (CONST .KENNFELDFILE , "w" , encoding = "utf-8" ) as outfile :
86
87
json .dump (kennfeld , outfile )
87
88
else :
88
89
json_object = json .load (openfile )
@@ -121,9 +122,6 @@ def __init__(self) -> None:
121
122
122
123
def map (self , x , y ):
123
124
"""Map."""
124
- numrows = len (self .max_power ) # 3 rows in your example
125
-
126
- numcols = len (self .max_power [0 ]) # 2 columns in your example
127
125
x = x - self .known_x [0 ]
128
126
if x < 0 :
129
127
x = 0
@@ -140,9 +138,9 @@ def map(self, x, y):
140
138
141
139
# map = PowerMap()
142
140
143
- # plt.plot(t,np.transpose(map.max_power))
144
- # plt.ylabel(' Max Power' )
145
- # plt.xlabel('°C' )
141
+ # plt.plot(t, np.transpose(map.max_power))
142
+ # plt.ylabel(" Max Power" )
143
+ # plt.xlabel("°C" )
146
144
# plt.show()
147
145
148
146
# kennfeld = {'known_x': map.known_x,
0 commit comments