Skip to content

build: trim default runtime dependencies - #76

Merged
mbsantiago merged 3 commits into
mainfrom
fix/dependencies-issues
Aug 8, 2026
Merged

build: trim default runtime dependencies#76
mbsantiago merged 3 commits into
mainfrom
fix/dependencies-issues

Conversation

@mbsantiago

Copy link
Copy Markdown
Collaborator

Summary

  • Replace lightning[extra] with plain lightning
  • Remove netcdf4 and default tensorboard from runtime dependencies
  • Add direct runtime declarations for hydra-core, tabulate, and tqdm
  • Move TensorBoard support into a separate dependency group
  • Refresh uv.lock
  • Fix a few typing issues in plotting/parquet code paths

Rationale

The default install was pulling in Lightning's broad extra dependency bundle, including packages that are not required by BatDetect2's default runtime paths. This keeps the base package install leaner while preserving explicit dependencies for packages the code imports directly.

Verification

  • uv lock --check

Copilot AI lite review requested due to automatic review settings August 8, 2026 12:42

Copilot AI 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.

Pull request overview

This PR trims BatDetect2’s default runtime dependency set (notably removing Lightning’s extra bundle and moving TensorBoard to an opt-in group) while also applying small typing-related adjustments in plotting and Parquet output loading.

Changes:

  • Switch lightning[extra] to lightning and remove some default runtime dependencies; add explicit runtime deps like tqdm.
  • Add a tensorboard dependency group instead of installing TensorBoard by default.
  • Adjust plotting and Parquet code paths to resolve typing/tooling issues.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/batdetect2/plotting/heatmaps.py Uses plt.get_cmap for colormap resolution and updates imports accordingly.
src/batdetect2/plotting/detections.py Adds inline type ignores for Patch(..., linestyle=...) calls.
src/batdetect2/outputs/formats/parquet.py Adds TypedDict for clip info and annotates predictions_by_clip for improved typing.
pyproject.toml Trims default deps (Lightning extras, netcdf4, tensorboard) and adds dependency group(s) + new runtime deps.
Suppressed comments (4)

src/batdetect2/outputs/formats/parquet.py:133

  • predictions_by_clip is annotated as dict[UUID, ClipInfo], but clip_uuid is read from the DataFrame as a string and used as the dict key. This makes the type annotation incorrect and can also break if row["clip_uuid"] ever comes through as a UUID (since UUID(clip_uuid) would then raise). Convert to a UUID once and use it consistently for both the dict key and the Clip.uuid.
        predictions_by_clip: dict[UUID, ClipInfo] = {}

        for _, row in df.iterrows():
            clip_uuid = row["clip_uuid"]

            if clip_uuid not in predictions_by_clip:

src/batdetect2/plotting/detections.py:194

  • Prefer a targeted # type: ignore[...] code instead of a blanket # type: ignore to avoid silencing unrelated type errors on this line.
                    linestyle=missed_gt_linestyle,  # type: ignore

src/batdetect2/plotting/detections.py:200

  • Prefer a targeted # type: ignore[...] code instead of a blanket # type: ignore to avoid silencing unrelated type errors on this line.
                    linestyle=true_pred_linestyle,  # type: ignore

src/batdetect2/plotting/detections.py:206

  • Prefer a targeted # type: ignore[...] code instead of a blanket # type: ignore to avoid silencing unrelated type errors on this line.
                    linestyle=false_pred_linestyle,  # type: ignore

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

edgecolor=gt_color,
facecolor="none" if not fill else gt_color,
linestyle=gt_linestyle,
linestyle=gt_linestyle, # type: ignore
Comment thread pyproject.toml
Comment on lines 24 to +29
"soundevent[audio,geometry,plot]>=2.10.0",
"soundfile>=0.12.1",
"tensorboard>=2.16.2",
"tabulate>=0.10.0",
"torch>=2.0.0",
"torchaudio>=2.0.0",
"tqdm>=4.70.0",
Comment thread pyproject.toml
Comment on lines 89 to 92
"pytest-xdist[psutil]>=3.8.0",
]
tensorboard = ["tensorboard>=2.16.2"]
dvclive = ["dvclive>=3.48.2"]
@mbsantiago
mbsantiago merged commit afafccc into main Aug 8, 2026
4 checks passed
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.

2 participants