Skip to content

utc time#603

Merged
gviejo merged 1 commit into
devfrom
fix-utc-time
May 15, 2026
Merged

utc time#603
gviejo merged 1 commit into
devfrom
fix-utc-time

Conversation

@gviejo

@gviejo gviejo commented May 15, 2026

Copy link
Copy Markdown
Contributor

This pull request refactors the format_timestamps and return_timestamps methods in pynapple/core/time_index.py to simplify their logic and improve clarity. The main change is to return the timestamp arrays directly for seconds without rounding, and to return immediately in each conditional branch, removing redundant code.

Refactoring and simplification:

  • format_timestamps: Now returns the input array directly when units are seconds ("s"), and only applies rounding for milliseconds ("ms") and microseconds ("us"). The function now returns immediately in each branch, eliminating unnecessary variable assignments and the final return statement.
  • return_timestamps: Similarly, now returns the input array directly for seconds, and immediately returns the appropriately converted and rounded arrays for milliseconds and microseconds. This also removes redundant code and improves readability.

@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
pynapple/core/time_index.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gviejo gviejo merged commit ac305ab into dev May 15, 2026
16 checks passed
@gviejo gviejo deleted the fix-utc-time branch May 15, 2026 16:04
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.

1 participant