cfdf515228
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.1 KiB
2.1 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path, source_repo, source_license, source_file
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | source_repo | source_license | source_file | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| add_basemap_with_timeout | function | py | geo | 1.0.0 | impure | def add_basemap_with_timeout(ax: Axes, zoom: int = 9, cache_dir: str | Path | None = None, timeout_s: float = 15.0) -> bool | Igual que add_basemap_osm pero con timeout SIGALRM. Retorna True si cargó el basemap, False si timeout o error. Solo Unix — en Windows retorna False inmediatamente. |
|
false | error_go_core |
|
|
True si el basemap se añadió correctamente; False en timeout, error de red, o Windows. | true |
|
python/functions/geo/tests/test_add_basemap_with_timeout.py | python/functions/geo/add_basemap_with_timeout.py | internal:footprint_aurgi | internal-aurgi | ponderacion_isochronas/src/reporte_clientes_aurgi.py:69 |
Ejemplo
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from geo.add_basemap_with_timeout import add_basemap_with_timeout
fig, ax = plt.subplots()
ax.set_xlim(-430000, -350000)
ax.set_ylim(4500000, 4600000)
ok = add_basemap_with_timeout(ax, zoom=10, timeout_s=20.0)
if not ok:
print("Basemap no disponible (sin red o timeout)")
fig.savefig("mapa.png")
Notas
Limitación: usa SIGALRM que solo está disponible en Unix/Linux/macOS. En Windows retorna False inmediatamente sin intentar la descarga. El timeout usa signal.setitimer(ITIMER_REAL, ...) que tiene resolución de microsegundos. El handler original de SIGALRM se restaura en el bloque finally.