Does light charge the quons? › Files cited on the page › check_section12_fable/

links_check.py

In the investigation at sim/models_AB/check_section12_fable/links_check.py · last changed in commit 73319b6, 23 November 2026 · 3,103 bytes · the folder as a zip


#!/usr/bin/env python3
"""r28: check the links in the pages under review.
Links of the form https://aetherscience.net/aspden-analysis-files/charging-quons/<path>.html map to the
repository file <path>; https://aetherscience.org/aspden-analysis-files/<file> maps to papers/figures/<file>.
Everything else is listed for a look by eye."""
import re, os, sys

ROOT = '/home/doug/aetherscience.org/aspden-investigation'
TARGETS = [
    ('papers/Charging_quons_2026-11-12.md', (2304, 2382)),   # 11.3-11.4
    ('papers/Charging_quons_2026-11-12.md', (2382, 2667)),   # 12
    ('papers/Charging_quons_2026-11-12.md', (2854, 2864)),   # change log 0.38
    ('papers/Charging_quons_2026-11-12.md', (3, 4)),         # header
    ('papers/Charging_quons_2026-11-12.md', (215, 218)),
    ('papers/Charging_quons_2026-11-12.md', (596, 603)),
    ('papers/Charging_quons_2026-11-12.md', (1030, 1034)),
    ('papers/Charging_quons_explained_2026-11-16.md', (1, 6)),
    ('papers/Charging_quons_explained_2026-11-16.md', (457, 572)),
    ('papers/Matter_to_vacuum_2026-11-22.md', (1, 200)),
    ('papers/Publication_questions_tracker.md', (16, 26)),
    ('papers/Publication_questions_tracker.md', (95, 96)),
    ('papers/Publication_questions_tracker.md', (196, 206)),
]
URL = re.compile(r'\((https?://[^)\s]+)\)|<(https?://[^>\s]+)>|(?<![(<])(https?://[^\s)>\]]+)')
PREFIX = 'https://aetherscience.net/aspden-analysis-files/charging-quons/'
FIGPREFIX = 'https://aetherscience.org/aspden-analysis-files/'

seen = {}
other = {}
for rel, (a, b) in TARGETS:
    with open(os.path.join(ROOT, rel), encoding='utf-8') as fh:
        for n, line in enumerate(fh, 1):
            if n < a or n >= b:
                continue
            for m in URL.finditer(line):
                url = next(g for g in m.groups() if g)
                url = url.rstrip('.,;')
                loc = f'{rel}:{n}'
                if url.startswith(PREFIX):
                    path = url[len(PREFIX):]
                    if path.endswith('.html'):
                        path = path[:-5]
                    seen.setdefault((url, path), []).append(loc)
                elif url.startswith(FIGPREFIX):
                    path = 'papers/figures/' + url[len(FIGPREFIX):]
                    seen.setdefault((url, path), []).append(loc)
                else:
                    other.setdefault(url, []).append(loc)

missing = []
print('=== charging-quons folder links:', len(seen))
for (url, path), locs in sorted(seen.items()):
    exists = os.path.exists(os.path.join(ROOT, path))
    if not exists:
        missing.append((url, path, locs))
print('--- MISSING in repo:', len(missing))
for url, path, locs in missing:
    print('MISSING', path, '<-', url)
    for l in locs:
        print('      ', l)
print('--- present:', len(seen) - len(missing))
for (url, path), locs in sorted(seen.items()):
    if os.path.exists(os.path.join(ROOT, path)):
        print('ok  ', path, '(%d)' % len(locs))
print()
print('=== other links:', len(other))
for url, locs in sorted(other.items()):
    print(url)
    for l in locs:
        print('      ', l)