Skip to content

Surface Transforms cannot be unset. #711

@MicahGale

Description

@MicahGale

This was found during #709.

The suspect code is in montepy.surfaces.surface

    def _update_values(self):
        modifier = self._tree["surface_num"]["modifier"]
        if self.is_reflecting:
            modifier.value = "*"
        elif self.is_white_boundary:
            modifier.value = "+"
        else:
            modifier.value = ""
        if self.transform is not None:
            self._old_transform_number.value = self.transform.number
            self._old_transform_number.is_negative = False
            self._tree.nodes["pointer"] = self._old_transform_number
        elif self.periodic_surface is not None:
            self._old_periodic_surface.value = self.periodic_surface.number
            self._old_periodic_surface.is_negative = True
            self._tree.nodes["pointer"] = self._old_periodic_surface

If self.transorm is None there is no way to update the transform/periodic_surface number to be None. This will require a slight redesign and testing that I can't do right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsA deviation from expected behavior that does not reach the level of being reportable as an "Error".

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions