Skip to content

Conversation

@ddkohler
Copy link
Contributor

@ddkohler ddkohler commented Feb 16, 2025

I think the original typing for channel_shape did not account for the possibility of multidimensional channels. This PR lets the tuple for shape be any length of ints.

Changes

  • NOTE: a hack is in place to let tests pass (fails detailed in python >= 3.12 (ubuntu-latest): non-graceful shutdown #84 ). A true fix is proposed in altered asyncio syntax #86
  • IsSensor channel_shape type hint is appropriate for n-dimensional data: tuple[int] -> tuple[int, ...]
  • Removed type MeasureType--I don't believe the current definition was accurate (it assumed all dict items were floats), and it is cumbersome to keep type alias definitions succinct, while adopting current type hint practices, across all supported python versions (python>=3.8).
  • bumped preferred python versions for black to 3.11, 3.12
  • increased tests to include python versions 3.8-3.12
  • refined test recipes to remove redundant testing
  • pyproject.toml: changed invalid field "project.author" to "project.authors"

TODO

  • changelog
  • adopt PEP 585 for changes (from __future__ import annotations)

@ddkohler ddkohler changed the title correct typing for IsSensor channel_shapes IsSensor type hints consistent with multidimensional data Feb 17, 2025
@ddkohler ddkohler changed the title IsSensor type hints consistent with multidimensional data IsSensor type hints allow multidimensional channels Feb 17, 2025
@ddkohler ddkohler marked this pull request as ready for review February 17, 2025 19:43
@ddkohler
Copy link
Contributor Author

Not sure why pytest freezes from 3.12, ubuntu-latest; will look into when I get the chance.

Copy link
Member

@ksunden ksunden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the primary change here, I'd tend to prefer that python version stuff be changed independently if possible (just cleaner that way)

Nothing to worry about undoing, just a preference.

That said, 3.14 is out, so may be time to go through a lot of repos and update the python version systematically. (unrelated to this change though)

@ddkohler ddkohler merged commit f4d1e56 into main Nov 6, 2025
21 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.

3 participants