Skip to content

Conversation

@ConnorStoneAstro
Copy link
Owner

No description provided.

@ConnorStoneAstro ConnorStoneAstro requested a review from Copilot May 7, 2025 00:24
Copy link

Copilot AI left a comment

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 adds detailed type hints to several functions in the PTED module to improve code clarity and maintainability. Key changes include:

  • Introducing separate functions for numpy- and torch-based energy distance computations with type annotations.
  • Updating type hints for permutation test functions and clarifying return types.
  • Enforcing explicit type conversions for chunk parameters in the pted functions.

Reviewed Changes

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

File Description
src/pted/utils.py Added type hints and separated numpy and torch implementations.
src/pted/pted.py Updated function signatures with refined type hints and return annotations.
Comments suppressed due to low confidence (1)

src/pted/utils.py:76

  • [nitpick] Consider creating the index tensor with the appropriate device and dtype (e.g., using torch.as_tensor(idx, device=x.device)) to ensure consistency and possibly improve performance.
x_chunk = x[torch.tensor(idx)]

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c798079) to head (590e6c5).

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #2   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          175       190   +15     
=========================================
+ Hits           175       190   +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ConnorStoneAstro ConnorStoneAstro merged commit ef534cc into main May 7, 2025
12 checks passed
@ConnorStoneAstro ConnorStoneAstro deleted the cleanup branch May 7, 2025 00:43
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.

3 participants