chore: add base dependencies and project readme#2
Conversation
Summary of ChangesHello @dhalmazna, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes the foundational environment for the CIAO explanation package. By incorporating essential runtime dependencies and updating the project documentation, it prepares a stable and clean working environment. This setup is crucial for enabling the subsequent development of core data structures and search algorithms without encountering CI/CD pipeline failures, ensuring a smooth development workflow. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughProject renamed and rebranded to "CIAO: Contextual Importance Assessment via Obfuscation". Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
The pull request successfully updates the README.md with project-specific information and adds necessary dependencies to pyproject.toml. The changes align with the goal of initializing the basic environment for the CIAO explanation package. The README.md now provides a clear overview, quick start guide, method details, and project structure, which is a significant improvement over the generic template. The pyproject.toml correctly lists the core dependencies required for the project.
There was a problem hiding this comment.
Pull request overview
This PR initializes the CIAO (Contextual Importance Assessment via Obfuscation) explanation package by setting up the development environment with necessary dependencies and project documentation. It transitions from a generic Python project template to a specific XAI (explainable AI) implementation project.
Changes:
- Updated package metadata and added 13+ runtime dependencies for ML/DL, configuration management, visualization, and scientific computing
- Replaced generic template README with comprehensive CIAO project documentation including method descriptions, usage examples, and project structure
- Updated Python version requirement to >=3.12,<3.14
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| pyproject.toml | Updated package name to "rationai-ciao", added comprehensive dependency list (torch, hydra, mlflow, matplotlib, networkx, etc.), and set Python version to >=3.12,<3.14 |
| README.md | Replaced template README with CIAO-specific documentation including project overview, usage instructions, method details, and planned project structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pyproject.toml
Outdated
| description = "CIAO: Contextual Importance Assessment via Obfuscation - An XAI method for identifying influential image regions" | ||
| authors = [] | ||
| requires-python = ">=3.11" | ||
| requires-python = ">=3.12,<3.14" |
There was a problem hiding this comment.
The Python version constraint >=3.12,<3.14 may be overly restrictive for users. Python 3.14 hasn't been released yet (current knowledge cutoff is January 2025, and it's February 2026 according to context), but setting an upper bound to exclude a future version can prevent users from adopting newer Python versions when they become available. Unless there's a specific known incompatibility concern, consider using only a lower bound >=3.12 to allow forward compatibility, or if an upper bound is necessary, use <4.0 to allow minor version updates within Python 3.x.
| requires-python = ">=3.12,<3.14" | |
| requires-python = ">=3.12,<4.0" |
README.md
Outdated
| │ │ ├── segmentation.py # Segmentation utilities | ||
| │ │ └── search_utils.py # Search algorithm utilities | ||
| │ ├── visualization/ # Visualization tools | ||
| │ │ └── visualisation.py # Interactive visualizations |
There was a problem hiding this comment.
Inconsistent spelling between American and British English: the directory is named "visualization" (American spelling) on line 102, but the file inside is named "visualisation.py" (British spelling) on line 103. For consistency, both should use the same spelling convention. Recommend using American English spelling ("visualization.py") throughout the codebase to match common Python conventions.
| │ │ └── visualisation.py # Interactive visualizations | |
| │ │ └── visualization.py # Interactive visualizations |
pyproject.toml
Outdated
| description = "CIAO: Contextual Importance Assessment via Obfuscation - An XAI method for identifying influential image regions" | ||
| authors = [] | ||
| requires-python = ">=3.11" | ||
| requires-python = ">=3.12,<3.14" |
There was a problem hiding this comment.
The Python version requirement in pyproject.toml is set to >=3.12,<3.14, but the ruff configuration in .ruff.toml specifies target-version = "py311". These should be consistent. Update .ruff.toml to use target-version = "py312" to match the minimum Python version requirement in pyproject.toml.
| requires-python = ">=3.12,<3.14" | |
| requires-python = ">=3.11,<3.14" |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
README.md (3)
82-82: Add a language specifier to the fenced code block to satisfy MD040.📝 Proposed fix
-``` +```text ciao-simple/🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 82, The fenced code block containing the text "ciao-simple/" is missing a language specifier and triggers MD040; update the opening fence from ``` to a language-tagged fence such as ```text (i.e., modify the fenced block that contains "ciao-simple/" so its opening fence includes a language specifier) so the linter passes.
31-48: Preferpython -m ciaooverpython ciaofor package invocation.
python ciao(directory form) adds theciao/directory itself tosys.path[0]and leaves__package__asNone, which can break absolute imports likefrom ciao.explainer import ....python -m ciaois idiomatic and ensures the CWD (where the package root lives) is onsys.path[0].📝 Proposed fix
-python ciao +python -m ciao-python ciao data.image_path=./my_image.jpg explanation.method=mcts explanation.segment_size=8 +python -m ciao data.image_path=./my_image.jpg explanation.method=mcts explanation.segment_size=8-- `uv run python ciao` - Run CIAO with default configuration +- `uv run python -m ciao` - Run CIAO with default configuration🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 31 - 48, Replace invocations of "python ciao" with the module-invocation form "python -m ciao" to avoid running the package as a script and breaking absolute imports; update the example code block (the single-line usage and the Hydra override example) and the Development Commands list entry (`uv run python ciao`) to use `python -m ciao` instead so the package is executed via -m and CWD is correctly placed on sys.path[0].
1-1: Inconsistent project name:CIAO-Simplevsrationai-ciao(pyproject.toml) /ciao(repo).The
-Simplesuffix in the README title and theciao-simple/root label in the structure diagram don't match the package name or repository name. Consider aligning on a single canonical name.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 1, The README uses an inconsistent project name ("CIAO-Simple" and "ciao-simple/") that conflicts with package/repo names ("rationai-ciao" in pyproject.toml and "ciao" in the repo); pick a single canonical project name (e.g., "ciao" or "rationai-ciao"), then update the README title ("CIAO-Simple") and any root labels in the structure diagram ("ciao-simple/") to match that canonical name so the README aligns with pyproject.toml and the repository naming.pyproject.toml (1)
37-38: Consider adding minimum version pins for dev/test tooling.
mypyandruffship breaking lint/type-check rule additions frequently; an unguardeduv lock --upgradecould silently introduce CI failures. The checked-in lock file protects current users, but explicit lower bounds make the intent clear and reduce breakage risk when the lock is regenerated.📝 Example
-dev = ["mypy", "ruff"] -test = ["pytest", "pytest-cov"] +dev = ["mypy>=1.10.0", "ruff>=0.4.0"] +test = ["pytest>=8.0.0", "pytest-cov>=5.0.0"]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pyproject.toml` around lines 37 - 38, Summary: The dev and test dependency lists in pyproject.toml lack minimum version constraints for tools like mypy/ruff/pytest, risking CI breakage on lockfile updates. Fix: update the dev = [...] and test = [...] entries to include explicit lower-bound version specifiers for each tool (e.g., mypy, ruff, pytest, pytest-cov) so they read as package>=MIN_VERSION rather than bare names; then regenerate your lockfile (uvicorn/poetry/whatever lock command you use) and run CI locally to verify. Target the mypy/ruff entries in the dev optional-dependencies and pytest/pytest-cov entries in the test optional-dependencies. Ensure the chosen MIN_VERSION values reflect the minimum supported/validated versions your project has been tested against.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pyproject.toml`:
- Around line 11-34: The numpy constraint currently "numpy>=1.21.0" can allow
NumPy 2.x which is incompatible with the declared torch>=2.0.0; update the
dependency constraint for numpy to include an upper bound (e.g., change
"numpy>=1.21.0" to a range that excludes 2.x such as "numpy>=1.21.0,<2.0") so
resolvers cannot select NumPy 2.x while using torch>=2.0.0.
In `@README.md`:
- Around line 19-25: The README uses the wrong directory name: replace
occurrences of "cd ciao-simple" and any "ciao-simple" entries in the project
structure diagram with the actual repository directory name "ciao" so the
clone/cd instructions and the project structure match the real repo produced by
`git clone <repository-url>`; update all instances of the string "ciao-simple"
to "ciao" (including the project structure block) to keep docs consistent.
---
Nitpick comments:
In `@pyproject.toml`:
- Around line 37-38: Summary: The dev and test dependency lists in
pyproject.toml lack minimum version constraints for tools like mypy/ruff/pytest,
risking CI breakage on lockfile updates. Fix: update the dev = [...] and test =
[...] entries to include explicit lower-bound version specifiers for each tool
(e.g., mypy, ruff, pytest, pytest-cov) so they read as package>=MIN_VERSION
rather than bare names; then regenerate your lockfile (uvicorn/poetry/whatever
lock command you use) and run CI locally to verify. Target the mypy/ruff entries
in the dev optional-dependencies and pytest/pytest-cov entries in the test
optional-dependencies. Ensure the chosen MIN_VERSION values reflect the minimum
supported/validated versions your project has been tested against.
In `@README.md`:
- Line 82: The fenced code block containing the text "ciao-simple/" is missing a
language specifier and triggers MD040; update the opening fence from ``` to a
language-tagged fence such as ```text (i.e., modify the fenced block that
contains "ciao-simple/" so its opening fence includes a language specifier) so
the linter passes.
- Around line 31-48: Replace invocations of "python ciao" with the
module-invocation form "python -m ciao" to avoid running the package as a script
and breaking absolute imports; update the example code block (the single-line
usage and the Hydra override example) and the Development Commands list entry
(`uv run python ciao`) to use `python -m ciao` instead so the package is
executed via -m and CWD is correctly placed on sys.path[0].
- Line 1: The README uses an inconsistent project name ("CIAO-Simple" and
"ciao-simple/") that conflicts with package/repo names ("rationai-ciao" in
pyproject.toml and "ciao" in the repo); pick a single canonical project name
(e.g., "ciao" or "rationai-ciao"), then update the README title ("CIAO-Simple")
and any root labels in the structure diagram ("ciao-simple/") to match that
canonical name so the README aligns with pyproject.toml and the repository
naming.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
README.mdpyproject.toml
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
pyproject.toml (1)
11-11:⚠️ Potential issue | 🟠 Major
numpy>=1.21.0still lacks an upper bound, remaining incompatible withtorch>=2.0.0.PyTorch 2.0.x wheels were compiled against the NumPy 1.x ABI; NumPy 2.0 introduced an ABI break that makes those wheels fail at import time. The resolver can freely select NumPy 2.x today unless bounded.
📝 Proposed fix
- "numpy>=1.21.0", + "numpy>=1.21.0,<2.0",Once the
torchlower bound is raised to>=2.2, NumPy 2.x becomes compatible and this constraint can be removed.Also applies to: 29-29
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pyproject.toml` at line 11, The pyproject dependency list allows numpy>=1.21.0 with no upper bound which is incompatible with torch>=2.0.0; update the numpy spec to constrain it below 2.0 (e.g. change "numpy>=1.21.0" to "numpy>=1.21,<2.0") so resolver won't pick NumPy 2.x until you raise torch's lower bound to >=2.2 (at which point you can remove the upper bound). Ensure you modify the numpy entry that sits alongside the "torch>=2.0.0" declaration.README.md (1)
21-21:⚠️ Potential issue | 🟡 Minor
cd ciao-simpleand the project structure root still reference the wrong directory name.Both instances remain unresolved from the prior review: cloning
https://github.com/RationAI/ciao.gitproduces aciao/directory, notciao-simple/.📝 Proposed fix
-cd ciao-simple +cd ciao-ciao-simple/ +ciao/Also applies to: 84-84
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 21, The README references the wrong directory name ("cd ciao-simple"); update all occurrences of "ciao-simple" in the README (e.g., the "cd ciao-simple" command and any "project structure root" mentions) to the actual cloned folder name "ciao" so commands and examples reflect cloning https://github.com/RationAI/ciao.git, and verify the two instances flagged (around lines shown) are corrected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 31-39: Update the Quick Start command examples so they run in the
project's virtual environment: replace the bare "python ciao" and "python ciao
data.image_path=..." usages with the venv-aware invocation used elsewhere (e.g.,
"uv run python ciao" or ensure users activate the `.venv` first), so the
commands match the Development Commands and avoid import errors when
dependencies are installed via "uv sync".
- Around line 83-116: The README project-structure fenced block that begins with
"ciao-simple/" is missing a language/info string; update the opening fence from
``` to ```text (so the block becomes ```text followed by the tree) to satisfy
markdownlint MD040 and avoid the warning; ensure only the opening fence is
changed and the rest of the block content (the tree list) remains identical.
---
Duplicate comments:
In `@pyproject.toml`:
- Line 11: The pyproject dependency list allows numpy>=1.21.0 with no upper
bound which is incompatible with torch>=2.0.0; update the numpy spec to
constrain it below 2.0 (e.g. change "numpy>=1.21.0" to "numpy>=1.21,<2.0") so
resolver won't pick NumPy 2.x until you raise torch's lower bound to >=2.2 (at
which point you can remove the upper bound). Ensure you modify the numpy entry
that sits alongside the "torch>=2.0.0" declaration.
In `@README.md`:
- Line 21: The README references the wrong directory name ("cd ciao-simple");
update all occurrences of "ciao-simple" in the README (e.g., the "cd
ciao-simple" command and any "project structure root" mentions) to the actual
cloned folder name "ciao" so commands and examples reflect cloning
https://github.com/RationAI/ciao.git, and verify the two instances flagged
(around lines shown) are corrected.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
README.mdpyproject.toml
There was a problem hiding this comment.
♻️ Duplicate comments (1)
README.md (1)
83-83: Fenced code block still missing language identifier (MD040).The project structure block continues to trigger a markdownlint MD040 warning. Add
textto suppress it.📝 Proposed fix
-``` +```text ciao/🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 83, Update the fenced code block that contains the single-line project structure entry "ciao/" so it includes a language identifier to silence MD040; change the opening fence from ``` to ```text for the block containing "ciao/" so the block becomes a ```text fenced block.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@README.md`:
- Line 83: Update the fenced code block that contains the single-line project
structure entry "ciao/" so it includes a language identifier to silence MD040;
change the opening fence from ``` to ```text for the block containing "ciao/" so
the block becomes a ```text fenced block.
Co-authored-by: Adam Kukučka <adam.kukucka4@gmail.com>
This PR initializes the basic environment for the CIAO explanation package.
What was changed:
pyproject.toml.uv.lockfile to lock dependency versions.Why:
To prepare a clean, working environment so that the core data structures and search algorithms can be introduced in subsequent PRs without CI/CD pipeline failures.
Related Task:
XAI-29
Summary by CodeRabbit
Documentation
Chores