Skip to content

Conversation

@alexfikl
Copy link
Collaborator

No description provided.

@alexfikl
Copy link
Collaborator Author

Some of these errors seem buggy, e.g. for Operand in hashable_kernel_args

  Type "tuple[ArithmeticExpression, ...] | int | integer[Any] | float | complex | inexact[Any, float | complex] | ExpressionNode | MultiVector[ArithmeticExpression]" is not assignable to type "Hashable"
    "inexact[Any, float | complex]" is incompatible with protocol "Hashable"

inexact seems to be hashable (at least in the sense of hash(np.float64(np.pi)) not raising an exception). I assume this is a change in numpy 2.4.0.

. ./ci-support-v0
build_py_project_in_conda_env
cipip install pytest pyfmmlib scipy scipy-stubs matplotlib optype
cipip install pytest pyfmmlib scipy scipy-stubs matplotlib 'optype<0.15'
Copy link
Owner

Choose a reason for hiding this comment

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

What's wrong with optype 0.15?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It pulls in the latest numpy-typing-compat, which pulls in numpy 2.4.0rc1, which seems to be causing all the new pyright errors on the CI:
https://github.com/inducer/pytential/actions/runs/20202177807/job/57995305672

Besides that, there's nothing wrong with it, the "bug" seems to be in some typing changes in numpy, not in optype.

Copy link
Owner

Choose a reason for hiding this comment

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

I think I would rather

  • complain to numpy about this regression
  • sweep these into the baseline
  • leave optype unbounded

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. The main reason I didn't do that to start with is because I don't have numpy 2.4.0rc1 locally and didn't know how to update the baseline :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm, actually, since numpy 2.4.0 isn't released yet, it feels a bit weird to add this to the baseline already?

Copy link
Owner

@inducer inducer Dec 15, 2025

Choose a reason for hiding this comment

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

Still no, for me:

$ pip install 'optype[numpy]'
Using Python 3.14.0 environment at: myvenv
Resolved 3 packages in 7ms
Installed 3 packages in 17ms
 + numpy==2.3.5
 + numpy-typing-compat==20251206.2.3
 + optype==0.15.0

(even with an empty uv cache)

Copy link
Owner

Choose a reason for hiding this comment

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

Curiously, that's a behavior difference between uv pip and "normal" pip. 🤦 Normal pip pulls in the RC.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm, I'm getting

Successfully installed numpy-2.4.0rc1 numpy-typing-compat-20251206.2.4 optype-0.15.0

I'm also on Python 3.13.11, if that makes any difference (seems to match the CI, if nothing else). Not quite sure why you're not getting numpy-typing-compat-20251206.2.4 too since that seems to be the latest version on PyPI?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Curiously, that's a behavior difference between uv pip and "normal" pip. 🤦 Normal pip pulls in the RC.

🤦

Copy link
Owner

Choose a reason for hiding this comment

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

Reported the hashability issue: numpy/numpy#30445

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