Skip to content

Commit 02de7a1

Browse files
committed
Use read_from_numpy_file for consistency
mmap has negligible effect since all data is read eventually
1 parent 7e35ae4 commit 02de7a1

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

mala/datahandling/ldos_aligner.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,11 @@ def align_ldos_to_ref(
145145
reference_index
146146
]
147147
if snapshot_ref.snapshot_type == 'numpy':
148-
ldos_ref = np.load(
148+
ldos_ref = self.target_calculator.read_from_numpy_file(
149149
os.path.join(
150150
snapshot_ref.output_npy_directory,
151151
snapshot_ref.output_npy_file,
152-
),
153-
mmap_mode="r",
152+
)
154153
)
155154
elif snapshot_ref.snapshot_type == 'openpmd':
156155
ldos_ref = self.target_calculator.read_from_openpmd_file(
@@ -215,12 +214,11 @@ def align_ldos_to_ref(
215214
snapshot = self.parameters.snapshot_directories_list[idx]
216215
print(f"Aligning snapshot {idx+1} of {N_snapshots}")
217216
if snapshot_ref.snapshot_type == 'numpy':
218-
ldos = np.load(
217+
ldos = self.target_calculator.read_from_numpy_file(
219218
os.path.join(
220219
snapshot.output_npy_directory,
221220
snapshot.output_npy_file,
222-
),
223-
mmap_mode="r",
221+
)
224222
)
225223
elif snapshot_ref.snapshot_type == 'openpmd':
226224
ldos = self.target_calculator.read_from_openpmd_file(

0 commit comments

Comments
 (0)