Title: Pruthviraj Gojare — R23-T050: Complete the doctests in digital_image_processing/filters/laplacian_filter.py · Issue #51 · S-AI-Projects/TheAlgorithms-Python · GitHub
Open Graph Title: Pruthviraj Gojare — R23-T050: Complete the doctests in digital_image_processing/filters/laplacian_filter.py · Issue #51 · S-AI-Projects/TheAlgorithms-Python
X Title: Pruthviraj Gojare — R23-T050: Complete the doctests in digital_image_processing/filters/laplacian_filter.py · Issue #51 · S-AI-Projects/TheAlgorithms-Python
Description: Student: Pruthviraj Gojare Task: R23-T050 · 10 of 10 Repository: https://github.com/S-AI-Projects/TheAlgorithms-Python Assigned working branch: student/e26b07f0834 Goal CONTRIBUTING.md asks for doctests covering both valid and erroneous ...
Open Graph Description: Student: Pruthviraj Gojare Task: R23-T050 · 10 of 10 Repository: https://github.com/S-AI-Projects/TheAlgorithms-Python Assigned working branch: student/e26b07f0834 Goal CONTRIBUTING.md asks for doc...
X Description: Student: Pruthviraj Gojare Task: R23-T050 · 10 of 10 Repository: https://github.com/S-AI-Projects/TheAlgorithms-Python Assigned working branch: student/e26b07f0834 Goal CONTRIBUTING.md asks for doc...
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-Python/issues/51
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pruthviraj Gojare — R23-T050: Complete the doctests in digital_image_processing/filters/laplacian_filter.py","articleBody":"\u003c!-- sai-task-v1:R23-T050 -->\n\n## Student: Pruthviraj Gojare\n\n**Task:** R23-T050 · 10 of 10\n**Repository:** https://github.com/S-AI-Projects/TheAlgorithms-Python\n**Assigned working branch:** `student/e26b07f0834`\n\n## Goal\n\nCONTRIBUTING.md asks for doctests covering both valid and erroneous input. Bring digital_image_processing/filters/laplacian_filter.py (1 doctests today) up to that standard. Only 1 doctest. Write doctests using small numpy arrays (no image files) for each kernel size and for the error path.\n\n## Steps\n\n1. Run `uv run --python 3.12 --with numpy --with opencv-python-headless --with pytest --with pytest-cov pytest digital_image_processing/filters/laplacian_filter.py --cov=digital_image_processing/filters --cov-report=term-missing` and note which lines of this file are not covered.\n2. For each public function (`my_laplacian`), list valid, boundary and invalid inputs.\n3. Add doctests for every uncovered branch and at least one erroneous input per function (showing the Traceback/exception line).\n4. Run `uv run python -m doctest -v` on the file and paste the summary line.\n5. Make the code change in the repository: digital_image_processing/filters/laplacian_filter.py: doctests on small numpy arrays for each kernel size (1, 3, 5, 7) and the error path. Re-run the automated check and the repo's own tests afterwards.\n6. Prepare the PR: on branch R23-T050, commit the code change plus your work/R23-T050/ evidence, put your findings in the PR description and open the PR against the org fork. For a later upstream PR, create a second branch containing only the code change (no work/ folder).\n\n## Done when\n\n☐ digital_image_processing/filters/laplacian_filter.py doctests rise from 1 to cover ksize 1, 3, 5 and 7 on small numpy arrays (no image files) and an invalid ksize (ValueError: ksize must be in (1, 3, 5, 7)).\n☐ Doctests run with `uv run --python 3.12 --with numpy --with opencv-python-headless --with pytest pytest \u003cfile>` (output pasted).\n☐ Coverage of my_laplacian is 100%.\n\n\u003cdetails>\n\u003csummary>Additional task guidance\u003c/summary>\n\n\nAdditional curated task guidance\n\nItem:\n`digital_image_processing/filters/laplacian_filter.py` (81 lines; 1 doctests)\n\nTask type:\nDoctest completeness\n\nCode change (goes into the PR):\ndigital_image_processing/filters/laplacian_filter.py: doctests on small numpy arrays for each kernel size (1, 3, 5, 7) and the error path.\n\nAutomated check:\nuv run --python 3.12 --with numpy --with opencv-python-headless --with pytest --with pytest-cov pytest digital_image_processing/filters/laplacian_filter.py --cov=digital_image_processing/filters --cov-report=term-missing # report shows 100% (or justified) for this file\n\nPrerequisites:\nLinux/WSL2/Codespaces with uv (https://docs.astral.sh/uv/getting-started/installation/); run `uv sync --group=test` once – it installs the Python version CI uses (.python-version = 3.15t) and the test dependencies, about 1–2 GB; files importing cv2 need `uv run --python 3.12 --with numpy --with opencv-python-headless …` because CI skips digital_image_processing/ (no 3.15t wheel)\n\nUpstream PR rules:\nFollow CONTRIBUTING.md: type hints on every parameter/return, doctests for valid and erroneous input, snake_case file names, no duplicate of an existing implementation, no hand edits to DIRECTORY.md. CI (pytest with doctests, ruff) must pass – bots close PRs without tests or type hints. Keep work/ (benchmarks, notes, property tests) out of the upstream branch; put results in the PR description.\n\nSource (pinned):\nhttps://github.com/TheAlgorithms/Python/blob/574d100b7181956e9c8384552fd078165e4cc326/digital_image_processing/filters/laplacian_filter.py\n\nChange:\nNo change recorded\n\nPR destination:\nPreserved pilot guidance\n\n\n\u003c/details>\n\n## Submission checklist\n\n- [ ] Complete this task and its checks.\n- [ ] Add the required evidence and link your pull request here.\n- [ ] Select this **S-AI-Projects fork** as the PR base repository.\n- [ ] Request instructor review.\n\nKeep this PR focused on this task. Do not submit assignment PRs to the upstream repository.","author":{"url":"https://github.com/ankushbisht01","@type":"Person","name":"ankushbisht01"},"datePublished":"2026-11-03T18:45:33Z","url":"https://github.com/S-AI-Projects/TheAlgorithms-Python/issues/51"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:58e09c0e-722c-d303-1ae8-a0c7df25c94b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B0D8:3BE588:D1B1C:131BC7:6AFDC0D6 |
| html-safe-nonce | aa0fe1f2348d9b1c464c02d5357b97e2b3460cf9201f4fc9f0d06299c9f154a9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEQ4OjNCRTU4ODpEMUIxQzoxMzFCQzc6NkFGREMwRDYiLCJ2aXNpdG9yX2lkIjoiMzg5NzI1MDQ3ODYyMjA5NzYyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fc614ea9ede8098b14e21eb2323507093aabc3ef53d3c71dde7ac2e2e32014de |
| hovercard-subject-tag | issue:6189009336 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/S-AI-Projects/TheAlgorithms-Python/51/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9db514cc955760ea8f8ab742babf9f0b8628e3347b99e9290c0e9a1fd6ed1011/S-AI-Projects/TheAlgorithms-Python/issues/51 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9db514cc955760ea8f8ab742babf9f0b8628e3347b99e9290c0e9a1fd6ed1011/S-AI-Projects/TheAlgorithms-Python/issues/51 |
| og:image:alt | Student: Pruthviraj Gojare Task: R23-T050 · 10 of 10 Repository: https://github.com/S-AI-Projects/TheAlgorithms-Python Assigned working branch: student/e26b07f0834 Goal CONTRIBUTING.md asks for doc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ankushbisht01 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 35c6bf57da1370dc64866160540c0ee9f825f291935b3bf6ec5492b00e35f3a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/S-AI-Projects/TheAlgorithms-Python git https://github.com/S-AI-Projects/TheAlgorithms-Python.git |
| octolytics-dimension-user_id | 351892385 |
| octolytics-dimension-user_login | S-AI-Projects |
| octolytics-dimension-repository_id | 1444141022 |
| octolytics-dimension-repository_nwo | S-AI-Projects/TheAlgorithms-Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 63476337 |
| octolytics-dimension-repository_parent_nwo | TheAlgorithms/Python |
| octolytics-dimension-repository_network_root_id | 63476337 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ab48c73a2978548773f5f24717ed9e58508befdb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width