Skip to content

Commit

Permalink
fix: remove trailing new lines from separate mapping files, which con…
Browse files Browse the repository at this point in the history
…fuses CIPHER
  • Loading branch information
aplowman committed Apr 15, 2024
1 parent 4798a62 commit bb19744
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cipher_parse/cipher_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,17 @@ def write_yaml(self, path, separate_mappings=False):

self.geometry._validate_interface_map()

phase_mat_str = compress_1D_array_string(self.geometry.phase_material + 1) + "\n"
vox_phase_str = (
compress_1D_array_string(self.geometry.voxel_phase.flatten(order="F") + 1)
+ "\n"
)
int_str = (
compress_1D_array_string(self.geometry.interface_map_int.flatten() + 1) + "\n"
phase_mat_str = compress_1D_array_string(self.geometry.phase_material + 1)
vox_phase_str = compress_1D_array_string(
self.geometry.voxel_phase.flatten(order="F") + 1
)
int_str = compress_1D_array_string(self.geometry.interface_map_int.flatten() + 1)

if not separate_mappings:
# CIPHER does not like trailing new lines in the mapping text files:
phase_mat_str += "\n"
vox_phase_str += "\n"
int_str += "\n"

if separate_mappings:
phase_mat_map = "phase_material_mapping.txt"
Expand Down

0 comments on commit bb19744

Please sign in to comment.