__config__.py 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. # This file is generated by numpy's build process
  2. # It contains system_info results at the time of building this package.
  3. from enum import Enum
  4. from numpy._core._multiarray_umath import (
  5. __cpu_features__,
  6. __cpu_baseline__,
  7. __cpu_dispatch__,
  8. )
  9. __all__ = ["show_config"]
  10. _built_with_meson = True
  11. class DisplayModes(Enum):
  12. stdout = "stdout"
  13. dicts = "dicts"
  14. def _cleanup(d):
  15. """
  16. Removes empty values in a `dict` recursively
  17. This ensures we remove values that Meson could not provide to CONFIG
  18. """
  19. if isinstance(d, dict):
  20. return {k: _cleanup(v) for k, v in d.items() if v and _cleanup(v)}
  21. else:
  22. return d
  23. CONFIG = _cleanup(
  24. {
  25. "Compilers": {
  26. "c": {
  27. "name": "msvc",
  28. "linker": r"link",
  29. "version": "19.29.30159",
  30. "commands": r"cl",
  31. "args": r"",
  32. "linker args": r"",
  33. },
  34. "cython": {
  35. "name": "cython",
  36. "linker": r"cython",
  37. "version": "3.1.0",
  38. "commands": r"cython",
  39. "args": r"",
  40. "linker args": r"",
  41. },
  42. "c++": {
  43. "name": "msvc",
  44. "linker": r"link",
  45. "version": "19.29.30159",
  46. "commands": r"cl",
  47. "args": r"",
  48. "linker args": r"",
  49. },
  50. },
  51. "Machine Information": {
  52. "host": {
  53. "cpu": "x86_64",
  54. "family": "x86_64",
  55. "endian": "little",
  56. "system": "windows",
  57. },
  58. "build": {
  59. "cpu": "x86_64",
  60. "family": "x86_64",
  61. "endian": "little",
  62. "system": "windows",
  63. },
  64. "cross-compiled": bool("False".lower().replace("false", "")),
  65. },
  66. "Build Dependencies": {
  67. "blas": {
  68. "name": "scipy-openblas",
  69. "found": bool("True".lower().replace("false", "")),
  70. "version": "0.3.29",
  71. "detection method": "pkgconfig",
  72. "include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-ll3k360g/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/include",
  73. "lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-ll3k360g/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/lib",
  74. "openblas configuration": r"OpenBLAS 0.3.29 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=24",
  75. "pc file directory": r"C:/a/numpy/numpy/.openblas",
  76. },
  77. "lapack": {
  78. "name": "scipy-openblas",
  79. "found": bool("True".lower().replace("false", "")),
  80. "version": "0.3.29",
  81. "detection method": "pkgconfig",
  82. "include directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-ll3k360g/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/include",
  83. "lib directory": r"C:/Users/runneradmin/AppData/Local/Temp/cibw-run-ll3k360g/cp312-win_amd64/build/venv/Lib/site-packages/scipy_openblas64/lib",
  84. "openblas configuration": r"OpenBLAS 0.3.29 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=24",
  85. "pc file directory": r"C:/a/numpy/numpy/.openblas",
  86. },
  87. },
  88. "Python Information": {
  89. "path": r"C:\Users\runneradmin\AppData\Local\Temp\build-env-82yfwekj\Scripts\python.exe",
  90. "version": "3.12",
  91. },
  92. "SIMD Extensions": {
  93. "baseline": __cpu_baseline__,
  94. "found": [
  95. feature for feature in __cpu_dispatch__ if __cpu_features__[feature]
  96. ],
  97. "not found": [
  98. feature for feature in __cpu_dispatch__ if not __cpu_features__[feature]
  99. ],
  100. },
  101. }
  102. )
  103. def _check_pyyaml():
  104. import yaml
  105. return yaml
  106. def show(mode=DisplayModes.stdout.value):
  107. """
  108. Show libraries and system information on which NumPy was built
  109. and is being used
  110. Parameters
  111. ----------
  112. mode : {`'stdout'`, `'dicts'`}, optional.
  113. Indicates how to display the config information.
  114. `'stdout'` prints to console, `'dicts'` returns a dictionary
  115. of the configuration.
  116. Returns
  117. -------
  118. out : {`dict`, `None`}
  119. If mode is `'dicts'`, a dict is returned, else None
  120. See Also
  121. --------
  122. get_include : Returns the directory containing NumPy C
  123. header files.
  124. Notes
  125. -----
  126. 1. The `'stdout'` mode will give more readable
  127. output if ``pyyaml`` is installed
  128. """
  129. if mode == DisplayModes.stdout.value:
  130. try: # Non-standard library, check import
  131. yaml = _check_pyyaml()
  132. print(yaml.dump(CONFIG))
  133. except ModuleNotFoundError:
  134. import warnings
  135. import json
  136. warnings.warn("Install `pyyaml` for better output", stacklevel=1)
  137. print(json.dumps(CONFIG, indent=2))
  138. elif mode == DisplayModes.dicts.value:
  139. return CONFIG
  140. else:
  141. raise AttributeError(
  142. f"Invalid `mode`, use one of: {', '.join([e.value for e in DisplayModes])}"
  143. )
  144. def show_config(mode=DisplayModes.stdout.value):
  145. return show(mode)
  146. show_config.__doc__ = show.__doc__
  147. show_config.__module__ = "numpy"