On Mon, Apr 8, 2024 at 9:42 PM Matan Addam <ma...@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-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: ralf.gomm...@googlemail.com
>
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to