Making show_runtime and show_config enable file output
Hello, I find the information printed by the above mentioned functions to be useful for understanding performance context on installed machines, as well as variability across machines when troubleshooting. How would the maintainers view a pull request adding to those functions the option of directing their output to a file? These functions, at least as built on my machine using numpy 1.24.4, using python's print and pprint for their outputs, both of which functions allowing arguments for redirecting their output to a file. Adding this option may enable recording the information to files without redirecting all of stdout. What would your position be? Or are they actually a facade built upon installation by dynamically generated code, which yields different function implementations on different platforms? It could be otherwise nice to provide access to a dict of the data for the more general purpose, which would enable all desiderata of interest leveraging this information. Kind regards, Matan
On 09/04/2024 2:42, Matan Addam wrote:
Hello,
I find the information printed by the above mentioned functions to be useful for understanding performance context on installed machines, as well as variability across machines when troubleshooting. How would the maintainers view a pull request adding to those functions the option of directing their output to a file?
These functions, at least as built on my machine using numpy 1.24.4, using python's print and pprint for their outputs, both of which functions allowing arguments for redirecting their output to a file. Adding this option may enable recording the information to files without redirecting all of stdout.
What would your position be?
Or are they actually a facade built upon installation by dynamically generated code, which yields different function implementations on different platforms?
It could be otherwise nice to provide access to a dict of the data for the more general purpose, which would enable all desiderata of interest leveraging this information.
Kind regards, Matan
Makes sense to me to output a json-formatted file Matti
On Mon, Apr 8, 2024 at 9:42 PM Matan Addam <matan@nui.ai> wrote:
Hello,
I find the information printed by the above mentioned functions to be useful for understanding performance context on installed machines, as well as variability across machines when troubleshooting. How would the maintainers view a pull request adding to those functions the option of directing their output to a file?
These functions, at least as built on my machine using numpy 1.24.4, using python's print and pprint for their outputs, both of which functions allowing arguments for redirecting their output to a file. Adding this option may enable recording the information to files without redirecting all of stdout.
`show_config` has a `mode` keyword that you can use to get back a dictionary instead of printing to stdout. So from there it should be quite straightforward to write the data in the returned dictionary in JSON or whatever format you prefer. `show_runtime` doesn't have the same keyword yet. Adding that should address your issue though, in a way that's probably better than adding file writing to these functions. Maybe open a PR for that instead? Cheers, Ralf
What would your position be?
Or are they actually a facade built upon installation by dynamically generated code, which yields different function implementations on different platforms?
It could be otherwise nice to provide access to a dict of the data for the more general purpose, which would enable all desiderata of interest leveraging this information.
Kind regards, Matan _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: ralf.gommers@googlemail.com
Thanks for the input, I have raised a PR: https://github.com/numpy/numpy/pull/26255. I'll address the UT issues soon. Let me know if this is what was required. Thanks, Ganesh
On Wed, Apr 10, 2024 at 4:18 PM Ganesh Kathiresan <ganesh3597@gmail.com> wrote:
Thanks for the input, I have raised a PR: https://github.com/numpy/numpy/pull/26255. I'll address the UT issues soon. Let me know if this is what was required.
Thanks Ganesh!
participants (4)
-
Ganesh Kathiresan
-
Matan Addam
-
Matti Picus
-
Ralf Gommers