devitocodes / devito

DSL and compiler framework for automated finite-differences and stencil computation
http://www.devitoproject.org
MIT License
537 stars 221 forks source link

Rebuilding a `ConditionalDimension` with no factor adds a factor. #2325

Open EdCaunt opened 4 months ago

EdCaunt commented 4 months ago

If a ConditionalDimension is created with factor=None, then self._factor is set to None, but self.factor will return 1. As such, when rebuilding a ConditionalDimension with no factor, a factor of 1 is added unexpectedly, changing the generated code.

georgebisbas commented 1 month ago

Is there an MFE for this?

EdCaunt commented 1 month ago

Create a ConditionalDimension with a condition but no factor, then compare cd._factor to cd._rebuild()._factor