Skip to content

Commit 655d740

Browse files
committed
style: Fix Black formatting issues in 7 files
1 parent 036d001 commit 655d740

File tree

7 files changed

+396
-380
lines changed

7 files changed

+396
-380
lines changed

check_harmony.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,23 @@
1010
from harmonizer.legacy_mapper import LegacyCodeMapper
1111

1212

13-
def check_harmony(
14-
target_dir: str = ".", config_path: str = None, verbose: bool = False
15-
):
13+
def check_harmony(target_dir: str = ".", config_path: str = None, verbose: bool = False):
1614
print(f"Running LJPW Harmony Check on: {os.path.abspath(target_dir)}")
1715
print("=" * 60)
1816

1917
# If analyzing a subdirectory, find project root for config
2018
# Otherwise use target_dir
2119
project_root = os.getcwd() if target_dir != "." else target_dir
22-
20+
2321
# Create mapper - it will load config from project_root
2422
mapper = LegacyCodeMapper(target_dir, quiet=not verbose)
25-
23+
2624
# If we're in project root, use config from there
2725
if os.path.exists(os.path.join(project_root, "pyproject.toml")):
2826
from harmonizer.config import ConfigLoader
27+
2928
mapper.config = ConfigLoader.load(project_root)
30-
29+
3130
mapper.analyze_codebase(show_progress=True)
3231

3332
failures = []
@@ -81,13 +80,9 @@ def check_harmony(
8180

8281
def main():
8382
parser = argparse.ArgumentParser(description="LJPW Harmony Check")
84-
parser.add_argument(
85-
"target", nargs="?", default=".", help="Target directory to analyze"
86-
)
83+
parser.add_argument("target", nargs="?", default=".", help="Target directory to analyze")
8784
parser.add_argument("--config", help="Path to configuration file (optional)")
88-
parser.add_argument(
89-
"-v", "--verbose", action="store_true", help="Enable verbose output"
90-
)
85+
parser.add_argument("-v", "--verbose", action="store_true", help="Enable verbose output")
9186

9287
args = parser.parse_args()
9388

harmonizer/ljpw_baselines.py

Lines changed: 52 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -271,118 +271,109 @@ def interpret_composite_score(score: float) -> str:
271271
return "Excellent - high-performing, growth active"
272272
else:
273273
return "Elite - exceptional, Love multiplier engaged"
274-
274+
275275
@staticmethod
276276
def validate_coupling_structure() -> Dict[str, bool]:
277277
"""
278278
Validate that the coupling matrix exhibits expected relationship patterns.
279-
279+
280280
This validates the "grammar of semantic interaction":
281281
- Love amplifies (κ_L→* > 1)
282282
- Power constrains (κ_P→* < 1)
283283
- Justice supports Wisdom (κ_JW > κ_JP)
284284
- Asymmetry is present (κ_ij ≠ κ_ji)
285-
285+
286286
Returns:
287287
Dict with validation results for each pattern
288288
"""
289289
cm = LJPWBaselines.COUPLING_MATRIX
290-
290+
291291
# Check Love amplifies
292-
love_amplifies = (
293-
cm['LJ'] > 1.0 and
294-
cm['LP'] > 1.0 and
295-
cm['LW'] > 1.0
296-
)
297-
292+
love_amplifies = cm["LJ"] > 1.0 and cm["LP"] > 1.0 and cm["LW"] > 1.0
293+
298294
# Check Power constrains
299-
power_constrains = (
300-
cm['PL'] < 1.0 and
301-
cm['PJ'] < 1.0 and
302-
cm['PW'] < 1.0
303-
)
304-
295+
power_constrains = cm["PL"] < 1.0 and cm["PJ"] < 1.0 and cm["PW"] < 1.0
296+
305297
# Check Justice supports Wisdom more than Power
306-
justice_wisdom = cm['JW'] > cm['JP']
307-
298+
justice_wisdom = cm["JW"] > cm["JP"]
299+
308300
# Check asymmetry (giving ≠ receiving)
309301
asymmetry = (
310-
abs(cm['LJ'] - cm['JL']) > 0.1 and
311-
abs(cm['LP'] - cm['PL']) > 0.1 and
312-
abs(cm['PJ'] - cm['JP']) > 0.1
302+
abs(cm["LJ"] - cm["JL"]) > 0.1
303+
and abs(cm["LP"] - cm["PL"]) > 0.1
304+
and abs(cm["PJ"] - cm["JP"]) > 0.1
313305
)
314-
306+
315307
return {
316-
'love_amplifies': love_amplifies,
317-
'power_constrains': power_constrains,
318-
'justice_supports_wisdom': justice_wisdom,
319-
'asymmetry_present': asymmetry,
320-
'all_patterns_valid': all([
321-
love_amplifies,
322-
power_constrains,
323-
justice_wisdom,
324-
asymmetry
325-
])
308+
"love_amplifies": love_amplifies,
309+
"power_constrains": power_constrains,
310+
"justice_supports_wisdom": justice_wisdom,
311+
"asymmetry_present": asymmetry,
312+
"all_patterns_valid": all(
313+
[love_amplifies, power_constrains, justice_wisdom, asymmetry]
314+
),
326315
}
327-
316+
328317
@staticmethod
329-
def check_proportions(L: float, J: float, P: float, W: float, tolerance: float = 0.3) -> Dict[str, any]:
318+
def check_proportions(
319+
L: float, J: float, P: float, W: float, tolerance: float = 0.3
320+
) -> Dict[str, any]:
330321
"""
331322
Check if L:J:P:W proportions match Natural Equilibrium (scale-invariant check).
332-
323+
333324
This validates the core insight: "relationships between constants matter more
334325
than the constants themselves." The same proportions define harmony at any scale.
335-
326+
336327
Args:
337328
L, J, P, W: Current dimension values (any scale)
338329
tolerance: Allowed deviation from ideal ratios (default 0.3 = 30%)
339-
330+
340331
Returns:
341332
Dict with proportion analysis
342333
"""
343334
NE = ReferencePoints.NATURAL_EQUILIBRIUM
344-
335+
345336
# Calculate current ratios (scale-invariant)
346337
if J <= 0:
347-
return {
348-
'proportions_healthy': False,
349-
'error': 'Justice dimension cannot be zero'
350-
}
351-
338+
return {"proportions_healthy": False, "error": "Justice dimension cannot be zero"}
339+
352340
current_ratios = {
353-
'L/J': L / J,
354-
'P/J': P / J,
355-
'W/J': W / J,
341+
"L/J": L / J,
342+
"P/J": P / J,
343+
"W/J": W / J,
356344
}
357-
345+
358346
# Expected ratios from Natural Equilibrium
359347
expected_ratios = {
360-
'L/J': NE[0] / NE[1], # 1.492
361-
'P/J': NE[2] / NE[1], # 1.734
362-
'W/J': NE[3] / NE[1], # 1.673
348+
"L/J": NE[0] / NE[1], # 1.492
349+
"P/J": NE[2] / NE[1], # 1.734
350+
"W/J": NE[3] / NE[1], # 1.673
363351
}
364-
352+
365353
# Check deviations
366354
deviations = {}
367355
checks = {}
368-
356+
369357
for key in expected_ratios:
370358
expected = expected_ratios[key]
371359
actual = current_ratios[key]
372360
deviation = abs(actual - expected) / expected
373361
deviations[key] = deviation
374362
checks[key] = deviation < tolerance
375-
363+
376364
all_pass = all(checks.values())
377-
365+
378366
return {
379-
'proportions_healthy': all_pass,
380-
'current_ratios': current_ratios,
381-
'expected_ratios': expected_ratios,
382-
'deviations': deviations,
383-
'checks': checks,
384-
'summary': 'Proportions match Natural Equilibrium (scale-invariant)' if all_pass
385-
else f'Proportions deviate from Natural Equilibrium'
367+
"proportions_healthy": all_pass,
368+
"current_ratios": current_ratios,
369+
"expected_ratios": expected_ratios,
370+
"deviations": deviations,
371+
"checks": checks,
372+
"summary": (
373+
"Proportions match Natural Equilibrium (scale-invariant)"
374+
if all_pass
375+
else f"Proportions deviate from Natural Equilibrium"
376+
),
386377
}
387378

388379

0 commit comments

Comments
 (0)