59 Commits
Author SHA1 Message Date
priya-sundaram-dev e2ada02159 chore: uv sync --upgrade + relock; make scripts/pr_file_map.py executable (#15398) 2026-09-22 07:40:40 +02:00
priya-sundaram-dev 2acda52732 pr_file_map.py: fetch PR files concurrently with asyncio (#15374)
The slow 'first pass' was one sequential 'gh pr view' per open PR (~one
network round-trip each), so it is I/O-bound. Fetch them concurrently with
asyncio.create_subprocess_exec, bounded by a semaphore (default 10,
override via PR_FILE_MAP_CONCURRENCY) to stay polite to the GitHub API.

Output is unchanged and deterministic (results keyed back in PR order);
errors still fail fast with the same messages.
2026-09-18 18:52:12 +02:00
priya-sundaram-devandChristian Clauss 54a6a65050 pr_file_map.py: add ignore_pull_request, progress passes, and a dated title (#15368)
* pr_file_map.py: add ignore_pull_request list, progress passes, dated title

- Add module-level ignore_pull_request: list[int]; get_open_prs() filters
  those PR numbers out (e.g. [123, 456, 789] skips #123, #456, #789).
- Drop the redundant DIRECTORY.md comment above DIRECTORY_FILE (the module
  docstring and render_directory_section already explain it).
- Fold the generation datetime into the H1 title:
  '# Open Pull Request File Map: 16 Sep 2026 at 21:45 UTC'.
- Show progress on stderr via other/cheap_progress.py's progress() for the
  'First pass' (fetch each PR's files) and 'Second pass' (classify files).

* Change ignore_pull_request from list to set

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-17 15:58:43 +02:00
Christian Claussandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 0dd623ad34 pr_file_map.py: Use a human-readable date format (#15357)
* pr_file_map.py: Use a human-readable date format

Use a human-readable date format.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-16 11:52:15 +01:00
priya-sundaram-devandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 00d9ebb4c0 Move DIRECTORY.md to its own section in pr_file_map.py (#15353)
* Move DIRECTORY.md to its own section in pr_file_map.py

DIRECTORY.md is auto-generated and touched by nearly every open PR, so it
dominated the 'possible merge conflicts' list and distracted maintainers.
Pull it out into a dedicated section at the very bottom of the report that
separates PRs whose only overlap is DIRECTORY.md (safe to 'accept both' in
the GitHub UI) from PRs that also collide on real source files.

Also render the Script path relative to the git root instead of an absolute
machine-specific path.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-15 23:54:51 +02:00
priya-sundaram-dev 2d1d3d3f23 Highlight PRs that overlap on the same file in pr_file_map.py (#15321)
Add a 'files touched by more than one open PR' section (sorted with the
most-contested files first) so overlapping PRs -- the likely merge-conflict
hot spots -- are visible at a glance when deciding what to land.

Also report two distinct file totals: 'file touches' (every PR x file pair)
and 'distinct files touched'. Only the distinct total equals existing +
missing, which fixes the earlier single count that double-counted files
edited by multiple PRs.
2026-09-14 23:03:50 +02:00
CopilotcclaussChristian Clausscopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
e8f2965749 Improve scripts/pr_file_map.py observability and output metadata (#15317)
* Use pathlib and add PR/file status reporting in pr_file_map

Co-authored-by: cclauss <3709715+cclauss@users.noreply.github.com>

* Ensure pr_file_map outputs summary with zero open PRs

Co-authored-by: cclauss <3709715+cclauss@users.noreply.github.com>

* Retain no-open-PR message in generated pr_file_map report

Co-authored-by: cclauss <3709715+cclauss@users.noreply.github.com>

* Return after no-open-PR summary in pr_file_map

Co-authored-by: cclauss <3709715+cclauss@users.noreply.github.com>

* Apply batched suggestions from code review

Co-authored-by: Christian Clauss <cclauss@me.com>

* Apply suggestion from @cclauss

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: cclauss <3709715+cclauss@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2026-09-13 21:40:51 +01:00
Dharshini_RSChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
aa38af81c9 fix:bucket count type (#15063)
* fix:bucket count type

* fixed TypeError

* Refine docstring and adjust return statement

Updated docstring for partition_liked_list method to clarify behavior. Changed return statement from None to None for consistency.

* Add script to map open PRs to modified files

This script lists all open pull requests in the current directory's git repository and maps each file touched by any open PR to its corresponding PR numbers. It outputs the results in GitHub-flavored Markdown format.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add noqa comments for subprocess calls

Add noqa comments to suppress specific linting warnings.

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-13 09:25:21 +02:00
Christian Claussandcclauss 3725b917aa pre-commit: Add zizmor and replace prettier with rumdl (#15236)
* pre-commit: Add zizmor and replace prettier with rumdl

* updating DIRECTORY.md

---------

Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-09 09:55:19 +01:00
priya-sundaram-dev 15c5af0255 fix(ci): correct the Hacktoberfest tracker's open-issue count and add a countdown (#15235)
* fix(ci): count open issues reliably and add a Hacktoberfest countdown

The tracker's "Open issues" line was showing the pull-request total (e.g.
621) instead of the issue total (107). GitHub's `/search/issues`
`is:issue` / `is:pr` qualifiers are unreliable on this large, high-churn
repo -- some runs return the PR pool for *both* queries, so the two lines
printed the same number.

Count without the flaky qualifiers instead:
- open PRs = the `Link: rel="last"` page number of `/repos/{repo}/pulls`
  (deterministic, page-numbered pagination);
- open issues = the repo endpoint's `open_issues_count` (issues + PRs)
  minus the open-PR total -- self-checking and stable.

Also add the requested Hacktoberfest countdown to the stats block:
- days until 2026-10-01;
- issues to close per day to clear the backlog;
- PRs to merge or close per day to clear the backlog.

Per-day figures round up (finishing a day early beats a day late) and
degrade to a clear message once Hacktoberfest starts, so the block never
divides by zero on the final day.

* chore: re-trigger keeper after marking PR checklist
2026-09-09 10:42:03 +02:00
priya-sundaram-dev 6372acb164 fix(ci): persist Hacktoberfest tracker via a PR (protected-branch push was silently failing) (#15231)
* fix(ci): open a PR to persist Hacktoberfest tracker instead of pushing to protected master

* ci: use bundled gh CLI instead of peter-evans/create-pull-request

Per @cclauss / zizmor 'superfluous actions' audit, persist the rolling
tracker PR with the gh CLI rather than a third-party action.

* fix(ci): make tracker refresh degrade gracefully when rate limited

The dry run was failing because a run can exhaust the GITHUB_TOKEN's
1000/hour-per-repo budget (shared across concurrent runs) — chiefly the
awaiting-reviews directory scan. A single exhausted request then raised
and killed the whole job.

- _request now honours Retry-After (secondary limits) and, once retries
  are exhausted, raises BestEffortError instead of a bare RuntimeError.
- Row resolution, the directory scan, and the search counts catch
  BestEffortError and degrade (keep the row / mark the stat unavailable)
  instead of failing. Only the post-Oct-1 retirement exits non-zero.
- Trim the directory scan to 120 PRs and CONCURRENCY to 5 to stay well
  under the shared budget in the first place.
2026-09-09 07:13:11 +02:00
priya-sundaram-dev 22899ed01e ci: dry-run the Hacktoberfest prep tracker on push/PR (#15227)
* ci: dry-run hacktoberfest prep on push/PR, add path filters

* ci: use double quotes in path filters (prettier)

* fix: resolve tracker rows via /issues so issue rows don't 404

The tracker's 'Open issues' section lists issue numbers; querying them
against /pulls/{n} returns 404 and crashed the whole refresh. Query the
unified /issues/{n} endpoint instead, which resolves for both PRs and
issues; a row is 'merged' only when it's a PR with merged_at set.
2026-09-08 12:53:28 +02:00
priya-sundaram-dev fb906d8504 perf: async fan-out + progress reporting for hacktoberfest prep tracker (#15226)
The daily prep job spent ~16 minutes because it looked up the changed
files of every open 'awaiting reviews' PR one request at a time. Those
lookups are independent, so fire them concurrently through a single
httpx2.AsyncClient bounded by a small semaphore, and likewise resolve the
tracked-row PR states and the issue/PR counts concurrently. Report
progress to stderr (flushed) so a human watching the Actions log can see
the job is alive. Runtime drops from ~16 min of serial round-trips to
well under a minute.
2026-09-08 09:50:36 +02:00
priya-sundaram-devandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 1eeed73945 ci: daily Hacktoberfest 2026 prep tracker refresh (cron 11:50 UTC) (#15225)
* ci: daily Hacktoberfest 2026 prep tracker refresh (cron 11:50 UTC)

Adds .github/workflows/hacktoberfest_prep.yml (schedule: 50 11 * * *) and
scripts/hacktoberfest_prep_update.py. Each run:

- ticks tracked PR rows in docs/hacktober_2026_prep.md that are now
  merged/closed (`[ ]` -> `[x]`),
- rewrites an 'Automated statistics' section with the current open issue and
  open PR counts plus the top three directories with the most open
  'awaiting reviews' PRs,
- exits non-zero once Hacktoberfest 2026 has begun (>= 2026-10-01), so the
  prep window closing is loud and the job gets retired.

Standard library only; uses the Actions GITHUB_TOKEN. Refs #15081.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* style: wrap implicit string concatenations (ISC004)

* refactor: use httpx2 for API calls, drop unneeded future import

Address review feedback on the Hacktoberfest prep cron:
- Switch the tracker script from urllib to httpx2, the repo's standard
  HTTP client, and add an install step to the workflow.
- Drop 'from __future__ import annotations' (unnecessary on Python >= 3.14t).

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-08 08:48:46 +02:00
priya-sundaram-dev 0c7ac7f80a Add a table of contents to DIRECTORY.md (#15198)
* Add a table of contents to DIRECTORY.md

Generate a linked table of contents of the top-level sections at the top
of DIRECTORY.md so readers can jump straight to a category, as suggested
in #13239 / #13111. The list is built in scripts/build_directory_md.py
(with a new md_anchor helper + doctests) so DIRECTORY.md stays fully
auto-generated.

* Address review: numbered ToC + link section headings to their directories

- Table of Contents is now a numbered list, so the final number shows the
  total count of algorithm folders at a glance.
- Each top-level section heading links to its algorithm directory (e.g.
  ## [Sorts](sorts)), so clicking a section title jumps straight to the folder.
2026-09-06 08:15:34 +02:00
Christian Claussandpriya-sundaram-dev 4c3ba663a2 fix(find_git_conflicts): actually label conflicting PRs and stop skipping past 500 (#15182)
* fix(find_git_conflicts): actually label conflicting PRs and stop skipping past 500

* @priya-sundaram-dev #15181
* [x] Fix a script

* Workaround for mapfile

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>

* Update scripts/find_git_conflicts.sh

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>

* Update scripts/find_git_conflicts.sh

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>

---------

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>
2026-09-06 07:05:08 +02:00
priya-sundaram-devandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> bfa655ecea deps: migrate from httpx to httpx2 (pydantic's maintained fork) (#15192)
* deps: migrate from httpx to httpx2 (pydantic's maintained fork)

Mechanical rename of httpx -> httpx2 (API-compatible fork of httpx 0.28.1):
pyproject.toml deps, PEP 723 inline-script headers, and all import/call sites.
Excludes uv.lock (the keeper's allow-list rejects .lock files); the lock
refresh needs a separate maintainer-merged PR.

Refs #15081

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* deps: drop tweepy + migrate remaining requests refs to httpx2

- maths/allocation_number.py: docstring example uses httpx2, not requests
- web_programming/get_imdbtop.py.DISABLED: import httpx2 instead of requests
- remove web_programming/get_user_tweets.py.DISABLED (a Twitter API how-to,
  not an algorithm) and drop the tweepy dependency that was its only user and
  the last high-level dep pulling in requests
- uv.lock intentionally untouched (keeper allow-list)

Refs #15081

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-09-05 09:26:45 +02:00
1bd049c5d2 scripts: de-duplicate and harden the close_pull_requests_with_*.sh backlog jobs (#15170)
* scripts: de-duplicate and harden the close_pull_requests_with_*.sh backlog jobs

Extract the five byte-for-byte-identical backlog-closing scripts into one
parameterized close_pull_requests_with_label.sh and make each named script a
thin wrapper. Addresses the recommendations from #15168:

- Correctness: filter by label server-side (gh pr list --label) instead of
  listing all ~900 open PRs and matching client-side, so no PR is skipped by
  an arbitrary --limit cap.
- De-duplication: one implementation removes the drift between copies (some
  had sleep 2, one had it commented out, two had none).
- Throttling: a single, deliberate SLEEP (default 2s) between closes.
- Safety rails: set -euo pipefail, explicit --repo, and a DRY_RUN=1 preview
  mode that prints what would close before a maintainer commits.
- Machine-readable summary (CLOSED_COUNT/CLOSED_PRS) so the Hacktoberfest
  tracker can be updated from script output.

Follow-up to #15081.

* updating DIRECTORY.md

---------

Co-authored-by: priya-sundaram-dev <oc-409d01@agentmail.to>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2026-09-03 15:40:32 +01:00
Christian Claussandcclauss 1562ae1ec3 Add a README.md file to the scripts directory (#13480)
* Add a README.md file to the scripts directory

* updating DIRECTORY.md

---------

Co-authored-by: cclauss <cclauss@users.noreply.github.com>
2025-10-14 09:33:01 +02:00
DiyaandMaxim Smolskiy 9ddb0272bf Adding doctest for md_prefix function in build_directory_md.py (#12874)
* Adding doctests for md_prefix function in build_directory_md.py

* Update build_directory_md.py

* Update build_directory_md.py

* Update build_directory_md.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2025-08-24 14:22:00 +03:00
Christian ClaussLim, Lukaz Wei Hwang <lukaz.wei.hwang.lim@intel.com>cclausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
a2fa32c7ad Lukazlim: Replace dependency requests with httpx (#12744)
* Replace dependency `requests` with `httpx`

Fixes #12742
Signed-off-by: Lim, Lukaz Wei Hwang <lukaz.wei.hwang.lim@intel.com>

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Lim, Lukaz Wei Hwang <lukaz.wei.hwang.lim@intel.com>
Co-authored-by: Lim, Lukaz Wei Hwang <lukaz.wei.hwang.lim@intel.com>
Co-authored-by: cclauss <cclauss@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-05-14 04:42:11 +03:00
Christian Clauss f721e598e5 Add a proper shebang line to scripts/validate_filenames.py (#12733) 2025-05-12 14:33:33 +03:00
Christian Clauss 485f688d06 Add PEP723 header to scripts/validate_solutions.py (#12731)
Enable `uv run scripts/validate_solutions.py` or `pipx run scripts/validate_solutions.py`
* https://peps.python.org/pep-0723
* https://docs.astral.sh/uv/guides/scripts/#declaring-script-dependencies
2025-05-12 13:52:27 +03:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
edf7c372a9 [pre-commit.ci] pre-commit autoupdate (#12623)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.10 → v0.11.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.10...v0.11.0)
- [github.com/abravalheri/validate-pyproject: v0.23 → v0.24](https://github.com/abravalheri/validate-pyproject/compare/v0.23...v0.24)

* Fix ruff issues

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2025-03-18 09:53:49 +01:00
pre-commit-ci[bot]pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
4fe50bc1fc [pre-commit.ci] pre-commit autoupdate -- ruff 2025 stable format (#12521)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/dual_number_automatic_differentiation.py

* Update maths/dual_number_automatic_differentiation.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dual_number_automatic_differentiation.py

* Update dual_number_automatic_differentiation.py

* No <fin-streamer> tag with the specified data-test attribute found.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2025-01-13 21:52:12 +01:00
Christian Clauss e3bd7721c8 validate_filenames.py Shebang python for Windows (#12371) 2024-11-15 14:59:14 +01:00
Christian Clauss a19bede190 Add scripts/find_git_conflicts.sh (#12343) 2024-11-01 13:40:09 +01:00
Christian Clauss a9ca110d6b Scripts for closing pull requests for Hacktoberfest (#11587)
* Scripts for closing pull requests for Hacktoberfest

* --limit=500

* Lose 2024
2024-09-30 12:49:31 +02:00
Maxim Smolskiyandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 2702bf9400 Enable ruff S113 rule (#11375)
* Enable ruff S113 rule

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-21 19:34:18 +02:00
Maxim Smolskiyandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 53b2926704 Enable ruff PGH003 rule (#11345)
* Enable ruff PGH003 rule

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-02 21:29:34 +02:00
Maxim Smolskiyandpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> 93fb555e0a Enable ruff SIM102 rule (#11341)
* Enable ruff SIM102 rule

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-02 03:27:56 +02:00
MCandMICHAEL CASTLE 5f61af4fbb Fix ignore venv in build_directory_md.py (#11156)
Co-authored-by: MICHAEL CASTLE <CASTLM@tdm.local>
2023-11-16 17:00:48 +06:00
Christian Claussandgithub-actions 4004b862d5 Revert "validate_solutions.py: os.getenv('GITHUB_TOKEN', '')" (#10552)
* Revert "validate_solutions.py: os.getenv('GITHUB_TOKEN', '') (#10546)"

This reverts commit 68e6d5ad7e.

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-15 15:40:13 -04:00
Christian Claussandgithub-actions 68e6d5ad7e validate_solutions.py: os.getenv('GITHUB_TOKEN', '') (#10546)
* validate_solutions.py: os.getenv('GITHUB_TOKEN', '')

@tianyizheng02

* updating DIRECTORY.md

* f this

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-15 13:11:05 -04:00
Christian ClaussDhruv Manilawalapre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
4b79d771cd Add more ruff rules (#8767)
* Add more ruff rules

* Add more ruff rules

* pre-commit: Update ruff v0.0.269 -> v0.0.270

* Apply suggestions from code review

* Fix doctest

* Fix doctest (ignore whitespace)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-26 09:34:17 +02:00
Dhruv Manilawala 9e0c357a57 chore: additional Project Euler solution hash (#8593) 2023-04-01 08:29:26 +02:00
Christian Clauss 64543faa98 Make some ruff fixes (#8154)
* Make some ruff fixes

* Undo manual fix

* Undo manual fix

* Updates from ruff=0.0.251
2023-03-01 17:23:33 +01:00
Christian Clauss b75a7c77f8 pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0 (#6245)
* pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0

* pre-commit run --all-files
2022-07-11 10:19:52 +02:00
Vcrostin 69cde43ca1 make DIRECTORY.md paths relative Fixes (#6179) (#6190) 2022-06-22 12:01:05 +08:00
b743e44259 Wavelet tree (#4267)
* Added the matrix_exponentiation.py file in maths directory

* Implemented the requested changes

* Update matrix_exponentiation.py

* resolve merge conflict with upstream branch

* add new line at end of file

* add wavelet_tree

* fix isort issue

* updating DIRECTORY.md

* fix variable names in wavelet_tree and correct typo

* Add type hints and variable renaming

* Update data_structures/binary_tree/wavelet_tree.py

Add doctests to placate the algorithm-bot, thanks to @cclauss.

Co-authored-by: Christian Clauss <cclauss@me.com>

* Move doctest to individual functions and reformat code

* Move common test array to the global scope and reuse in tests

* MMove test array to global scope and minor linting changes

* Correct the failing pytest tests

* MUse built-in list for type annotation

* Update wavelet_tree.py

* types-requests

* updating DIRECTORY.md

* Update wavelet_tree.py

* # type: ignore

* # type: ignore

* Update decrypt_caesar_with_chi_squared.py

* ,

* Update decrypt_caesar_with_chi_squared.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Aniruddha Bhattacharjee <aniruddha@Aniruddhas-MacBook-Air.local>
2021-06-08 22:49:33 +02:00
03d9b6747b feat(ci): Hash project euler solutions (#4411)
* hash project euler solutions

* fix errors

* Return missing annotation

* Fix typo

* Extract variable to shorten excessively long line

* Update scripts/validate_solutions.py

* Update scripts/validate_solutions.py

* Simplify with str.encode()

* PEP 585: type hinting generics in standard collections;

* str().encode()

* Texas two step to placate black, flake8, mypy

Co-authored-by: Andrii Siriak <siryaka@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2021-05-12 09:48:23 +02:00
Christian Clauss 252df0a149 fix(mypy): Fix files in scripts/ (#4320) 2021-04-07 08:12:56 +05:30
Dhruv Manilawala ba6310b647 Validate only submitted Project Euler solution (#3977)
* Update validate solution script to fetch only submitted solution
* Update workflow file with the updated PE script
* Fix: do not fetch `validate_solutions.py` script
* Update script to use the requests package for API calls
* Fix: install requests module
* Pytest ignore scripts/ directory
2020-11-29 23:11:09 +05:30
Sam Holst 89e8dbffba removed extra line to match rest of file (#3528) 2020-10-25 01:19:59 +08:00
Dhruv Manilawala b97529dd88 Move validate_solutions and add durations flag to pytest.ini (#3704)
* Move PE validate_solutions to scripts/ directory

* Update pytest.ini file with durations settings

* Remove codespell and autoblack workflow file

* Dependent changes to test config files

* Update pytest.ini
2020-10-24 19:07:33 +05:30
Dhruv 9016fe192f Fix imports for all namespace packages (#2506)
* Fix imports as they're namespace packages

* Fix import for scripts/validate_filenames.py

* Fix path in doctest
2020-09-28 23:41:04 +02:00
Dhruv 48357cea5b Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
Christian Clauss 697495b017 Fix copy / paste oversight (#2448) 2020-09-19 07:25:18 +02:00
Christian Claussandgithub-actions 363858ef3b hyphen_files = [file for file in filepaths if "-" in file] (#2447)
* hyphen_files = [file for file in filepaths if "-" in file]

* updating DIRECTORY.md

* Rename recursive-quick-sort.py to recursive_quick_sort.py

* updating DIRECTORY.md

* Rename aho-corasick.py to aho_corasick.py

* updating DIRECTORY.md

* Rename polynom-for-points.py to polynom_for_points.py

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-09-19 07:13:10 +02:00
Christian Claussandgithub-actions 5f4da5d616 isort --profile black . (#2181)
* updating DIRECTORY.md

* isort --profile black .

* Black after

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-07-06 09:44:19 +02:00