flekspy 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flekspy-0.3.2 → flekspy-0.3.3}/PKG-INFO +1 -1
- {flekspy-0.3.2 → flekspy-0.3.3}/pyproject.toml +1 -1
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/idl/idl.py +21 -21
- {flekspy-0.3.2 → flekspy-0.3.3}/.gitignore +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/LICENSE.md +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/README.md +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/__init__.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/flekspy.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/idl/__init__.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/plot/__init__.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/plot/streamplot.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/tp/__init__.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/tp/test_particles.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/util/__init__.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/util/data_container.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/util/utilities.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/yt/__init__.py +0 -0
- {flekspy-0.3.2 → flekspy-0.3.3}/src/flekspy/yt/yt.py +0 -0
|
@@ -212,14 +212,14 @@ class IDLData(object):
|
|
|
212
212
|
with open(saveName, "w") as f:
|
|
213
213
|
f.write(self.unit + "\n")
|
|
214
214
|
f.write(
|
|
215
|
-
"{:d}\t{:e}\t{:d}\t{:d}\t{:d}\n".format(
|
|
215
|
+
"{0:d}\t{1:e}\t{2:d}\t{3:d}\t{4:d}\n".format(
|
|
216
216
|
self.iter, self.time, self.ndim, self.nparam, self.nvar
|
|
217
217
|
)
|
|
218
218
|
)
|
|
219
|
-
[f.write("{:d}\t".format(i)) for i in self.grid]
|
|
219
|
+
[f.write("{0:d}\t".format(i)) for i in self.grid]
|
|
220
220
|
f.write("\n")
|
|
221
221
|
if self.nparam > 0:
|
|
222
|
-
[f.write("{:e}\t".format(i)) for i in self.para]
|
|
222
|
+
[f.write("{0:e}\t".format(i)) for i in self.para]
|
|
223
223
|
f.write("\n")
|
|
224
224
|
[f.write(i + " ") for i in self.variables]
|
|
225
225
|
f.write("\n")
|
|
@@ -231,7 +231,7 @@ class IDLData(object):
|
|
|
231
231
|
for jj in range(nj):
|
|
232
232
|
for ii in range(ni):
|
|
233
233
|
[
|
|
234
|
-
f.write("{:e}\t".format(i))
|
|
234
|
+
f.write("{0:e}\t".format(i))
|
|
235
235
|
for i in self.data.array[:, ii, jj, kk]
|
|
236
236
|
]
|
|
237
237
|
f.write("\n")
|
|
@@ -424,30 +424,30 @@ class IDLData(object):
|
|
|
424
424
|
def read_binary_instance(self, infile):
|
|
425
425
|
self.get_file_head(infile)
|
|
426
426
|
nrow = self.ndim + self.nvar
|
|
427
|
-
self.data.array = np.zeros((nrow, self.npoints), dtype=np.float32)
|
|
428
427
|
|
|
429
|
-
|
|
428
|
+
if self.pformat == "f":
|
|
429
|
+
dtype = np.float32
|
|
430
|
+
else:
|
|
431
|
+
dtype = np.float64
|
|
432
|
+
|
|
433
|
+
self.data.array = np.empty((nrow, self.npoints), dtype=dtype)
|
|
434
|
+
dtype_str = f"{self.end_char}{self.pformat}"
|
|
435
|
+
|
|
436
|
+
# Get the grid points
|
|
430
437
|
(old_len, record_len) = struct.unpack(self.end_char + "2l", infile.read(8))
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
infile.read(int(record_len // self.ndim)),
|
|
437
|
-
)
|
|
438
|
-
)
|
|
439
|
-
self.data.array[i, :] = tempgrid
|
|
438
|
+
buffer = infile.read(record_len)
|
|
439
|
+
grid_data = np.frombuffer(
|
|
440
|
+
buffer, dtype=dtype_str, count=self.npoints * self.ndim
|
|
441
|
+
)
|
|
442
|
+
self.data.array[0 : self.ndim, :] = grid_data.reshape((self.ndim, self.npoints))
|
|
440
443
|
|
|
441
444
|
# Get the actual data and sort
|
|
442
445
|
for i in range(self.ndim, self.nvar + self.ndim):
|
|
443
446
|
(old_len, record_len) = struct.unpack(self.end_char + "2l", infile.read(8))
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
infile.read(record_len),
|
|
448
|
-
)
|
|
447
|
+
buffer = infile.read(record_len)
|
|
448
|
+
self.data.array[i, :] = np.frombuffer(
|
|
449
|
+
buffer, dtype=dtype_str, count=self.npoints
|
|
449
450
|
)
|
|
450
|
-
self.data.array[i, :] = tmp
|
|
451
451
|
# Consume the last record length
|
|
452
452
|
infile.read(4)
|
|
453
453
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|