Team Ai
Datasetpublic

codekingpro/portable-devtools

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