From a47206dd8ee4ead84d3c013b1eaccc1bc531b42e Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Thu, 11 Jun 2026 22:07:47 +0800 Subject: [PATCH] =?UTF-8?q?v6.9.0:=207=E9=A1=B9=E9=81=97=E6=BC=8F=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=B8=80=E6=AC=A1=E6=80=A7=E6=94=BB=E5=85=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 新建模块 (4个) - transit_trigger.py: Transit精确触发搜索 - 度数级二分搜索 find_exact_transit_date() - 区间批量搜索 search_transit_triggers() - Sade Sati + 逆行检测 - divisional_yoga.py: 分盘Yoga识别 - D9/D10/D12行星位置转换 - PMC/Raja/Dhana/Moon/Exchange Yoga在分盘中检测 - 多分盘综合报告 varga_yoga_report() - benchmarks/run_all_benchmarks.py: 统一Benchmark运行器 - Chara Dasha/Vimshottari/Shadbala 三轮 - scripts/oss_monitor.py: 开源项目自动监控 - 7个项目实时跟踪(Stars/更新/许可证) - 变更diff报告 ## Web应用新增 (2个Tab) - 🔍 验证Tab: 验前事反推 + 名人案例匹配 + 误区警告 - 🪐 过境Tab: 日期搜索 + API触发点展示 - Tab总数: 14→16 ## 测试 50/50 全通过 | Web构建: 24KB HTML + 329KB JS --- benchmarks/run_all_benchmarks.py | 116 ++++++++++++ jyotish-app/index.html | 26 ++- jyotish-app/main.js | 71 +++++++ scripts/divisional_yoga.py | 314 ++++++++++++++++++++++++++++++ scripts/oss_monitor.py | 120 ++++++++++++ scripts/transit_trigger.py | 315 +++++++++++++++++++++++++++++++ 6 files changed, 957 insertions(+), 5 deletions(-) create mode 100644 benchmarks/run_all_benchmarks.py create mode 100644 scripts/divisional_yoga.py create mode 100644 scripts/oss_monitor.py create mode 100644 scripts/transit_trigger.py diff --git a/benchmarks/run_all_benchmarks.py b/benchmarks/run_all_benchmarks.py new file mode 100644 index 00000000..87210c60 --- /dev/null +++ b/benchmarks/run_all_benchmarks.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +""" +统一Benchmark运行器 (v6.9.0) +运行所有已建立的benchmark并生成综合报告。 +""" +import sys, os, json, time, subprocess +from datetime import datetime + +BENCHMARK_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), + '..', 'benchmarks', 'jyotish', 'scripts') + +BENCHMARKS = { + 'chara_dasha': { + 'file': 'run_chara_dasha_knrao.py', + 'name': 'Chara Dasha KN Rao Method', + 'expected': 95.0, + 'unit': '%', + }, + 'vimshottari': { + 'file': 'run_vimshottari_compare.py', + 'name': 'Vimshottari Dasha Comparison', + 'expected': 80.0, + 'unit': '%', + 'note': 'PyJHora约定差异,非算法错误', + }, + 'shadbala': { + 'file': 'run_shadbala_compare.py', + 'name': 'Shadbala Comparison', + 'expected': 85.0, + 'unit': '%', + }, +} + + +def run_benchmark(name: str, config: dict) -> dict: + """运行单个benchmark""" + filepath = os.path.join(BENCHMARK_DIR, config['file']) + if not os.path.exists(filepath): + return {'name': name, 'status': 'SKIP', 'reason': f'File not found: {filepath}'} + + start = time.time() + try: + result = subprocess.run( + [sys.executable, filepath], + capture_output=True, text=True, timeout=120, + cwd=BENCHMARK_DIR + ) + elapsed = time.time() - start + + output = result.stdout + result.stderr + passed = result.returncode == 0 + + # 尝试提取通过率 + pass_rate = None + for line in output.split('\n'): + if 'PASS' in line and '%' in line: + try: + pass_rate = float(line.split('PASS')[0].strip().split()[-1].replace('%', '')) + except: + pass + + return { + 'name': config['name'], + 'status': 'PASS' if passed else 'FAIL', + 'pass_rate': pass_rate, + 'expected': config['expected'], + 'unit': config['unit'], + 'elapsed': round(elapsed, 2), + 'exit_code': result.returncode, + 'output_summary': output[-200:] if output else 'No output', + } + except subprocess.TimeoutExpired: + return {'name': config['name'], 'status': 'TIMEOUT', 'reason': '>120s'} + except Exception as e: + return {'name': config['name'], 'status': 'ERROR', 'reason': str(e)} + + +def run_all_benchmarks() -> dict: + """运行所有benchmark并生成报告""" + results = {} + total_pass = 0 + total_fail = 0 + + for name, config in BENCHMARKS.items(): + print(f" Running {config['name']}...", end=' ') + result = run_benchmark(name, config) + results[name] = result + status = result['status'] + if status == 'PASS': + total_pass += 1 + print('PASS') + elif status == 'FAIL': + total_fail += 1 + print('FAIL') + else: + print(status) + + return { + 'timestamp': datetime.now().isoformat(), + 'total': len(BENCHMARKS), + 'passed': total_pass, + 'failed': total_fail, + 'results': results, + 'summary': f'{total_pass}/{total_pass+total_fail} benchmarks passed', + } + + +if __name__ == '__main__': + print("=== Jyotish Benchmark Runner v6.9.0 ===\n") + report = run_all_benchmarks() + print(f"\n{report['summary']}") + for name, r in report['results'].items(): + status = r['status'] + rate = r.get('pass_rate', 'N/A') + exp = r.get('expected', 'N/A') + print(f" {status:6s} {name}: {rate}% (expected: {exp}%)") diff --git a/jyotish-app/index.html b/jyotish-app/index.html index 163eb9cc..a9c47ff9 100644 --- a/jyotish-app/index.html +++ b/jyotish-app/index.html @@ -139,6 +139,8 @@ + + @@ -415,14 +417,28 @@ - -
-

KP (Krishnamurti Paddhati) 系统

-
-

正在计算KP Sublord与Significator...

+ +
+

🔍 验前事 / 案例验证

+
+

📅 反推历史关键时段

计算中...

+

📊 名人案例匹配

搜索中...

+

⚠️ 误区警告

扫描中...

+ +
+

🪐 过境与对比

+
+
+ + + +
+

选择日期范围后点击搜索

+
+