Skip to content

feat: add aria2c build-fullmap downloads - #74

Merged
SkyeAv merged 1 commit into
mainfrom
speed-up-downloads
Aug 11, 2026
Merged

feat: add aria2c build-fullmap downloads#74
SkyeAv merged 1 commit into
mainfrom
speed-up-downloads

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Adds an opt-in aria2c downloader path for build-fullmap BABEL downloads, giving users segmented/resumable transfers when the executable is installed while keeping the existing Python downloader as the default.

Aria2c Downloader

  • Opt-in CLI: Adds build-fullmap --aria2c / -a and threads aria2c=True through build_fullmap_pipeline.
  • Resume semantics: Adds download_babel_file_aria2c() with --continue=true, --max-tries, and --retry-wait, preserving .aria2 control files so dropped downloads can resume on rerun.
  • Failure behavior: Fails loud with BabelDownloadError when aria2c is missing, exits non-zero, leaves an incomplete file, or receives invalid retry settings.
  • Progress behavior: Keeps the existing file-level Download progress bar; Python downloads retain byte-level detail, while aria2c mode reports aria2c downloading and suppresses aria2's own console UI.

Docs

  • Documents --aria2c / -a in docs/cli.md, docs/fullmap.md, and CHANGELOG.md.

Testing

  • uv run pytest tests/test_cover_cli.py tests/test_cli_progress.py tests/test_docs_cli_coverage.py -n 034 passed, 48 warnings.
  • uv run ruff check . → all checks passed.
  • uv run ruff format --check .69 files already formatted.
  • uv run tablassert build-fullmap --help → confirms ARIA2C --aria2c -a [default: False].

Summary by CodeRabbit

  • New Features

    • Added optional --aria2c/-a support to build-fullmap for segmented, resumable downloads with retries and progress reporting.
    • Preserved existing Python-based downloading as the default.
    • Downloads now clearly report failures when aria2c is unavailable or unsuccessful.
  • Documentation

    • Updated CLI and fullmap build documentation with usage examples and downloader behavior.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds optional aria2c support to build-fullmap. It adds resumable downloads, retry handling, failure checks, CLI forwarding, offline tests, and documentation. Python downloading remains the default.

Changes

aria2c fullmap downloading

Layer / File(s) Summary
aria2c downloader implementation
src/tablassert/cli.py, tests/test_cover_cli.py
Adds aria2c invocation, retry and resume handling, cache checks, executable validation, failure reporting, completion verification, and direct tests.
fullmap pipeline integration
src/tablassert/cli.py, tests/test_cover_cli.py
Adds the aria2c pipeline option and --aria2c/-a flags. Class and synonym downloads use aria2c when enabled, with forwarding and progress tests.
CLI and build documentation
CHANGELOG.md, docs/cli.md, docs/fullmap.md
Documents the optional downloader, segmented resume behavior, progress reporting, and failure conditions.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant FullmapPipeline
  participant aria2c
  participant FullmapBuilder
  CLI->>FullmapPipeline: Forward aria2c=True
  FullmapPipeline->>aria2c: Download class and synonym files
  aria2c-->>FullmapPipeline: Return downloaded paths
  FullmapPipeline->>FullmapBuilder: Pass paths and thread settings
  FullmapBuilder-->>CLI: Build fullmap
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding optional aria2c downloads to build-fullmap.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch speed-up-downloads

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/cli.md`:
- Line 98: Update the --aria2c CLI reference entry to document that downloads
also fail when aria2c exits successfully but the final file is missing or the
.aria2 control file remains, matching the validation performed by
download_babel_file_aria2c.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b0834bc-b201-4562-847a-a2acb9c7beb5

📥 Commits

Reviewing files that changed from the base of the PR and between 4dd3351 and 261e3bf.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/cli.md
  • docs/fullmap.md
  • src/tablassert/cli.py
  • tests/test_cover_cli.py

Comment thread docs/cli.md
| `--cache`, `-c` | Path | No | `./fullmap/downloads` | Directory for downloaded BABEL files (`classes/`, `synonyms/`) |
| `--version`, `-v` | str | No | `2026jul22` | BABEL snapshot date to fetch (a RENCI stamp, **not** Tablassert's version) |
| `--threads`, `-t` | int | No | `None` (auto) | Worker threads; auto-capped by memory on Linux (`/proc/meminfo`), else ~90% of CPUs |
| `--aria2c`, `-a` | Flag | No | `False` | Opt into the installed `aria2c` executable for resumable segmented BABEL downloads; fails loud if `aria2c` is missing or exits non-zero |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document incomplete-output failures.

download_babel_file_aria2c also raises when aria2c exits successfully but the final file is missing or the .aria2 control file remains. Include this case so the CLI reference matches src/tablassert/cli.py:425-509.

Proposed wording
-| `--aria2c`, `-a` | Flag | No | `False` | Opt into the installed `aria2c` executable for resumable segmented BABEL downloads; fails loud if `aria2c` is missing or exits non-zero |
+| `--aria2c`, `-a` | Flag | No | `False` | Opt into the installed `aria2c` executable for resumable segmented BABEL downloads; fails loud if `aria2c` is missing, exits non-zero, or leaves an incomplete file |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `--aria2c`, `-a` | Flag | No | `False` | Opt into the installed `aria2c` executable for resumable segmented BABEL downloads; fails loud if `aria2c` is missing or exits non-zero |
| `--aria2c`, `-a` | Flag | No | `False` | Opt into the installed `aria2c` executable for resumable segmented BABEL downloads; fails loud if `aria2c` is missing, exits non-zero, or leaves an incomplete file |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/cli.md` at line 98, Update the --aria2c CLI reference entry to document
that downloads also fail when aria2c exits successfully but the final file is
missing or the .aria2 control file remains, matching the validation performed by
download_babel_file_aria2c.

@SkyeAv
SkyeAv merged commit 23414d3 into main Aug 11, 2026
5 checks passed
@SkyeAv
SkyeAv deleted the speed-up-downloads branch August 11, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant