diff --git a/hexrdgui/calibration/wppf_options_dialog.py b/hexrdgui/calibration/wppf_options_dialog.py index e21ae66dc..b2bf5880b 100644 --- a/hexrdgui/calibration/wppf_options_dialog.py +++ b/hexrdgui/calibration/wppf_options_dialog.py @@ -1330,7 +1330,8 @@ def recursively_format_mat(mat, this_config, this_template): texture_dict = tree_dict.setdefault('Texture', {}) for mat_name in self.textured_materials: # Look for param names that match - prefix = f'{mat_name}_c_' + mat_name_sanitized = mat_name.replace('-', '_') + prefix = f'{mat_name_sanitized}_c_' matching_names = [k for k in params if k.startswith(prefix)] if not matching_names: continue @@ -1839,6 +1840,7 @@ def update_texture_model_gui(self): self.ui.texture_ell_max.setValue(settings['ell_max']) self.update_texture_model_enable_states() + self.update_texture_index_label() def update_texture_model_enable_states(self): # Determine whether we should disable the model texture @@ -1976,7 +1978,7 @@ def polar_extent(self) -> list[float] | None: @property def varying_texture_params(self): - for mat_name in self.textured_materials: + for mat_name in self.textured_materials_sanitized: prefix = f'{mat_name}_c_' for param in self.params.values(): if param.name.startswith(prefix) and param.vary: @@ -1989,7 +1991,10 @@ def varying_texture_and_non_texture_params(self): if not self.varying_texture_params: return False - prefixes = [f'{mat_name}_c_' for mat_name in self.textured_materials] + prefixes = [ + f'{mat_name}_c_' for mat_name in + self.textured_materials_sanitized + ] for name, param in self.params.items(): if param.vary and not any(name.startswith(x) for x in prefixes): return True @@ -2228,6 +2233,10 @@ def textured_materials(self) -> list[str]: return list(self.texture_model_kwargs) + @property + def textured_materials_sanitized(self) -> list[str]: + return [name.replace('-', '_') for name in self.textured_materials] + @property def texture_model_kwargs(self) -> dict[str]: return self.texture_settings['model_kwargs']