Skip to content

Commit ee65c7b

Browse files
sbryngelsonclaude
andcommitted
Add missing Pack.has_NaNs() method for restart tests
The restart roundtrip tests call pack.has_NaNs() to detect NaN output, but the method was never implemented on the Pack class. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6f8f243 commit ee65c7b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

toolchain/mfc/packer/pack.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ def find(self, filepath: str) -> PackEntry:
4040
def set(self, entry: PackEntry):
4141
self.entries[entry.filepath] = entry
4242

43+
def has_NaNs(self) -> bool:
44+
"""Return True if any entry contains NaN values."""
45+
import math
46+
47+
return any(math.isnan(d) for e in self.entries.values() for d in e.doubles)
48+
4349
def remove(self, filepath_or_entry: typing.Union[str, PackEntry]):
4450
if isinstance(filepath_or_entry, str):
4551
del self.entries[filepath_or_entry]

0 commit comments

Comments
 (0)