MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / printDifferences

Function printDifferences

python/Scripts/comparenodedefs.py:819–844  ·  view source on GitHub ↗

Print the differences in a formatted way.

(differences)

Source from the content-addressed store, hash-verified

817# -----------------------------------------------------------------------------
818
819def printDifferences(differences):
820 '''Print the differences in a formatted way.'''
821 if not differences:
822 print("No differences found between specification and data library.")
823 return
824
825 # Group differences by type
826 byType = {}
827 for diff in differences:
828 byType.setdefault(diff.diffType, []).append(diff)
829
830 print(f"\n{'=' * 70}")
831 print(f"COMPARISON RESULTS: {len(differences)} difference(s) found")
832 print(f"{'=' * 70}")
833
834 for diffType in DiffType:
835 if diffType not in byType:
836 continue
837
838 diffs = byType[diffType]
839 print(f"\n{diffType.value} ({len(diffs)}):")
840 print("-" * 50)
841
842 for diff in diffs:
843 for line in formatDifference(diff):
844 print(line)
845
846
847# -----------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls 4

printFunction · 0.85
lenFunction · 0.85
formatDifferenceFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected