ENH: Added display modes for show_runtime#26255
ENH: Added display modes for show_runtime#26255ganesh-k13 wants to merge 14 commits intonumpy:mainfrom
show_runtime#26255Conversation
6e3b392 to
f1d6df9
Compare
f1d6df9 to
d55c7ce
Compare
d55c7ce to
52f335a
Compare
|
@ganesh-k13 will you be continuing with this? |
|
@mattip , I'll pick it up this weekend. Got a bit busy lately. |
52f335a to
525373d
Compare
|
@ganesh-k13 it would be nice to push this over the finish line. There are merge conflicts. |
|
Thanks for looking into this. I'll get the merge conflicts resolved this week. |
180c3ea to
342e368
Compare
|
|
|
Debugging why But it's quite hard to narrow down what is actually failing. Will fix this today. [edit] Made some tweaks and got the failing fns: {'category': 'function', 'name': 'numpy.show_runtime', 'referenceCount': 1, 'isExported': True, 'isTypeKnown': False, 'isTypeAmbiguous': False, 'diagnostics': [{'file': '/Users/gakathir/Documents/os/numpy/build-install/usr/lib/python3.13/site-packages/numpy/lib/_utils_impl.pyi', 'severity': 'warning', 'message': 'No docstring found for function "numpy.show_runtime"', 'range': {'start': {'line': 586, 'character': 4}, 'end': {'line': 586, 'character': 16}}}, {'file': '/Users/gakathir/Documents/os/numpy/build-install/usr/lib/python3.13/site-packages/numpy/lib/_utils_impl.pyi', 'severity': 'error', 'message': 'Return type is partially unknown\n\xa0\xa0Return type is "dict[Unknown, Unknown] | None"\n\xa0\xa0\xa0\xa0Type argument 1 for class "dict" has unknown type\n\xa0\xa0\xa0\xa0Type argument 2 for class "dict" has unknown type', 'range': {'start': {'line': 586, 'character': 4}, 'end': {'line': 586, 'character': 16}}}]}
{'category': 'function', 'name': 'numpy.matlib.show_runtime', 'referenceCount': 1, 'isExported': True, 'isTypeKnown': False, 'isTypeAmbiguous': False, 'diagnostics': [{'file': '/Users/gakathir/Documents/os/numpy/build-install/usr/lib/python3.13/site-packages/numpy/__init__.pyi', 'severity': 'warning', 'message': 'No docstring found for function "numpy.matlib.show_runtime"', 'range': {'start': {'line': 416, 'character': 4}, 'end': {'line': 416, 'character': 16}}}, {'file': '/Users/gakathir/Documents/os/numpy/build-install/usr/lib/python3.13/site-packages/numpy/__init__.pyi', 'severity': 'error', 'message': 'Return type is partially unknown\n\xa0\xa0Return type is "dict[Unknown, Unknown] | None"\n\xa0\xa0\xa0\xa0Type argument 1 for class "dict" has unknown type\n\xa0\xa0\xa0\xa0Type argument 2 for class "dict" has unknown type', 'range': {'start': {'line': 416, 'character': 4}, 'end': {'line': 416, 'character': 16}}}]} |
3dae15b to
5a039dd
Compare
jorenham
left a comment
There was a problem hiding this comment.
The static typing changes are good now :)
requirements/test_requirements.txt
Outdated
| # for optional f2py encoding detection | ||
| charset-normalizer | ||
| tzdata | ||
| types-PyYAML No newline at end of file |
There was a problem hiding this comment.
Can we add a skip instead? I don't really like adding a new niche entry to the main test requirements file for a very minor gain.
If there's a desire to have this, we should factor out static typing dependencies.
There was a problem hiding this comment.
We need it to appease stubtest:
error: not checking stubs due to mypy build errors:
numpy/_utils/_config_helpers.py:25: error: Library stubs not installed for "yaml" [import-untyped]
numpy/_utils/_config_helpers.py:25: note: Hint: "python3 -m pip install types-PyYAML"
numpy/_utils/_config_helpers.py:25: note: (or run "mypy --install-types" to install all missing stub packages)
numpy/_utils/_config_helpers.py:25: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
https://github.com/numpy/numpy/actions/runs/21467362112/job/61832206477?pr=26255
But either way, separating the test deps from the static typing dependencies sounds like a good idea to me. We used to only have mypy, but now we also need these typeshed stubs, and the upcoming pyrefly support will add also add pyrefly to that list.
There was a problem hiding this comment.
CI is passing, no regressions on the requirements.
There was a problem hiding this comment.
The types-PyYAML addition is still present here, can you remove it from this file?
There was a problem hiding this comment.
oh my bad, I missed committing the file. I have removed mypy as well. Will wait for CI to complete.
There was a problem hiding this comment.
The CI has started to fail, I'll fix them today.
There was a problem hiding this comment.
All checks are passing now.
22000a7 to
51a1c31
Compare
Additionally created a util file for common functions between `show_config` and `show_runtime`
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
89575ab to
de22075
Compare
7d01ec7 to
6259fd1
Compare
Changes
show_runtimeAllowed modes are same as
show_config`dicts` mode
`stdout` mode (default)
ToDo
Notes
resolves: https://mail.python.org/archives/list/numpy-discussion@python.org/thread/NF7ET6O5ELCLXGEIN7P2AUO5S4MESMSK/