topos.functors.profunctors.mdg.compare¶
MDG Comparison — profunctor D : E × E^op → ℝ restricted to the
inter-module dependency graph.
====================================================================
Pairwise comparison of two
ModuleDependencyGraph instances.
MDG comparison answers questions of the form “did this refactor move
the file’s architectural position in the codebase?” — coupling, Martin
instability, fan-in/out, and reachable-import depth.
Signals (all target − source so a positive delta means more):
coupling_delta : signed change in Ca + Ce instability_delta : signed change in Martin instability
Ce/(Ca+Ce)fan_in_delta : signed change in incoming CALLS edges fan_out_delta : signed change in outgoing CALLS edges dep_depth_delta : signed change in longest IMPORTS chain
- class topos.functors.profunctors.mdg.compare.MDGComparison(coupling_delta, instability_delta, fan_in_delta, fan_out_delta, dep_depth_delta, source_metrics, target_metrics)[source]
Bases:
objectPairwise comparison summary for two module-dependency graphs.
- coupling_delta
- instability_delta
- fan_in_delta
- fan_out_delta
- dep_depth_delta
- source_metrics
- target_metrics
- property changed
- topos.functors.profunctors.mdg.compare.coupling_delta(source, target)[source]
Signed change in total coupling Ca + Ce (target − source).
- topos.functors.profunctors.mdg.compare.instability_delta(source, target)[source]
Signed change in Martin instability
Ce / (Ca + Ce).
- topos.functors.profunctors.mdg.compare.fan_in_delta(source, target)[source]
Signed change in incoming CALLS edges.
- topos.functors.profunctors.mdg.compare.fan_out_delta(source, target)[source]
Signed change in outgoing CALLS edges.
- topos.functors.profunctors.mdg.compare.dep_depth_delta(source, target)[source]
Signed change in longest IMPORTS chain length.
- topos.functors.profunctors.mdg.compare.compare_mdg(source, target)[source]
Run the full MDG comparison suite for a single pair of graphs.