Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +1 -0
- .venv/Lib/site-packages/scipy-1.13.1.dist-info/DELVEWHEEL +2 -0
- .venv/Lib/site-packages/scipy-1.13.1.dist-info/INSTALLER +1 -0
- .venv/Lib/site-packages/scipy-1.13.1.dist-info/LICENSE.txt +934 -0
- .venv/Lib/site-packages/scipy-1.13.1.dist-info/METADATA +1075 -0
- .venv/Lib/site-packages/scipy-1.13.1.dist-info/RECORD +0 -0
- .venv/Lib/site-packages/scipy-1.13.1.dist-info/REQUESTED +0 -0
- .venv/Lib/site-packages/scipy-1.13.1.dist-info/WHEEL +4 -0
- .venv/Lib/site-packages/scipy.libs/.load-order-scipy-1.13.1 +1 -0
- .venv/Lib/site-packages/scipy/__pycache__/__config__.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/__pycache__/__init__.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/__pycache__/_distributor_init.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/__pycache__/version.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/__init__.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_array_api.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_bunch.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_ccallback.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_docscrape.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_finite_differences.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_pep440.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_testutils.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_threadsafety.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/_util.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/decorator.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/deprecation.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/doccer.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/__pycache__/uarray.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/_uarray/LICENSE +29 -0
- .venv/Lib/site-packages/scipy/_lib/_uarray/__init__.py +116 -0
- .venv/Lib/site-packages/scipy/_lib/_uarray/__pycache__/__init__.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/_uarray/__pycache__/_backend.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/_uarray/_backend.py +704 -0
- .venv/Lib/site-packages/scipy/_lib/_uarray/_uarray.cp39-win_amd64.dll.a +0 -0
- .venv/Lib/site-packages/scipy/_lib/_uarray/_uarray.cp39-win_amd64.pyd +0 -0
- .venv/Lib/site-packages/scipy/_lib/array_api_compat/cupy/__init__.py +16 -0
- .venv/Lib/site-packages/scipy/_lib/array_api_compat/cupy/_typing.py +46 -0
- .venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/__init__.py +22 -0
- .venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/__pycache__/linalg.cpython-39.pyc +0 -0
- .venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/_aliases.py +79 -0
- .venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/_typing.py +46 -0
- .venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/linalg.py +40 -0
- .venv/Lib/site-packages/scipy/_lib/tests/__init__.py +0 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test__gcutils.py +101 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test__pep440.py +67 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test__testutils.py +32 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test__threadsafety.py +51 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test__util.py +408 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test_deprecation.py +10 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test_import_cycles.py +14 -0
- .venv/Lib/site-packages/scipy/_lib/tests/test_public_api.py +491 -0
.gitattributes
CHANGED
|
@@ -99,3 +99,4 @@ reference_sample_wavs/syuukovoice_200918_3_01.wav filter=lfs diff=lfs merge=lfs
|
|
| 99 |
.venv/Lib/site-packages/scipy/special/_ufuncs.cp39-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
|
| 100 |
.venv/Lib/site-packages/scipy/spatial/_ckdtree.cp39-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
|
| 101 |
.venv/Lib/site-packages/scipy/spatial/_qhull.cp39-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 99 |
.venv/Lib/site-packages/scipy/special/_ufuncs.cp39-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
|
| 100 |
.venv/Lib/site-packages/scipy/spatial/_ckdtree.cp39-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
|
| 101 |
.venv/Lib/site-packages/scipy/spatial/_qhull.cp39-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
|
| 102 |
+
.venv/Lib/site-packages/scipy/special/_ufuncs_cxx.cp39-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
|
.venv/Lib/site-packages/scipy-1.13.1.dist-info/DELVEWHEEL
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Version: 1.6.0
|
| 2 |
+
Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-622t44xc\\cp39-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '--add-path', 'C:/opt/openblas/openblas_dll', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-622t44xc\\cp39-win_amd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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
|
| 2 |
+
All rights reserved.
|
| 3 |
+
|
| 4 |
+
Redistribution and use in source and binary forms, with or without
|
| 5 |
+
modification, are permitted provided that the following conditions
|
| 6 |
+
are met:
|
| 7 |
+
|
| 8 |
+
1. Redistributions of source code must retain the above copyright
|
| 9 |
+
notice, this list of conditions and the following disclaimer.
|
| 10 |
+
|
| 11 |
+
2. Redistributions in binary form must reproduce the above
|
| 12 |
+
copyright notice, this list of conditions and the following
|
| 13 |
+
disclaimer in the documentation and/or other materials provided
|
| 14 |
+
with the distribution.
|
| 15 |
+
|
| 16 |
+
3. Neither the name of the copyright holder nor the names of its
|
| 17 |
+
contributors may be used to endorse or promote products derived
|
| 18 |
+
from this software without specific prior written permission.
|
| 19 |
+
|
| 20 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 21 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 22 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 23 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 24 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 25 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 26 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 27 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 28 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 29 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 30 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 31 |
+
|
| 32 |
+
----
|
| 33 |
+
|
| 34 |
+
This binary distribution of SciPy also bundles the following software:
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
Name: OpenBLAS
|
| 38 |
+
Files: scipy.libs\libopenblas*.dll
|
| 39 |
+
Description: bundled as a dynamically linked library
|
| 40 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 41 |
+
License: BSD-3-Clause-Attribution
|
| 42 |
+
Copyright (c) 2011-2014, The OpenBLAS Project
|
| 43 |
+
All rights reserved.
|
| 44 |
+
|
| 45 |
+
Redistribution and use in source and binary forms, with or without
|
| 46 |
+
modification, are permitted provided that the following conditions are
|
| 47 |
+
met:
|
| 48 |
+
|
| 49 |
+
1. Redistributions of source code must retain the above copyright
|
| 50 |
+
notice, this list of conditions and the following disclaimer.
|
| 51 |
+
|
| 52 |
+
2. Redistributions in binary form must reproduce the above copyright
|
| 53 |
+
notice, this list of conditions and the following disclaimer in
|
| 54 |
+
the documentation and/or other materials provided with the
|
| 55 |
+
distribution.
|
| 56 |
+
3. Neither the name of the OpenBLAS project nor the names of
|
| 57 |
+
its contributors may be used to endorse or promote products
|
| 58 |
+
derived from this software without specific prior written
|
| 59 |
+
permission.
|
| 60 |
+
|
| 61 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 62 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 63 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 64 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
| 65 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 66 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 67 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 68 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 69 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
| 70 |
+
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
Name: LAPACK
|
| 74 |
+
Files: scipy.libs\libopenblas*.dll
|
| 75 |
+
Description: bundled in OpenBLAS
|
| 76 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 77 |
+
License: BSD-3-Clause-Attribution
|
| 78 |
+
Copyright (c) 1992-2013 The University of Tennessee and The University
|
| 79 |
+
of Tennessee Research Foundation. All rights
|
| 80 |
+
reserved.
|
| 81 |
+
Copyright (c) 2000-2013 The University of California Berkeley. All
|
| 82 |
+
rights reserved.
|
| 83 |
+
Copyright (c) 2006-2013 The University of Colorado Denver. All rights
|
| 84 |
+
reserved.
|
| 85 |
+
|
| 86 |
+
$COPYRIGHT$
|
| 87 |
+
|
| 88 |
+
Additional copyrights may follow
|
| 89 |
+
|
| 90 |
+
$HEADER$
|
| 91 |
+
|
| 92 |
+
Redistribution and use in source and binary forms, with or without
|
| 93 |
+
modification, are permitted provided that the following conditions are
|
| 94 |
+
met:
|
| 95 |
+
|
| 96 |
+
- Redistributions of source code must retain the above copyright
|
| 97 |
+
notice, this list of conditions and the following disclaimer.
|
| 98 |
+
|
| 99 |
+
- Redistributions in binary form must reproduce the above copyright
|
| 100 |
+
notice, this list of conditions and the following disclaimer listed
|
| 101 |
+
in this license in the documentation and/or other materials
|
| 102 |
+
provided with the distribution.
|
| 103 |
+
|
| 104 |
+
- Neither the name of the copyright holders nor the names of its
|
| 105 |
+
contributors may be used to endorse or promote products derived from
|
| 106 |
+
this software without specific prior written permission.
|
| 107 |
+
|
| 108 |
+
The copyright holders provide no reassurances that the source code
|
| 109 |
+
provided does not infringe any patent, copyright, or any other
|
| 110 |
+
intellectual property rights of third parties. The copyright holders
|
| 111 |
+
disclaim any liability to any recipient for claims brought against
|
| 112 |
+
recipient by any third party for infringement of that parties
|
| 113 |
+
intellectual property rights.
|
| 114 |
+
|
| 115 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 116 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 117 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 118 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 119 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 120 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 121 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 122 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 123 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 124 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 125 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
Name: GCC runtime library
|
| 129 |
+
Files: scipy.libs\libopenblas*.dll
|
| 130 |
+
Description: statically linked to files compiled with gcc
|
| 131 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran
|
| 132 |
+
License: GPL-3.0-with-GCC-exception
|
| 133 |
+
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
| 134 |
+
|
| 135 |
+
Libgfortran is free software; you can redistribute it and/or modify
|
| 136 |
+
it under the terms of the GNU General Public License as published by
|
| 137 |
+
the Free Software Foundation; either version 3, or (at your option)
|
| 138 |
+
any later version.
|
| 139 |
+
|
| 140 |
+
Libgfortran is distributed in the hope that it will be useful,
|
| 141 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 142 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 143 |
+
GNU General Public License for more details.
|
| 144 |
+
|
| 145 |
+
Under Section 7 of GPL version 3, you are granted additional
|
| 146 |
+
permissions described in the GCC Runtime Library Exception, version
|
| 147 |
+
3.1, as published by the Free Software Foundation.
|
| 148 |
+
|
| 149 |
+
You should have received a copy of the GNU General Public License and
|
| 150 |
+
a copy of the GCC Runtime Library Exception along with this program;
|
| 151 |
+
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
| 152 |
+
<http://www.gnu.org/licenses/>.
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
----
|
| 156 |
+
|
| 157 |
+
Full text of license texts referred to above follows (that they are
|
| 158 |
+
listed below does not necessarily imply the conditions apply to the
|
| 159 |
+
present binary release):
|
| 160 |
+
|
| 161 |
+
----
|
| 162 |
+
|
| 163 |
+
GCC RUNTIME LIBRARY EXCEPTION
|
| 164 |
+
|
| 165 |
+
Version 3.1, 31 March 2009
|
| 166 |
+
|
| 167 |
+
Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/>
|
| 168 |
+
|
| 169 |
+
Everyone is permitted to copy and distribute verbatim copies of this
|
| 170 |
+
license document, but changing it is not allowed.
|
| 171 |
+
|
| 172 |
+
This GCC Runtime Library Exception ("Exception") is an additional
|
| 173 |
+
permission under section 7 of the GNU General Public License, version
|
| 174 |
+
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
|
| 175 |
+
bears a notice placed by the copyright holder of the file stating that
|
| 176 |
+
the file is governed by GPLv3 along with this Exception.
|
| 177 |
+
|
| 178 |
+
When you use GCC to compile a program, GCC may combine portions of
|
| 179 |
+
certain GCC header files and runtime libraries with the compiled
|
| 180 |
+
program. The purpose of this Exception is to allow compilation of
|
| 181 |
+
non-GPL (including proprietary) programs to use, in this way, the
|
| 182 |
+
header files and runtime libraries covered by this Exception.
|
| 183 |
+
|
| 184 |
+
0. Definitions.
|
| 185 |
+
|
| 186 |
+
A file is an "Independent Module" if it either requires the Runtime
|
| 187 |
+
Library for execution after a Compilation Process, or makes use of an
|
| 188 |
+
interface provided by the Runtime Library, but is not otherwise based
|
| 189 |
+
on the Runtime Library.
|
| 190 |
+
|
| 191 |
+
"GCC" means a version of the GNU Compiler Collection, with or without
|
| 192 |
+
modifications, governed by version 3 (or a specified later version) of
|
| 193 |
+
the GNU General Public License (GPL) with the option of using any
|
| 194 |
+
subsequent versions published by the FSF.
|
| 195 |
+
|
| 196 |
+
"GPL-compatible Software" is software whose conditions of propagation,
|
| 197 |
+
modification and use would permit combination with GCC in accord with
|
| 198 |
+
the license of GCC.
|
| 199 |
+
|
| 200 |
+
"Target Code" refers to output from any compiler for a real or virtual
|
| 201 |
+
target processor architecture, in executable form or suitable for
|
| 202 |
+
input to an assembler, loader, linker and/or execution
|
| 203 |
+
phase. Notwithstanding that, Target Code does not include data in any
|
| 204 |
+
format that is used as a compiler intermediate representation, or used
|
| 205 |
+
for producing a compiler intermediate representation.
|
| 206 |
+
|
| 207 |
+
The "Compilation Process" transforms code entirely represented in
|
| 208 |
+
non-intermediate languages designed for human-written code, and/or in
|
| 209 |
+
Java Virtual Machine byte code, into Target Code. Thus, for example,
|
| 210 |
+
use of source code generators and preprocessors need not be considered
|
| 211 |
+
part of the Compilation Process, since the Compilation Process can be
|
| 212 |
+
understood as starting with the output of the generators or
|
| 213 |
+
preprocessors.
|
| 214 |
+
|
| 215 |
+
A Compilation Process is "Eligible" if it is done using GCC, alone or
|
| 216 |
+
with other GPL-compatible software, or if it is done without using any
|
| 217 |
+
work based on GCC. For example, using non-GPL-compatible Software to
|
| 218 |
+
optimize any GCC intermediate representations would not qualify as an
|
| 219 |
+
Eligible Compilation Process.
|
| 220 |
+
|
| 221 |
+
1. Grant of Additional Permission.
|
| 222 |
+
|
| 223 |
+
You have permission to propagate a work of Target Code formed by
|
| 224 |
+
combining the Runtime Library with Independent Modules, even if such
|
| 225 |
+
propagation would otherwise violate the terms of GPLv3, provided that
|
| 226 |
+
all Target Code was generated by Eligible Compilation Processes. You
|
| 227 |
+
may then convey such a combination under terms of your choice,
|
| 228 |
+
consistent with the licensing of the Independent Modules.
|
| 229 |
+
|
| 230 |
+
2. No Weakening of GCC Copyleft.
|
| 231 |
+
|
| 232 |
+
The availability of this Exception does not imply any general
|
| 233 |
+
presumption that third-party software is unaffected by the copyleft
|
| 234 |
+
requirements of the license of GCC.
|
| 235 |
+
|
| 236 |
+
----
|
| 237 |
+
|
| 238 |
+
GNU GENERAL PUBLIC LICENSE
|
| 239 |
+
Version 3, 29 June 2007
|
| 240 |
+
|
| 241 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
| 242 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 243 |
+
of this license document, but changing it is not allowed.
|
| 244 |
+
|
| 245 |
+
Preamble
|
| 246 |
+
|
| 247 |
+
The GNU General Public License is a free, copyleft license for
|
| 248 |
+
software and other kinds of works.
|
| 249 |
+
|
| 250 |
+
The licenses for most software and other practical works are designed
|
| 251 |
+
to take away your freedom to share and change the works. By contrast,
|
| 252 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 253 |
+
share and change all versions of a program--to make sure it remains free
|
| 254 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 255 |
+
GNU General Public License for most of our software; it applies also to
|
| 256 |
+
any other work released this way by its authors. You can apply it to
|
| 257 |
+
your programs, too.
|
| 258 |
+
|
| 259 |
+
When we speak of free software, we are referring to freedom, not
|
| 260 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 261 |
+
have the freedom to distribute copies of free software (and charge for
|
| 262 |
+
them if you wish), that you receive source code or can get it if you
|
| 263 |
+
want it, that you can change the software or use pieces of it in new
|
| 264 |
+
free programs, and that you know you can do these things.
|
| 265 |
+
|
| 266 |
+
To protect your rights, we need to prevent others from denying you
|
| 267 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 268 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 269 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 270 |
+
|
| 271 |
+
For example, if you distribute copies of such a program, whether
|
| 272 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 273 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 274 |
+
or can get the source code. And you must show them these terms so they
|
| 275 |
+
know their rights.
|
| 276 |
+
|
| 277 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 278 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 279 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 280 |
+
|
| 281 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 282 |
+
that there is no warranty for this free software. For both users' and
|
| 283 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 284 |
+
changed, so that their problems will not be attributed erroneously to
|
| 285 |
+
authors of previous versions.
|
| 286 |
+
|
| 287 |
+
Some devices are designed to deny users access to install or run
|
| 288 |
+
modified versions of the software inside them, although the manufacturer
|
| 289 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 290 |
+
protecting users' freedom to change the software. The systematic
|
| 291 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 292 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 293 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 294 |
+
products. If such problems arise substantially in other domains, we
|
| 295 |
+
stand ready to extend this provision to those domains in future versions
|
| 296 |
+
of the GPL, as needed to protect the freedom of users.
|
| 297 |
+
|
| 298 |
+
Finally, every program is threatened constantly by software patents.
|
| 299 |
+
States should not allow patents to restrict development and use of
|
| 300 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 301 |
+
avoid the special danger that patents applied to a free program could
|
| 302 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 303 |
+
patents cannot be used to render the program non-free.
|
| 304 |
+
|
| 305 |
+
The precise terms and conditions for copying, distribution and
|
| 306 |
+
modification follow.
|
| 307 |
+
|
| 308 |
+
TERMS AND CONDITIONS
|
| 309 |
+
|
| 310 |
+
0. Definitions.
|
| 311 |
+
|
| 312 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 313 |
+
|
| 314 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 315 |
+
works, such as semiconductor masks.
|
| 316 |
+
|
| 317 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 318 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 319 |
+
"recipients" may be individuals or organizations.
|
| 320 |
+
|
| 321 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 322 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 323 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 324 |
+
earlier work or a work "based on" the earlier work.
|
| 325 |
+
|
| 326 |
+
A "covered work" means either the unmodified Program or a work based
|
| 327 |
+
on the Program.
|
| 328 |
+
|
| 329 |
+
To "propagate" a work means to do anything with it that, without
|
| 330 |
+
permission, would make you directly or secondarily liable for
|
| 331 |
+
infringement under applicable copyright law, except executing it on a
|
| 332 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 333 |
+
distribution (with or without modification), making available to the
|
| 334 |
+
public, and in some countries other activities as well.
|
| 335 |
+
|
| 336 |
+
To "convey" a work means any kind of propagation that enables other
|
| 337 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 338 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 339 |
+
|
| 340 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 341 |
+
to the extent that it includes a convenient and prominently visible
|
| 342 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 343 |
+
tells the user that there is no warranty for the work (except to the
|
| 344 |
+
extent that warranties are provided), that licensees may convey the
|
| 345 |
+
work under this License, and how to view a copy of this License. If
|
| 346 |
+
the interface presents a list of user commands or options, such as a
|
| 347 |
+
menu, a prominent item in the list meets this criterion.
|
| 348 |
+
|
| 349 |
+
1. Source Code.
|
| 350 |
+
|
| 351 |
+
The "source code" for a work means the preferred form of the work
|
| 352 |
+
for making modifications to it. "Object code" means any non-source
|
| 353 |
+
form of a work.
|
| 354 |
+
|
| 355 |
+
A "Standard Interface" means an interface that either is an official
|
| 356 |
+
standard defined by a recognized standards body, or, in the case of
|
| 357 |
+
interfaces specified for a particular programming language, one that
|
| 358 |
+
is widely used among developers working in that language.
|
| 359 |
+
|
| 360 |
+
The "System Libraries" of an executable work include anything, other
|
| 361 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 362 |
+
packaging a Major Component, but which is not part of that Major
|
| 363 |
+
Component, and (b) serves only to enable use of the work with that
|
| 364 |
+
Major Component, or to implement a Standard Interface for which an
|
| 365 |
+
implementation is available to the public in source code form. A
|
| 366 |
+
"Major Component", in this context, means a major essential component
|
| 367 |
+
(kernel, window system, and so on) of the specific operating system
|
| 368 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 369 |
+
produce the work, or an object code interpreter used to run it.
|
| 370 |
+
|
| 371 |
+
The "Corresponding Source" for a work in object code form means all
|
| 372 |
+
the source code needed to generate, install, and (for an executable
|
| 373 |
+
work) run the object code and to modify the work, including scripts to
|
| 374 |
+
control those activities. However, it does not include the work's
|
| 375 |
+
System Libraries, or general-purpose tools or generally available free
|
| 376 |
+
programs which are used unmodified in performing those activities but
|
| 377 |
+
which are not part of the work. For example, Corresponding Source
|
| 378 |
+
includes interface definition files associated with source files for
|
| 379 |
+
the work, and the source code for shared libraries and dynamically
|
| 380 |
+
linked subprograms that the work is specifically designed to require,
|
| 381 |
+
such as by intimate data communication or control flow between those
|
| 382 |
+
subprograms and other parts of the work.
|
| 383 |
+
|
| 384 |
+
The Corresponding Source need not include anything that users
|
| 385 |
+
can regenerate automatically from other parts of the Corresponding
|
| 386 |
+
Source.
|
| 387 |
+
|
| 388 |
+
The Corresponding Source for a work in source code form is that
|
| 389 |
+
same work.
|
| 390 |
+
|
| 391 |
+
2. Basic Permissions.
|
| 392 |
+
|
| 393 |
+
All rights granted under this License are granted for the term of
|
| 394 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 395 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 396 |
+
permission to run the unmodified Program. The output from running a
|
| 397 |
+
covered work is covered by this License only if the output, given its
|
| 398 |
+
content, constitutes a covered work. This License acknowledges your
|
| 399 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 400 |
+
|
| 401 |
+
You may make, run and propagate covered works that you do not
|
| 402 |
+
convey, without conditions so long as your license otherwise remains
|
| 403 |
+
in force. You may convey covered works to others for the sole purpose
|
| 404 |
+
of having them make modifications exclusively for you, or provide you
|
| 405 |
+
with facilities for running those works, provided that you comply with
|
| 406 |
+
the terms of this License in conveying all material for which you do
|
| 407 |
+
not control copyright. Those thus making or running the covered works
|
| 408 |
+
for you must do so exclusively on your behalf, under your direction
|
| 409 |
+
and control, on terms that prohibit them from making any copies of
|
| 410 |
+
your copyrighted material outside their relationship with you.
|
| 411 |
+
|
| 412 |
+
Conveying under any other circumstances is permitted solely under
|
| 413 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 414 |
+
makes it unnecessary.
|
| 415 |
+
|
| 416 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 417 |
+
|
| 418 |
+
No covered work shall be deemed part of an effective technological
|
| 419 |
+
measure under any applicable law fulfilling obligations under article
|
| 420 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 421 |
+
similar laws prohibiting or restricting circumvention of such
|
| 422 |
+
measures.
|
| 423 |
+
|
| 424 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 425 |
+
circumvention of technological measures to the extent such circumvention
|
| 426 |
+
is effected by exercising rights under this License with respect to
|
| 427 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 428 |
+
modification of the work as a means of enforcing, against the work's
|
| 429 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 430 |
+
technological measures.
|
| 431 |
+
|
| 432 |
+
4. Conveying Verbatim Copies.
|
| 433 |
+
|
| 434 |
+
You may convey verbatim copies of the Program's source code as you
|
| 435 |
+
receive it, in any medium, provided that you conspicuously and
|
| 436 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 437 |
+
keep intact all notices stating that this License and any
|
| 438 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 439 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 440 |
+
recipients a copy of this License along with the Program.
|
| 441 |
+
|
| 442 |
+
You may charge any price or no price for each copy that you convey,
|
| 443 |
+
and you may offer support or warranty protection for a fee.
|
| 444 |
+
|
| 445 |
+
5. Conveying Modified Source Versions.
|
| 446 |
+
|
| 447 |
+
You may convey a work based on the Program, or the modifications to
|
| 448 |
+
produce it from the Program, in the form of source code under the
|
| 449 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 450 |
+
|
| 451 |
+
a) The work must carry prominent notices stating that you modified
|
| 452 |
+
it, and giving a relevant date.
|
| 453 |
+
|
| 454 |
+
b) The work must carry prominent notices stating that it is
|
| 455 |
+
released under this License and any conditions added under section
|
| 456 |
+
7. This requirement modifies the requirement in section 4 to
|
| 457 |
+
"keep intact all notices".
|
| 458 |
+
|
| 459 |
+
c) You must license the entire work, as a whole, under this
|
| 460 |
+
License to anyone who comes into possession of a copy. This
|
| 461 |
+
License will therefore apply, along with any applicable section 7
|
| 462 |
+
additional terms, to the whole of the work, and all its parts,
|
| 463 |
+
regardless of how they are packaged. This License gives no
|
| 464 |
+
permission to license the work in any other way, but it does not
|
| 465 |
+
invalidate such permission if you have separately received it.
|
| 466 |
+
|
| 467 |
+
d) If the work has interactive user interfaces, each must display
|
| 468 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 469 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 470 |
+
work need not make them do so.
|
| 471 |
+
|
| 472 |
+
A compilation of a covered work with other separate and independent
|
| 473 |
+
works, which are not by their nature extensions of the covered work,
|
| 474 |
+
and which are not combined with it such as to form a larger program,
|
| 475 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 476 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 477 |
+
used to limit the access or legal rights of the compilation's users
|
| 478 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 479 |
+
in an aggregate does not cause this License to apply to the other
|
| 480 |
+
parts of the aggregate.
|
| 481 |
+
|
| 482 |
+
6. Conveying Non-Source Forms.
|
| 483 |
+
|
| 484 |
+
You may convey a covered work in object code form under the terms
|
| 485 |
+
of sections 4 and 5, provided that you also convey the
|
| 486 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 487 |
+
in one of these ways:
|
| 488 |
+
|
| 489 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 490 |
+
(including a physical distribution medium), accompanied by the
|
| 491 |
+
Corresponding Source fixed on a durable physical medium
|
| 492 |
+
customarily used for software interchange.
|
| 493 |
+
|
| 494 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 495 |
+
(including a physical distribution medium), accompanied by a
|
| 496 |
+
written offer, valid for at least three years and valid for as
|
| 497 |
+
long as you offer spare parts or customer support for that product
|
| 498 |
+
model, to give anyone who possesses the object code either (1) a
|
| 499 |
+
copy of the Corresponding Source for all the software in the
|
| 500 |
+
product that is covered by this License, on a durable physical
|
| 501 |
+
medium customarily used for software interchange, for a price no
|
| 502 |
+
more than your reasonable cost of physically performing this
|
| 503 |
+
conveying of source, or (2) access to copy the
|
| 504 |
+
Corresponding Source from a network server at no charge.
|
| 505 |
+
|
| 506 |
+
c) Convey individual copies of the object code with a copy of the
|
| 507 |
+
written offer to provide the Corresponding Source. This
|
| 508 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 509 |
+
only if you received the object code with such an offer, in accord
|
| 510 |
+
with subsection 6b.
|
| 511 |
+
|
| 512 |
+
d) Convey the object code by offering access from a designated
|
| 513 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 514 |
+
Corresponding Source in the same way through the same place at no
|
| 515 |
+
further charge. You need not require recipients to copy the
|
| 516 |
+
Corresponding Source along with the object code. If the place to
|
| 517 |
+
copy the object code is a network server, the Corresponding Source
|
| 518 |
+
may be on a different server (operated by you or a third party)
|
| 519 |
+
that supports equivalent copying facilities, provided you maintain
|
| 520 |
+
clear directions next to the object code saying where to find the
|
| 521 |
+
Corresponding Source. Regardless of what server hosts the
|
| 522 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 523 |
+
available for as long as needed to satisfy these requirements.
|
| 524 |
+
|
| 525 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 526 |
+
you inform other peers where the object code and Corresponding
|
| 527 |
+
Source of the work are being offered to the general public at no
|
| 528 |
+
charge under subsection 6d.
|
| 529 |
+
|
| 530 |
+
A separable portion of the object code, whose source code is excluded
|
| 531 |
+
from the Corresponding Source as a System Library, need not be
|
| 532 |
+
included in conveying the object code work.
|
| 533 |
+
|
| 534 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 535 |
+
tangible personal property which is normally used for personal, family,
|
| 536 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 537 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 538 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 539 |
+
product received by a particular user, "normally used" refers to a
|
| 540 |
+
typical or common use of that class of product, regardless of the status
|
| 541 |
+
of the particular user or of the way in which the particular user
|
| 542 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 543 |
+
is a consumer product regardless of whether the product has substantial
|
| 544 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 545 |
+
the only significant mode of use of the product.
|
| 546 |
+
|
| 547 |
+
"Installation Information" for a User Product means any methods,
|
| 548 |
+
procedures, authorization keys, or other information required to install
|
| 549 |
+
and execute modified versions of a covered work in that User Product from
|
| 550 |
+
a modified version of its Corresponding Source. The information must
|
| 551 |
+
suffice to ensure that the continued functioning of the modified object
|
| 552 |
+
code is in no case prevented or interfered with solely because
|
| 553 |
+
modification has been made.
|
| 554 |
+
|
| 555 |
+
If you convey an object code work under this section in, or with, or
|
| 556 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 557 |
+
part of a transaction in which the right of possession and use of the
|
| 558 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 559 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 560 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 561 |
+
by the Installation Information. But this requirement does not apply
|
| 562 |
+
if neither you nor any third party retains the ability to install
|
| 563 |
+
modified object code on the User Product (for example, the work has
|
| 564 |
+
been installed in ROM).
|
| 565 |
+
|
| 566 |
+
The requirement to provide Installation Information does not include a
|
| 567 |
+
requirement to continue to provide support service, warranty, or updates
|
| 568 |
+
for a work that has been modified or installed by the recipient, or for
|
| 569 |
+
the User Product in which it has been modified or installed. Access to a
|
| 570 |
+
network may be denied when the modification itself materially and
|
| 571 |
+
adversely affects the operation of the network or violates the rules and
|
| 572 |
+
protocols for communication across the network.
|
| 573 |
+
|
| 574 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 575 |
+
in accord with this section must be in a format that is publicly
|
| 576 |
+
documented (and with an implementation available to the public in
|
| 577 |
+
source code form), and must require no special password or key for
|
| 578 |
+
unpacking, reading or copying.
|
| 579 |
+
|
| 580 |
+
7. Additional Terms.
|
| 581 |
+
|
| 582 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 583 |
+
License by making exceptions from one or more of its conditions.
|
| 584 |
+
Additional permissions that are applicable to the entire Program shall
|
| 585 |
+
be treated as though they were included in this License, to the extent
|
| 586 |
+
that they are valid under applicable law. If additional permissions
|
| 587 |
+
apply only to part of the Program, that part may be used separately
|
| 588 |
+
under those permissions, but the entire Program remains governed by
|
| 589 |
+
this License without regard to the additional permissions.
|
| 590 |
+
|
| 591 |
+
When you convey a copy of a covered work, you may at your option
|
| 592 |
+
remove any additional permissions from that copy, or from any part of
|
| 593 |
+
it. (Additional permissions may be written to require their own
|
| 594 |
+
removal in certain cases when you modify the work.) You may place
|
| 595 |
+
additional permissions on material, added by you to a covered work,
|
| 596 |
+
for which you have or can give appropriate copyright permission.
|
| 597 |
+
|
| 598 |
+
Notwithstanding any other provision of this License, for material you
|
| 599 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 600 |
+
that material) supplement the terms of this License with terms:
|
| 601 |
+
|
| 602 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 603 |
+
terms of sections 15 and 16 of this License; or
|
| 604 |
+
|
| 605 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 606 |
+
author attributions in that material or in the Appropriate Legal
|
| 607 |
+
Notices displayed by works containing it; or
|
| 608 |
+
|
| 609 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 610 |
+
requiring that modified versions of such material be marked in
|
| 611 |
+
reasonable ways as different from the original version; or
|
| 612 |
+
|
| 613 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 614 |
+
authors of the material; or
|
| 615 |
+
|
| 616 |
+
e) Declining to grant rights under trademark law for use of some
|
| 617 |
+
trade names, trademarks, or service marks; or
|
| 618 |
+
|
| 619 |
+
f) Requiring indemnification of licensors and authors of that
|
| 620 |
+
material by anyone who conveys the material (or modified versions of
|
| 621 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 622 |
+
any liability that these contractual assumptions directly impose on
|
| 623 |
+
those licensors and authors.
|
| 624 |
+
|
| 625 |
+
All other non-permissive additional terms are considered "further
|
| 626 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 627 |
+
received it, or any part of it, contains a notice stating that it is
|
| 628 |
+
governed by this License along with a term that is a further
|
| 629 |
+
restriction, you may remove that term. If a license document contains
|
| 630 |
+
a further restriction but permits relicensing or conveying under this
|
| 631 |
+
License, you may add to a covered work material governed by the terms
|
| 632 |
+
of that license document, provided that the further restriction does
|
| 633 |
+
not survive such relicensing or conveying.
|
| 634 |
+
|
| 635 |
+
If you add terms to a covered work in accord with this section, you
|
| 636 |
+
must place, in the relevant source files, a statement of the
|
| 637 |
+
additional terms that apply to those files, or a notice indicating
|
| 638 |
+
where to find the applicable terms.
|
| 639 |
+
|
| 640 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 641 |
+
form of a separately written license, or stated as exceptions;
|
| 642 |
+
the above requirements apply either way.
|
| 643 |
+
|
| 644 |
+
8. Termination.
|
| 645 |
+
|
| 646 |
+
You may not propagate or modify a covered work except as expressly
|
| 647 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 648 |
+
modify it is void, and will automatically terminate your rights under
|
| 649 |
+
this License (including any patent licenses granted under the third
|
| 650 |
+
paragraph of section 11).
|
| 651 |
+
|
| 652 |
+
However, if you cease all violation of this License, then your
|
| 653 |
+
license from a particular copyright holder is reinstated (a)
|
| 654 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 655 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 656 |
+
holder fails to notify you of the violation by some reasonable means
|
| 657 |
+
prior to 60 days after the cessation.
|
| 658 |
+
|
| 659 |
+
Moreover, your license from a particular copyright holder is
|
| 660 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 661 |
+
violation by some reasonable means, this is the first time you have
|
| 662 |
+
received notice of violation of this License (for any work) from that
|
| 663 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 664 |
+
your receipt of the notice.
|
| 665 |
+
|
| 666 |
+
Termination of your rights under this section does not terminate the
|
| 667 |
+
licenses of parties who have received copies or rights from you under
|
| 668 |
+
this License. If your rights have been terminated and not permanently
|
| 669 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 670 |
+
material under section 10.
|
| 671 |
+
|
| 672 |
+
9. Acceptance Not Required for Having Copies.
|
| 673 |
+
|
| 674 |
+
You are not required to accept this License in order to receive or
|
| 675 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 676 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 677 |
+
to receive a copy likewise does not require acceptance. However,
|
| 678 |
+
nothing other than this License grants you permission to propagate or
|
| 679 |
+
modify any covered work. These actions infringe copyright if you do
|
| 680 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 681 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 682 |
+
|
| 683 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 684 |
+
|
| 685 |
+
Each time you convey a covered work, the recipient automatically
|
| 686 |
+
receives a license from the original licensors, to run, modify and
|
| 687 |
+
propagate that work, subject to this License. You are not responsible
|
| 688 |
+
for enforcing compliance by third parties with this License.
|
| 689 |
+
|
| 690 |
+
An "entity transaction" is a transaction transferring control of an
|
| 691 |
+
organization, or substantially all assets of one, or subdividing an
|
| 692 |
+
organization, or merging organizations. If propagation of a covered
|
| 693 |
+
work results from an entity transaction, each party to that
|
| 694 |
+
transaction who receives a copy of the work also receives whatever
|
| 695 |
+
licenses to the work the party's predecessor in interest had or could
|
| 696 |
+
give under the previous paragraph, plus a right to possession of the
|
| 697 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 698 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 699 |
+
|
| 700 |
+
You may not impose any further restrictions on the exercise of the
|
| 701 |
+
rights granted or affirmed under this License. For example, you may
|
| 702 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 703 |
+
rights granted under this License, and you may not initiate litigation
|
| 704 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 705 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 706 |
+
sale, or importing the Program or any portion of it.
|
| 707 |
+
|
| 708 |
+
11. Patents.
|
| 709 |
+
|
| 710 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 711 |
+
License of the Program or a work on which the Program is based. The
|
| 712 |
+
work thus licensed is called the contributor's "contributor version".
|
| 713 |
+
|
| 714 |
+
A contributor's "essential patent claims" are all patent claims
|
| 715 |
+
owned or controlled by the contributor, whether already acquired or
|
| 716 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 717 |
+
by this License, of making, using, or selling its contributor version,
|
| 718 |
+
but do not include claims that would be infringed only as a
|
| 719 |
+
consequence of further modification of the contributor version. For
|
| 720 |
+
purposes of this definition, "control" includes the right to grant
|
| 721 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 722 |
+
this License.
|
| 723 |
+
|
| 724 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 725 |
+
patent license under the contributor's essential patent claims, to
|
| 726 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 727 |
+
propagate the contents of its contributor version.
|
| 728 |
+
|
| 729 |
+
In the following three paragraphs, a "patent license" is any express
|
| 730 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 731 |
+
(such as an express permission to practice a patent or covenant not to
|
| 732 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 733 |
+
party means to make such an agreement or commitment not to enforce a
|
| 734 |
+
patent against the party.
|
| 735 |
+
|
| 736 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 737 |
+
and the Corresponding Source of the work is not available for anyone
|
| 738 |
+
to copy, free of charge and under the terms of this License, through a
|
| 739 |
+
publicly available network server or other readily accessible means,
|
| 740 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 741 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 742 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 743 |
+
consistent with the requirements of this License, to extend the patent
|
| 744 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 745 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 746 |
+
covered work in a country, or your recipient's use of the covered work
|
| 747 |
+
in a country, would infringe one or more identifiable patents in that
|
| 748 |
+
country that you have reason to believe are valid.
|
| 749 |
+
|
| 750 |
+
If, pursuant to or in connection with a single transaction or
|
| 751 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 752 |
+
covered work, and grant a patent license to some of the parties
|
| 753 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 754 |
+
or convey a specific copy of the covered work, then the patent license
|
| 755 |
+
you grant is automatically extended to all recipients of the covered
|
| 756 |
+
work and works based on it.
|
| 757 |
+
|
| 758 |
+
A patent license is "discriminatory" if it does not include within
|
| 759 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 760 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 761 |
+
specifically granted under this License. You may not convey a covered
|
| 762 |
+
work if you are a party to an arrangement with a third party that is
|
| 763 |
+
in the business of distributing software, under which you make payment
|
| 764 |
+
to the third party based on the extent of your activity of conveying
|
| 765 |
+
the work, and under which the third party grants, to any of the
|
| 766 |
+
parties who would receive the covered work from you, a discriminatory
|
| 767 |
+
patent license (a) in connection with copies of the covered work
|
| 768 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 769 |
+
for and in connection with specific products or compilations that
|
| 770 |
+
contain the covered work, unless you entered into that arrangement,
|
| 771 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 772 |
+
|
| 773 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 774 |
+
any implied license or other defenses to infringement that may
|
| 775 |
+
otherwise be available to you under applicable patent law.
|
| 776 |
+
|
| 777 |
+
12. No Surrender of Others' Freedom.
|
| 778 |
+
|
| 779 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 780 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 781 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 782 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 783 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 784 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 785 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 786 |
+
the Program, the only way you could satisfy both those terms and this
|
| 787 |
+
License would be to refrain entirely from conveying the Program.
|
| 788 |
+
|
| 789 |
+
13. Use with the GNU Affero General Public License.
|
| 790 |
+
|
| 791 |
+
Notwithstanding any other provision of this License, you have
|
| 792 |
+
permission to link or combine any covered work with a work licensed
|
| 793 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 794 |
+
combined work, and to convey the resulting work. The terms of this
|
| 795 |
+
License will continue to apply to the part which is the covered work,
|
| 796 |
+
but the special requirements of the GNU Affero General Public License,
|
| 797 |
+
section 13, concerning interaction through a network will apply to the
|
| 798 |
+
combination as such.
|
| 799 |
+
|
| 800 |
+
14. Revised Versions of this License.
|
| 801 |
+
|
| 802 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 803 |
+
the GNU General Public License from time to time. Such new versions will
|
| 804 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 805 |
+
address new problems or concerns.
|
| 806 |
+
|
| 807 |
+
Each version is given a distinguishing version number. If the
|
| 808 |
+
Program specifies that a certain numbered version of the GNU General
|
| 809 |
+
Public License "or any later version" applies to it, you have the
|
| 810 |
+
option of following the terms and conditions either of that numbered
|
| 811 |
+
version or of any later version published by the Free Software
|
| 812 |
+
Foundation. If the Program does not specify a version number of the
|
| 813 |
+
GNU General Public License, you may choose any version ever published
|
| 814 |
+
by the Free Software Foundation.
|
| 815 |
+
|
| 816 |
+
If the Program specifies that a proxy can decide which future
|
| 817 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 818 |
+
public statement of acceptance of a version permanently authorizes you
|
| 819 |
+
to choose that version for the Program.
|
| 820 |
+
|
| 821 |
+
Later license versions may give you additional or different
|
| 822 |
+
permissions. However, no additional obligations are imposed on any
|
| 823 |
+
author or copyright holder as a result of your choosing to follow a
|
| 824 |
+
later version.
|
| 825 |
+
|
| 826 |
+
15. Disclaimer of Warranty.
|
| 827 |
+
|
| 828 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 829 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 830 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 831 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 832 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 833 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 834 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 835 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 836 |
+
|
| 837 |
+
16. Limitation of Liability.
|
| 838 |
+
|
| 839 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 840 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 841 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 842 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 843 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 844 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 845 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 846 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 847 |
+
SUCH DAMAGES.
|
| 848 |
+
|
| 849 |
+
17. Interpretation of Sections 15 and 16.
|
| 850 |
+
|
| 851 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 852 |
+
above cannot be given local legal effect according to their terms,
|
| 853 |
+
reviewing courts shall apply local law that most closely approximates
|
| 854 |
+
an absolute waiver of all civil liability in connection with the
|
| 855 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 856 |
+
copy of the Program in return for a fee.
|
| 857 |
+
|
| 858 |
+
END OF TERMS AND CONDITIONS
|
| 859 |
+
|
| 860 |
+
How to Apply These Terms to Your New Programs
|
| 861 |
+
|
| 862 |
+
If you develop a new program, and you want it to be of the greatest
|
| 863 |
+
possible use to the public, the best way to achieve this is to make it
|
| 864 |
+
free software which everyone can redistribute and change under these terms.
|
| 865 |
+
|
| 866 |
+
To do so, attach the following notices to the program. It is safest
|
| 867 |
+
to attach them to the start of each source file to most effectively
|
| 868 |
+
state the exclusion of warranty; and each file should have at least
|
| 869 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 870 |
+
|
| 871 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 872 |
+
Copyright (C) <year> <name of author>
|
| 873 |
+
|
| 874 |
+
This program is free software: you can redistribute it and/or modify
|
| 875 |
+
it under the terms of the GNU General Public License as published by
|
| 876 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 877 |
+
(at your option) any later version.
|
| 878 |
+
|
| 879 |
+
This program is distributed in the hope that it will be useful,
|
| 880 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 881 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 882 |
+
GNU General Public License for more details.
|
| 883 |
+
|
| 884 |
+
You should have received a copy of the GNU General Public License
|
| 885 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 886 |
+
|
| 887 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 888 |
+
|
| 889 |
+
If the program does terminal interaction, make it output a short
|
| 890 |
+
notice like this when it starts in an interactive mode:
|
| 891 |
+
|
| 892 |
+
<program> Copyright (C) <year> <name of author>
|
| 893 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 894 |
+
This is free software, and you are welcome to redistribute it
|
| 895 |
+
under certain conditions; type `show c' for details.
|
| 896 |
+
|
| 897 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 898 |
+
parts of the General Public License. Of course, your program's commands
|
| 899 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 900 |
+
|
| 901 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 902 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 903 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 904 |
+
<http://www.gnu.org/licenses/>.
|
| 905 |
+
|
| 906 |
+
The GNU General Public License does not permit incorporating your program
|
| 907 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 908 |
+
may consider it more useful to permit linking proprietary applications with
|
| 909 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 910 |
+
Public License instead of this License. But first, please read
|
| 911 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
| 912 |
+
|
| 913 |
+
|
| 914 |
+
Name: libquadmath
|
| 915 |
+
Files: scipy.libs\libopenblas*.dll
|
| 916 |
+
Description: statically linked to files compiled with gcc
|
| 917 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath
|
| 918 |
+
License: LGPL-2.1-or-later
|
| 919 |
+
|
| 920 |
+
GCC Quad-Precision Math Library
|
| 921 |
+
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
| 922 |
+
Written by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
| 923 |
+
|
| 924 |
+
This file is part of the libquadmath library.
|
| 925 |
+
Libquadmath is free software; you can redistribute it and/or
|
| 926 |
+
modify it under the terms of the GNU Library General Public
|
| 927 |
+
License as published by the Free Software Foundation; either
|
| 928 |
+
version 2.1 of the License, or (at your option) any later version.
|
| 929 |
+
|
| 930 |
+
Libquadmath is distributed in the hope that it will be useful,
|
| 931 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 932 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 933 |
+
Lesser General Public License for more details.
|
| 934 |
+
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
.venv/Lib/site-packages/scipy-1.13.1.dist-info/METADATA
ADDED
|
@@ -0,0 +1,1075 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.1
|
| 2 |
+
Name: scipy
|
| 3 |
+
Version: 1.13.1
|
| 4 |
+
Summary: Fundamental algorithms for scientific computing in Python
|
| 5 |
+
Home-page: https://scipy.org/
|
| 6 |
+
Maintainer-Email: SciPy Developers <scipy-dev@python.org>
|
| 7 |
+
License: Copyright (c) 2001-2002 Enthought, Inc. 2003-2024, SciPy Developers.
|
| 8 |
+
All rights reserved.
|
| 9 |
+
|
| 10 |
+
Redistribution and use in source and binary forms, with or without
|
| 11 |
+
modification, are permitted provided that the following conditions
|
| 12 |
+
are met:
|
| 13 |
+
|
| 14 |
+
1. Redistributions of source code must retain the above copyright
|
| 15 |
+
notice, this list of conditions and the following disclaimer.
|
| 16 |
+
|
| 17 |
+
2. Redistributions in binary form must reproduce the above
|
| 18 |
+
copyright notice, this list of conditions and the following
|
| 19 |
+
disclaimer in the documentation and/or other materials provided
|
| 20 |
+
with the distribution.
|
| 21 |
+
|
| 22 |
+
3. Neither the name of the copyright holder nor the names of its
|
| 23 |
+
contributors may be used to endorse or promote products derived
|
| 24 |
+
from this software without specific prior written permission.
|
| 25 |
+
|
| 26 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 27 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 28 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 29 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 30 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 31 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 32 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 33 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 34 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 35 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 36 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 37 |
+
|
| 38 |
+
----
|
| 39 |
+
|
| 40 |
+
This binary distribution of SciPy also bundles the following software:
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
Name: OpenBLAS
|
| 44 |
+
Files: scipy.libs\libopenblas*.dll
|
| 45 |
+
Description: bundled as a dynamically linked library
|
| 46 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 47 |
+
License: BSD-3-Clause-Attribution
|
| 48 |
+
Copyright (c) 2011-2014, The OpenBLAS Project
|
| 49 |
+
All rights reserved.
|
| 50 |
+
|
| 51 |
+
Redistribution and use in source and binary forms, with or without
|
| 52 |
+
modification, are permitted provided that the following conditions are
|
| 53 |
+
met:
|
| 54 |
+
|
| 55 |
+
1. Redistributions of source code must retain the above copyright
|
| 56 |
+
notice, this list of conditions and the following disclaimer.
|
| 57 |
+
|
| 58 |
+
2. Redistributions in binary form must reproduce the above copyright
|
| 59 |
+
notice, this list of conditions and the following disclaimer in
|
| 60 |
+
the documentation and/or other materials provided with the
|
| 61 |
+
distribution.
|
| 62 |
+
3. Neither the name of the OpenBLAS project nor the names of
|
| 63 |
+
its contributors may be used to endorse or promote products
|
| 64 |
+
derived from this software without specific prior written
|
| 65 |
+
permission.
|
| 66 |
+
|
| 67 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 68 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 69 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 70 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
| 71 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 72 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 73 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 74 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 75 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
| 76 |
+
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
Name: LAPACK
|
| 80 |
+
Files: scipy.libs\libopenblas*.dll
|
| 81 |
+
Description: bundled in OpenBLAS
|
| 82 |
+
Availability: https://github.com/OpenMathLib/OpenBLAS/
|
| 83 |
+
License: BSD-3-Clause-Attribution
|
| 84 |
+
Copyright (c) 1992-2013 The University of Tennessee and The University
|
| 85 |
+
of Tennessee Research Foundation. All rights
|
| 86 |
+
reserved.
|
| 87 |
+
Copyright (c) 2000-2013 The University of California Berkeley. All
|
| 88 |
+
rights reserved.
|
| 89 |
+
Copyright (c) 2006-2013 The University of Colorado Denver. All rights
|
| 90 |
+
reserved.
|
| 91 |
+
|
| 92 |
+
$COPYRIGHT$
|
| 93 |
+
|
| 94 |
+
Additional copyrights may follow
|
| 95 |
+
|
| 96 |
+
$HEADER$
|
| 97 |
+
|
| 98 |
+
Redistribution and use in source and binary forms, with or without
|
| 99 |
+
modification, are permitted provided that the following conditions are
|
| 100 |
+
met:
|
| 101 |
+
|
| 102 |
+
- Redistributions of source code must retain the above copyright
|
| 103 |
+
notice, this list of conditions and the following disclaimer.
|
| 104 |
+
|
| 105 |
+
- Redistributions in binary form must reproduce the above copyright
|
| 106 |
+
notice, this list of conditions and the following disclaimer listed
|
| 107 |
+
in this license in the documentation and/or other materials
|
| 108 |
+
provided with the distribution.
|
| 109 |
+
|
| 110 |
+
- Neither the name of the copyright holders nor the names of its
|
| 111 |
+
contributors may be used to endorse or promote products derived from
|
| 112 |
+
this software without specific prior written permission.
|
| 113 |
+
|
| 114 |
+
The copyright holders provide no reassurances that the source code
|
| 115 |
+
provided does not infringe any patent, copyright, or any other
|
| 116 |
+
intellectual property rights of third parties. The copyright holders
|
| 117 |
+
disclaim any liability to any recipient for claims brought against
|
| 118 |
+
recipient by any third party for infringement of that parties
|
| 119 |
+
intellectual property rights.
|
| 120 |
+
|
| 121 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 122 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 123 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 124 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 125 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 126 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 127 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 128 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 129 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 130 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 131 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
Name: GCC runtime library
|
| 135 |
+
Files: scipy.libs\libopenblas*.dll
|
| 136 |
+
Description: statically linked to files compiled with gcc
|
| 137 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran
|
| 138 |
+
License: GPL-3.0-with-GCC-exception
|
| 139 |
+
Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
| 140 |
+
|
| 141 |
+
Libgfortran is free software; you can redistribute it and/or modify
|
| 142 |
+
it under the terms of the GNU General Public License as published by
|
| 143 |
+
the Free Software Foundation; either version 3, or (at your option)
|
| 144 |
+
any later version.
|
| 145 |
+
|
| 146 |
+
Libgfortran is distributed in the hope that it will be useful,
|
| 147 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 148 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 149 |
+
GNU General Public License for more details.
|
| 150 |
+
|
| 151 |
+
Under Section 7 of GPL version 3, you are granted additional
|
| 152 |
+
permissions described in the GCC Runtime Library Exception, version
|
| 153 |
+
3.1, as published by the Free Software Foundation.
|
| 154 |
+
|
| 155 |
+
You should have received a copy of the GNU General Public License and
|
| 156 |
+
a copy of the GCC Runtime Library Exception along with this program;
|
| 157 |
+
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
| 158 |
+
<http://www.gnu.org/licenses/>.
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
----
|
| 162 |
+
|
| 163 |
+
Full text of license texts referred to above follows (that they are
|
| 164 |
+
listed below does not necessarily imply the conditions apply to the
|
| 165 |
+
present binary release):
|
| 166 |
+
|
| 167 |
+
----
|
| 168 |
+
|
| 169 |
+
GCC RUNTIME LIBRARY EXCEPTION
|
| 170 |
+
|
| 171 |
+
Version 3.1, 31 March 2009
|
| 172 |
+
|
| 173 |
+
Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/>
|
| 174 |
+
|
| 175 |
+
Everyone is permitted to copy and distribute verbatim copies of this
|
| 176 |
+
license document, but changing it is not allowed.
|
| 177 |
+
|
| 178 |
+
This GCC Runtime Library Exception ("Exception") is an additional
|
| 179 |
+
permission under section 7 of the GNU General Public License, version
|
| 180 |
+
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
|
| 181 |
+
bears a notice placed by the copyright holder of the file stating that
|
| 182 |
+
the file is governed by GPLv3 along with this Exception.
|
| 183 |
+
|
| 184 |
+
When you use GCC to compile a program, GCC may combine portions of
|
| 185 |
+
certain GCC header files and runtime libraries with the compiled
|
| 186 |
+
program. The purpose of this Exception is to allow compilation of
|
| 187 |
+
non-GPL (including proprietary) programs to use, in this way, the
|
| 188 |
+
header files and runtime libraries covered by this Exception.
|
| 189 |
+
|
| 190 |
+
0. Definitions.
|
| 191 |
+
|
| 192 |
+
A file is an "Independent Module" if it either requires the Runtime
|
| 193 |
+
Library for execution after a Compilation Process, or makes use of an
|
| 194 |
+
interface provided by the Runtime Library, but is not otherwise based
|
| 195 |
+
on the Runtime Library.
|
| 196 |
+
|
| 197 |
+
"GCC" means a version of the GNU Compiler Collection, with or without
|
| 198 |
+
modifications, governed by version 3 (or a specified later version) of
|
| 199 |
+
the GNU General Public License (GPL) with the option of using any
|
| 200 |
+
subsequent versions published by the FSF.
|
| 201 |
+
|
| 202 |
+
"GPL-compatible Software" is software whose conditions of propagation,
|
| 203 |
+
modification and use would permit combination with GCC in accord with
|
| 204 |
+
the license of GCC.
|
| 205 |
+
|
| 206 |
+
"Target Code" refers to output from any compiler for a real or virtual
|
| 207 |
+
target processor architecture, in executable form or suitable for
|
| 208 |
+
input to an assembler, loader, linker and/or execution
|
| 209 |
+
phase. Notwithstanding that, Target Code does not include data in any
|
| 210 |
+
format that is used as a compiler intermediate representation, or used
|
| 211 |
+
for producing a compiler intermediate representation.
|
| 212 |
+
|
| 213 |
+
The "Compilation Process" transforms code entirely represented in
|
| 214 |
+
non-intermediate languages designed for human-written code, and/or in
|
| 215 |
+
Java Virtual Machine byte code, into Target Code. Thus, for example,
|
| 216 |
+
use of source code generators and preprocessors need not be considered
|
| 217 |
+
part of the Compilation Process, since the Compilation Process can be
|
| 218 |
+
understood as starting with the output of the generators or
|
| 219 |
+
preprocessors.
|
| 220 |
+
|
| 221 |
+
A Compilation Process is "Eligible" if it is done using GCC, alone or
|
| 222 |
+
with other GPL-compatible software, or if it is done without using any
|
| 223 |
+
work based on GCC. For example, using non-GPL-compatible Software to
|
| 224 |
+
optimize any GCC intermediate representations would not qualify as an
|
| 225 |
+
Eligible Compilation Process.
|
| 226 |
+
|
| 227 |
+
1. Grant of Additional Permission.
|
| 228 |
+
|
| 229 |
+
You have permission to propagate a work of Target Code formed by
|
| 230 |
+
combining the Runtime Library with Independent Modules, even if such
|
| 231 |
+
propagation would otherwise violate the terms of GPLv3, provided that
|
| 232 |
+
all Target Code was generated by Eligible Compilation Processes. You
|
| 233 |
+
may then convey such a combination under terms of your choice,
|
| 234 |
+
consistent with the licensing of the Independent Modules.
|
| 235 |
+
|
| 236 |
+
2. No Weakening of GCC Copyleft.
|
| 237 |
+
|
| 238 |
+
The availability of this Exception does not imply any general
|
| 239 |
+
presumption that third-party software is unaffected by the copyleft
|
| 240 |
+
requirements of the license of GCC.
|
| 241 |
+
|
| 242 |
+
----
|
| 243 |
+
|
| 244 |
+
GNU GENERAL PUBLIC LICENSE
|
| 245 |
+
Version 3, 29 June 2007
|
| 246 |
+
|
| 247 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
| 248 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 249 |
+
of this license document, but changing it is not allowed.
|
| 250 |
+
|
| 251 |
+
Preamble
|
| 252 |
+
|
| 253 |
+
The GNU General Public License is a free, copyleft license for
|
| 254 |
+
software and other kinds of works.
|
| 255 |
+
|
| 256 |
+
The licenses for most software and other practical works are designed
|
| 257 |
+
to take away your freedom to share and change the works. By contrast,
|
| 258 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 259 |
+
share and change all versions of a program--to make sure it remains free
|
| 260 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 261 |
+
GNU General Public License for most of our software; it applies also to
|
| 262 |
+
any other work released this way by its authors. You can apply it to
|
| 263 |
+
your programs, too.
|
| 264 |
+
|
| 265 |
+
When we speak of free software, we are referring to freedom, not
|
| 266 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 267 |
+
have the freedom to distribute copies of free software (and charge for
|
| 268 |
+
them if you wish), that you receive source code or can get it if you
|
| 269 |
+
want it, that you can change the software or use pieces of it in new
|
| 270 |
+
free programs, and that you know you can do these things.
|
| 271 |
+
|
| 272 |
+
To protect your rights, we need to prevent others from denying you
|
| 273 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 274 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 275 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 276 |
+
|
| 277 |
+
For example, if you distribute copies of such a program, whether
|
| 278 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 279 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 280 |
+
or can get the source code. And you must show them these terms so they
|
| 281 |
+
know their rights.
|
| 282 |
+
|
| 283 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 284 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 285 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 286 |
+
|
| 287 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 288 |
+
that there is no warranty for this free software. For both users' and
|
| 289 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 290 |
+
changed, so that their problems will not be attributed erroneously to
|
| 291 |
+
authors of previous versions.
|
| 292 |
+
|
| 293 |
+
Some devices are designed to deny users access to install or run
|
| 294 |
+
modified versions of the software inside them, although the manufacturer
|
| 295 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 296 |
+
protecting users' freedom to change the software. The systematic
|
| 297 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 298 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 299 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 300 |
+
products. If such problems arise substantially in other domains, we
|
| 301 |
+
stand ready to extend this provision to those domains in future versions
|
| 302 |
+
of the GPL, as needed to protect the freedom of users.
|
| 303 |
+
|
| 304 |
+
Finally, every program is threatened constantly by software patents.
|
| 305 |
+
States should not allow patents to restrict development and use of
|
| 306 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 307 |
+
avoid the special danger that patents applied to a free program could
|
| 308 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 309 |
+
patents cannot be used to render the program non-free.
|
| 310 |
+
|
| 311 |
+
The precise terms and conditions for copying, distribution and
|
| 312 |
+
modification follow.
|
| 313 |
+
|
| 314 |
+
TERMS AND CONDITIONS
|
| 315 |
+
|
| 316 |
+
0. Definitions.
|
| 317 |
+
|
| 318 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 319 |
+
|
| 320 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 321 |
+
works, such as semiconductor masks.
|
| 322 |
+
|
| 323 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 324 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 325 |
+
"recipients" may be individuals or organizations.
|
| 326 |
+
|
| 327 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 328 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 329 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 330 |
+
earlier work or a work "based on" the earlier work.
|
| 331 |
+
|
| 332 |
+
A "covered work" means either the unmodified Program or a work based
|
| 333 |
+
on the Program.
|
| 334 |
+
|
| 335 |
+
To "propagate" a work means to do anything with it that, without
|
| 336 |
+
permission, would make you directly or secondarily liable for
|
| 337 |
+
infringement under applicable copyright law, except executing it on a
|
| 338 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 339 |
+
distribution (with or without modification), making available to the
|
| 340 |
+
public, and in some countries other activities as well.
|
| 341 |
+
|
| 342 |
+
To "convey" a work means any kind of propagation that enables other
|
| 343 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 344 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 345 |
+
|
| 346 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 347 |
+
to the extent that it includes a convenient and prominently visible
|
| 348 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 349 |
+
tells the user that there is no warranty for the work (except to the
|
| 350 |
+
extent that warranties are provided), that licensees may convey the
|
| 351 |
+
work under this License, and how to view a copy of this License. If
|
| 352 |
+
the interface presents a list of user commands or options, such as a
|
| 353 |
+
menu, a prominent item in the list meets this criterion.
|
| 354 |
+
|
| 355 |
+
1. Source Code.
|
| 356 |
+
|
| 357 |
+
The "source code" for a work means the preferred form of the work
|
| 358 |
+
for making modifications to it. "Object code" means any non-source
|
| 359 |
+
form of a work.
|
| 360 |
+
|
| 361 |
+
A "Standard Interface" means an interface that either is an official
|
| 362 |
+
standard defined by a recognized standards body, or, in the case of
|
| 363 |
+
interfaces specified for a particular programming language, one that
|
| 364 |
+
is widely used among developers working in that language.
|
| 365 |
+
|
| 366 |
+
The "System Libraries" of an executable work include anything, other
|
| 367 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 368 |
+
packaging a Major Component, but which is not part of that Major
|
| 369 |
+
Component, and (b) serves only to enable use of the work with that
|
| 370 |
+
Major Component, or to implement a Standard Interface for which an
|
| 371 |
+
implementation is available to the public in source code form. A
|
| 372 |
+
"Major Component", in this context, means a major essential component
|
| 373 |
+
(kernel, window system, and so on) of the specific operating system
|
| 374 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 375 |
+
produce the work, or an object code interpreter used to run it.
|
| 376 |
+
|
| 377 |
+
The "Corresponding Source" for a work in object code form means all
|
| 378 |
+
the source code needed to generate, install, and (for an executable
|
| 379 |
+
work) run the object code and to modify the work, including scripts to
|
| 380 |
+
control those activities. However, it does not include the work's
|
| 381 |
+
System Libraries, or general-purpose tools or generally available free
|
| 382 |
+
programs which are used unmodified in performing those activities but
|
| 383 |
+
which are not part of the work. For example, Corresponding Source
|
| 384 |
+
includes interface definition files associated with source files for
|
| 385 |
+
the work, and the source code for shared libraries and dynamically
|
| 386 |
+
linked subprograms that the work is specifically designed to require,
|
| 387 |
+
such as by intimate data communication or control flow between those
|
| 388 |
+
subprograms and other parts of the work.
|
| 389 |
+
|
| 390 |
+
The Corresponding Source need not include anything that users
|
| 391 |
+
can regenerate automatically from other parts of the Corresponding
|
| 392 |
+
Source.
|
| 393 |
+
|
| 394 |
+
The Corresponding Source for a work in source code form is that
|
| 395 |
+
same work.
|
| 396 |
+
|
| 397 |
+
2. Basic Permissions.
|
| 398 |
+
|
| 399 |
+
All rights granted under this License are granted for the term of
|
| 400 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 401 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 402 |
+
permission to run the unmodified Program. The output from running a
|
| 403 |
+
covered work is covered by this License only if the output, given its
|
| 404 |
+
content, constitutes a covered work. This License acknowledges your
|
| 405 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 406 |
+
|
| 407 |
+
You may make, run and propagate covered works that you do not
|
| 408 |
+
convey, without conditions so long as your license otherwise remains
|
| 409 |
+
in force. You may convey covered works to others for the sole purpose
|
| 410 |
+
of having them make modifications exclusively for you, or provide you
|
| 411 |
+
with facilities for running those works, provided that you comply with
|
| 412 |
+
the terms of this License in conveying all material for which you do
|
| 413 |
+
not control copyright. Those thus making or running the covered works
|
| 414 |
+
for you must do so exclusively on your behalf, under your direction
|
| 415 |
+
and control, on terms that prohibit them from making any copies of
|
| 416 |
+
your copyrighted material outside their relationship with you.
|
| 417 |
+
|
| 418 |
+
Conveying under any other circumstances is permitted solely under
|
| 419 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 420 |
+
makes it unnecessary.
|
| 421 |
+
|
| 422 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 423 |
+
|
| 424 |
+
No covered work shall be deemed part of an effective technological
|
| 425 |
+
measure under any applicable law fulfilling obligations under article
|
| 426 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 427 |
+
similar laws prohibiting or restricting circumvention of such
|
| 428 |
+
measures.
|
| 429 |
+
|
| 430 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 431 |
+
circumvention of technological measures to the extent such circumvention
|
| 432 |
+
is effected by exercising rights under this License with respect to
|
| 433 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 434 |
+
modification of the work as a means of enforcing, against the work's
|
| 435 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 436 |
+
technological measures.
|
| 437 |
+
|
| 438 |
+
4. Conveying Verbatim Copies.
|
| 439 |
+
|
| 440 |
+
You may convey verbatim copies of the Program's source code as you
|
| 441 |
+
receive it, in any medium, provided that you conspicuously and
|
| 442 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 443 |
+
keep intact all notices stating that this License and any
|
| 444 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 445 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 446 |
+
recipients a copy of this License along with the Program.
|
| 447 |
+
|
| 448 |
+
You may charge any price or no price for each copy that you convey,
|
| 449 |
+
and you may offer support or warranty protection for a fee.
|
| 450 |
+
|
| 451 |
+
5. Conveying Modified Source Versions.
|
| 452 |
+
|
| 453 |
+
You may convey a work based on the Program, or the modifications to
|
| 454 |
+
produce it from the Program, in the form of source code under the
|
| 455 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 456 |
+
|
| 457 |
+
a) The work must carry prominent notices stating that you modified
|
| 458 |
+
it, and giving a relevant date.
|
| 459 |
+
|
| 460 |
+
b) The work must carry prominent notices stating that it is
|
| 461 |
+
released under this License and any conditions added under section
|
| 462 |
+
7. This requirement modifies the requirement in section 4 to
|
| 463 |
+
"keep intact all notices".
|
| 464 |
+
|
| 465 |
+
c) You must license the entire work, as a whole, under this
|
| 466 |
+
License to anyone who comes into possession of a copy. This
|
| 467 |
+
License will therefore apply, along with any applicable section 7
|
| 468 |
+
additional terms, to the whole of the work, and all its parts,
|
| 469 |
+
regardless of how they are packaged. This License gives no
|
| 470 |
+
permission to license the work in any other way, but it does not
|
| 471 |
+
invalidate such permission if you have separately received it.
|
| 472 |
+
|
| 473 |
+
d) If the work has interactive user interfaces, each must display
|
| 474 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 475 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 476 |
+
work need not make them do so.
|
| 477 |
+
|
| 478 |
+
A compilation of a covered work with other separate and independent
|
| 479 |
+
works, which are not by their nature extensions of the covered work,
|
| 480 |
+
and which are not combined with it such as to form a larger program,
|
| 481 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 482 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 483 |
+
used to limit the access or legal rights of the compilation's users
|
| 484 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 485 |
+
in an aggregate does not cause this License to apply to the other
|
| 486 |
+
parts of the aggregate.
|
| 487 |
+
|
| 488 |
+
6. Conveying Non-Source Forms.
|
| 489 |
+
|
| 490 |
+
You may convey a covered work in object code form under the terms
|
| 491 |
+
of sections 4 and 5, provided that you also convey the
|
| 492 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 493 |
+
in one of these ways:
|
| 494 |
+
|
| 495 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 496 |
+
(including a physical distribution medium), accompanied by the
|
| 497 |
+
Corresponding Source fixed on a durable physical medium
|
| 498 |
+
customarily used for software interchange.
|
| 499 |
+
|
| 500 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 501 |
+
(including a physical distribution medium), accompanied by a
|
| 502 |
+
written offer, valid for at least three years and valid for as
|
| 503 |
+
long as you offer spare parts or customer support for that product
|
| 504 |
+
model, to give anyone who possesses the object code either (1) a
|
| 505 |
+
copy of the Corresponding Source for all the software in the
|
| 506 |
+
product that is covered by this License, on a durable physical
|
| 507 |
+
medium customarily used for software interchange, for a price no
|
| 508 |
+
more than your reasonable cost of physically performing this
|
| 509 |
+
conveying of source, or (2) access to copy the
|
| 510 |
+
Corresponding Source from a network server at no charge.
|
| 511 |
+
|
| 512 |
+
c) Convey individual copies of the object code with a copy of the
|
| 513 |
+
written offer to provide the Corresponding Source. This
|
| 514 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 515 |
+
only if you received the object code with such an offer, in accord
|
| 516 |
+
with subsection 6b.
|
| 517 |
+
|
| 518 |
+
d) Convey the object code by offering access from a designated
|
| 519 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 520 |
+
Corresponding Source in the same way through the same place at no
|
| 521 |
+
further charge. You need not require recipients to copy the
|
| 522 |
+
Corresponding Source along with the object code. If the place to
|
| 523 |
+
copy the object code is a network server, the Corresponding Source
|
| 524 |
+
may be on a different server (operated by you or a third party)
|
| 525 |
+
that supports equivalent copying facilities, provided you maintain
|
| 526 |
+
clear directions next to the object code saying where to find the
|
| 527 |
+
Corresponding Source. Regardless of what server hosts the
|
| 528 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 529 |
+
available for as long as needed to satisfy these requirements.
|
| 530 |
+
|
| 531 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 532 |
+
you inform other peers where the object code and Corresponding
|
| 533 |
+
Source of the work are being offered to the general public at no
|
| 534 |
+
charge under subsection 6d.
|
| 535 |
+
|
| 536 |
+
A separable portion of the object code, whose source code is excluded
|
| 537 |
+
from the Corresponding Source as a System Library, need not be
|
| 538 |
+
included in conveying the object code work.
|
| 539 |
+
|
| 540 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 541 |
+
tangible personal property which is normally used for personal, family,
|
| 542 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 543 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 544 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 545 |
+
product received by a particular user, "normally used" refers to a
|
| 546 |
+
typical or common use of that class of product, regardless of the status
|
| 547 |
+
of the particular user or of the way in which the particular user
|
| 548 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 549 |
+
is a consumer product regardless of whether the product has substantial
|
| 550 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 551 |
+
the only significant mode of use of the product.
|
| 552 |
+
|
| 553 |
+
"Installation Information" for a User Product means any methods,
|
| 554 |
+
procedures, authorization keys, or other information required to install
|
| 555 |
+
and execute modified versions of a covered work in that User Product from
|
| 556 |
+
a modified version of its Corresponding Source. The information must
|
| 557 |
+
suffice to ensure that the continued functioning of the modified object
|
| 558 |
+
code is in no case prevented or interfered with solely because
|
| 559 |
+
modification has been made.
|
| 560 |
+
|
| 561 |
+
If you convey an object code work under this section in, or with, or
|
| 562 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 563 |
+
part of a transaction in which the right of possession and use of the
|
| 564 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 565 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 566 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 567 |
+
by the Installation Information. But this requirement does not apply
|
| 568 |
+
if neither you nor any third party retains the ability to install
|
| 569 |
+
modified object code on the User Product (for example, the work has
|
| 570 |
+
been installed in ROM).
|
| 571 |
+
|
| 572 |
+
The requirement to provide Installation Information does not include a
|
| 573 |
+
requirement to continue to provide support service, warranty, or updates
|
| 574 |
+
for a work that has been modified or installed by the recipient, or for
|
| 575 |
+
the User Product in which it has been modified or installed. Access to a
|
| 576 |
+
network may be denied when the modification itself materially and
|
| 577 |
+
adversely affects the operation of the network or violates the rules and
|
| 578 |
+
protocols for communication across the network.
|
| 579 |
+
|
| 580 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 581 |
+
in accord with this section must be in a format that is publicly
|
| 582 |
+
documented (and with an implementation available to the public in
|
| 583 |
+
source code form), and must require no special password or key for
|
| 584 |
+
unpacking, reading or copying.
|
| 585 |
+
|
| 586 |
+
7. Additional Terms.
|
| 587 |
+
|
| 588 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 589 |
+
License by making exceptions from one or more of its conditions.
|
| 590 |
+
Additional permissions that are applicable to the entire Program shall
|
| 591 |
+
be treated as though they were included in this License, to the extent
|
| 592 |
+
that they are valid under applicable law. If additional permissions
|
| 593 |
+
apply only to part of the Program, that part may be used separately
|
| 594 |
+
under those permissions, but the entire Program remains governed by
|
| 595 |
+
this License without regard to the additional permissions.
|
| 596 |
+
|
| 597 |
+
When you convey a copy of a covered work, you may at your option
|
| 598 |
+
remove any additional permissions from that copy, or from any part of
|
| 599 |
+
it. (Additional permissions may be written to require their own
|
| 600 |
+
removal in certain cases when you modify the work.) You may place
|
| 601 |
+
additional permissions on material, added by you to a covered work,
|
| 602 |
+
for which you have or can give appropriate copyright permission.
|
| 603 |
+
|
| 604 |
+
Notwithstanding any other provision of this License, for material you
|
| 605 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 606 |
+
that material) supplement the terms of this License with terms:
|
| 607 |
+
|
| 608 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 609 |
+
terms of sections 15 and 16 of this License; or
|
| 610 |
+
|
| 611 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 612 |
+
author attributions in that material or in the Appropriate Legal
|
| 613 |
+
Notices displayed by works containing it; or
|
| 614 |
+
|
| 615 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 616 |
+
requiring that modified versions of such material be marked in
|
| 617 |
+
reasonable ways as different from the original version; or
|
| 618 |
+
|
| 619 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 620 |
+
authors of the material; or
|
| 621 |
+
|
| 622 |
+
e) Declining to grant rights under trademark law for use of some
|
| 623 |
+
trade names, trademarks, or service marks; or
|
| 624 |
+
|
| 625 |
+
f) Requiring indemnification of licensors and authors of that
|
| 626 |
+
material by anyone who conveys the material (or modified versions of
|
| 627 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 628 |
+
any liability that these contractual assumptions directly impose on
|
| 629 |
+
those licensors and authors.
|
| 630 |
+
|
| 631 |
+
All other non-permissive additional terms are considered "further
|
| 632 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 633 |
+
received it, or any part of it, contains a notice stating that it is
|
| 634 |
+
governed by this License along with a term that is a further
|
| 635 |
+
restriction, you may remove that term. If a license document contains
|
| 636 |
+
a further restriction but permits relicensing or conveying under this
|
| 637 |
+
License, you may add to a covered work material governed by the terms
|
| 638 |
+
of that license document, provided that the further restriction does
|
| 639 |
+
not survive such relicensing or conveying.
|
| 640 |
+
|
| 641 |
+
If you add terms to a covered work in accord with this section, you
|
| 642 |
+
must place, in the relevant source files, a statement of the
|
| 643 |
+
additional terms that apply to those files, or a notice indicating
|
| 644 |
+
where to find the applicable terms.
|
| 645 |
+
|
| 646 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 647 |
+
form of a separately written license, or stated as exceptions;
|
| 648 |
+
the above requirements apply either way.
|
| 649 |
+
|
| 650 |
+
8. Termination.
|
| 651 |
+
|
| 652 |
+
You may not propagate or modify a covered work except as expressly
|
| 653 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 654 |
+
modify it is void, and will automatically terminate your rights under
|
| 655 |
+
this License (including any patent licenses granted under the third
|
| 656 |
+
paragraph of section 11).
|
| 657 |
+
|
| 658 |
+
However, if you cease all violation of this License, then your
|
| 659 |
+
license from a particular copyright holder is reinstated (a)
|
| 660 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 661 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 662 |
+
holder fails to notify you of the violation by some reasonable means
|
| 663 |
+
prior to 60 days after the cessation.
|
| 664 |
+
|
| 665 |
+
Moreover, your license from a particular copyright holder is
|
| 666 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 667 |
+
violation by some reasonable means, this is the first time you have
|
| 668 |
+
received notice of violation of this License (for any work) from that
|
| 669 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 670 |
+
your receipt of the notice.
|
| 671 |
+
|
| 672 |
+
Termination of your rights under this section does not terminate the
|
| 673 |
+
licenses of parties who have received copies or rights from you under
|
| 674 |
+
this License. If your rights have been terminated and not permanently
|
| 675 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 676 |
+
material under section 10.
|
| 677 |
+
|
| 678 |
+
9. Acceptance Not Required for Having Copies.
|
| 679 |
+
|
| 680 |
+
You are not required to accept this License in order to receive or
|
| 681 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 682 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 683 |
+
to receive a copy likewise does not require acceptance. However,
|
| 684 |
+
nothing other than this License grants you permission to propagate or
|
| 685 |
+
modify any covered work. These actions infringe copyright if you do
|
| 686 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 687 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 688 |
+
|
| 689 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 690 |
+
|
| 691 |
+
Each time you convey a covered work, the recipient automatically
|
| 692 |
+
receives a license from the original licensors, to run, modify and
|
| 693 |
+
propagate that work, subject to this License. You are not responsible
|
| 694 |
+
for enforcing compliance by third parties with this License.
|
| 695 |
+
|
| 696 |
+
An "entity transaction" is a transaction transferring control of an
|
| 697 |
+
organization, or substantially all assets of one, or subdividing an
|
| 698 |
+
organization, or merging organizations. If propagation of a covered
|
| 699 |
+
work results from an entity transaction, each party to that
|
| 700 |
+
transaction who receives a copy of the work also receives whatever
|
| 701 |
+
licenses to the work the party's predecessor in interest had or could
|
| 702 |
+
give under the previous paragraph, plus a right to possession of the
|
| 703 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 704 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 705 |
+
|
| 706 |
+
You may not impose any further restrictions on the exercise of the
|
| 707 |
+
rights granted or affirmed under this License. For example, you may
|
| 708 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 709 |
+
rights granted under this License, and you may not initiate litigation
|
| 710 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 711 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 712 |
+
sale, or importing the Program or any portion of it.
|
| 713 |
+
|
| 714 |
+
11. Patents.
|
| 715 |
+
|
| 716 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 717 |
+
License of the Program or a work on which the Program is based. The
|
| 718 |
+
work thus licensed is called the contributor's "contributor version".
|
| 719 |
+
|
| 720 |
+
A contributor's "essential patent claims" are all patent claims
|
| 721 |
+
owned or controlled by the contributor, whether already acquired or
|
| 722 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 723 |
+
by this License, of making, using, or selling its contributor version,
|
| 724 |
+
but do not include claims that would be infringed only as a
|
| 725 |
+
consequence of further modification of the contributor version. For
|
| 726 |
+
purposes of this definition, "control" includes the right to grant
|
| 727 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 728 |
+
this License.
|
| 729 |
+
|
| 730 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 731 |
+
patent license under the contributor's essential patent claims, to
|
| 732 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 733 |
+
propagate the contents of its contributor version.
|
| 734 |
+
|
| 735 |
+
In the following three paragraphs, a "patent license" is any express
|
| 736 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 737 |
+
(such as an express permission to practice a patent or covenant not to
|
| 738 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 739 |
+
party means to make such an agreement or commitment not to enforce a
|
| 740 |
+
patent against the party.
|
| 741 |
+
|
| 742 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 743 |
+
and the Corresponding Source of the work is not available for anyone
|
| 744 |
+
to copy, free of charge and under the terms of this License, through a
|
| 745 |
+
publicly available network server or other readily accessible means,
|
| 746 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 747 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 748 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 749 |
+
consistent with the requirements of this License, to extend the patent
|
| 750 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 751 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 752 |
+
covered work in a country, or your recipient's use of the covered work
|
| 753 |
+
in a country, would infringe one or more identifiable patents in that
|
| 754 |
+
country that you have reason to believe are valid.
|
| 755 |
+
|
| 756 |
+
If, pursuant to or in connection with a single transaction or
|
| 757 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 758 |
+
covered work, and grant a patent license to some of the parties
|
| 759 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 760 |
+
or convey a specific copy of the covered work, then the patent license
|
| 761 |
+
you grant is automatically extended to all recipients of the covered
|
| 762 |
+
work and works based on it.
|
| 763 |
+
|
| 764 |
+
A patent license is "discriminatory" if it does not include within
|
| 765 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 766 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 767 |
+
specifically granted under this License. You may not convey a covered
|
| 768 |
+
work if you are a party to an arrangement with a third party that is
|
| 769 |
+
in the business of distributing software, under which you make payment
|
| 770 |
+
to the third party based on the extent of your activity of conveying
|
| 771 |
+
the work, and under which the third party grants, to any of the
|
| 772 |
+
parties who would receive the covered work from you, a discriminatory
|
| 773 |
+
patent license (a) in connection with copies of the covered work
|
| 774 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 775 |
+
for and in connection with specific products or compilations that
|
| 776 |
+
contain the covered work, unless you entered into that arrangement,
|
| 777 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 778 |
+
|
| 779 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 780 |
+
any implied license or other defenses to infringement that may
|
| 781 |
+
otherwise be available to you under applicable patent law.
|
| 782 |
+
|
| 783 |
+
12. No Surrender of Others' Freedom.
|
| 784 |
+
|
| 785 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 786 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 787 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 788 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 789 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 790 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 791 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 792 |
+
the Program, the only way you could satisfy both those terms and this
|
| 793 |
+
License would be to refrain entirely from conveying the Program.
|
| 794 |
+
|
| 795 |
+
13. Use with the GNU Affero General Public License.
|
| 796 |
+
|
| 797 |
+
Notwithstanding any other provision of this License, you have
|
| 798 |
+
permission to link or combine any covered work with a work licensed
|
| 799 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 800 |
+
combined work, and to convey the resulting work. The terms of this
|
| 801 |
+
License will continue to apply to the part which is the covered work,
|
| 802 |
+
but the special requirements of the GNU Affero General Public License,
|
| 803 |
+
section 13, concerning interaction through a network will apply to the
|
| 804 |
+
combination as such.
|
| 805 |
+
|
| 806 |
+
14. Revised Versions of this License.
|
| 807 |
+
|
| 808 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 809 |
+
the GNU General Public License from time to time. Such new versions will
|
| 810 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 811 |
+
address new problems or concerns.
|
| 812 |
+
|
| 813 |
+
Each version is given a distinguishing version number. If the
|
| 814 |
+
Program specifies that a certain numbered version of the GNU General
|
| 815 |
+
Public License "or any later version" applies to it, you have the
|
| 816 |
+
option of following the terms and conditions either of that numbered
|
| 817 |
+
version or of any later version published by the Free Software
|
| 818 |
+
Foundation. If the Program does not specify a version number of the
|
| 819 |
+
GNU General Public License, you may choose any version ever published
|
| 820 |
+
by the Free Software Foundation.
|
| 821 |
+
|
| 822 |
+
If the Program specifies that a proxy can decide which future
|
| 823 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 824 |
+
public statement of acceptance of a version permanently authorizes you
|
| 825 |
+
to choose that version for the Program.
|
| 826 |
+
|
| 827 |
+
Later license versions may give you additional or different
|
| 828 |
+
permissions. However, no additional obligations are imposed on any
|
| 829 |
+
author or copyright holder as a result of your choosing to follow a
|
| 830 |
+
later version.
|
| 831 |
+
|
| 832 |
+
15. Disclaimer of Warranty.
|
| 833 |
+
|
| 834 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 835 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 836 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 837 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 838 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 839 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 840 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 841 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 842 |
+
|
| 843 |
+
16. Limitation of Liability.
|
| 844 |
+
|
| 845 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 846 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 847 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 848 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 849 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 850 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 851 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 852 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 853 |
+
SUCH DAMAGES.
|
| 854 |
+
|
| 855 |
+
17. Interpretation of Sections 15 and 16.
|
| 856 |
+
|
| 857 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 858 |
+
above cannot be given local legal effect according to their terms,
|
| 859 |
+
reviewing courts shall apply local law that most closely approximates
|
| 860 |
+
an absolute waiver of all civil liability in connection with the
|
| 861 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 862 |
+
copy of the Program in return for a fee.
|
| 863 |
+
|
| 864 |
+
END OF TERMS AND CONDITIONS
|
| 865 |
+
|
| 866 |
+
How to Apply These Terms to Your New Programs
|
| 867 |
+
|
| 868 |
+
If you develop a new program, and you want it to be of the greatest
|
| 869 |
+
possible use to the public, the best way to achieve this is to make it
|
| 870 |
+
free software which everyone can redistribute and change under these terms.
|
| 871 |
+
|
| 872 |
+
To do so, attach the following notices to the program. It is safest
|
| 873 |
+
to attach them to the start of each source file to most effectively
|
| 874 |
+
state the exclusion of warranty; and each file should have at least
|
| 875 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 876 |
+
|
| 877 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 878 |
+
Copyright (C) <year> <name of author>
|
| 879 |
+
|
| 880 |
+
This program is free software: you can redistribute it and/or modify
|
| 881 |
+
it under the terms of the GNU General Public License as published by
|
| 882 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 883 |
+
(at your option) any later version.
|
| 884 |
+
|
| 885 |
+
This program is distributed in the hope that it will be useful,
|
| 886 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 887 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 888 |
+
GNU General Public License for more details.
|
| 889 |
+
|
| 890 |
+
You should have received a copy of the GNU General Public License
|
| 891 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 892 |
+
|
| 893 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 894 |
+
|
| 895 |
+
If the program does terminal interaction, make it output a short
|
| 896 |
+
notice like this when it starts in an interactive mode:
|
| 897 |
+
|
| 898 |
+
<program> Copyright (C) <year> <name of author>
|
| 899 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 900 |
+
This is free software, and you are welcome to redistribute it
|
| 901 |
+
under certain conditions; type `show c' for details.
|
| 902 |
+
|
| 903 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 904 |
+
parts of the General Public License. Of course, your program's commands
|
| 905 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 906 |
+
|
| 907 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 908 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 909 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 910 |
+
<http://www.gnu.org/licenses/>.
|
| 911 |
+
|
| 912 |
+
The GNU General Public License does not permit incorporating your program
|
| 913 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 914 |
+
may consider it more useful to permit linking proprietary applications with
|
| 915 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 916 |
+
Public License instead of this License. But first, please read
|
| 917 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
| 918 |
+
|
| 919 |
+
|
| 920 |
+
Name: libquadmath
|
| 921 |
+
Files: scipy.libs\libopenblas*.dll
|
| 922 |
+
Description: statically linked to files compiled with gcc
|
| 923 |
+
Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath
|
| 924 |
+
License: LGPL-2.1-or-later
|
| 925 |
+
|
| 926 |
+
GCC Quad-Precision Math Library
|
| 927 |
+
Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
| 928 |
+
Written by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
| 929 |
+
|
| 930 |
+
This file is part of the libquadmath library.
|
| 931 |
+
Libquadmath is free software; you can redistribute it and/or
|
| 932 |
+
modify it under the terms of the GNU Library General Public
|
| 933 |
+
License as published by the Free Software Foundation; either
|
| 934 |
+
version 2.1 of the License, or (at your option) any later version.
|
| 935 |
+
|
| 936 |
+
Libquadmath is distributed in the hope that it will be useful,
|
| 937 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 938 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 939 |
+
Lesser General Public License for more details.
|
| 940 |
+
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
| 941 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 942 |
+
Classifier: Intended Audience :: Science/Research
|
| 943 |
+
Classifier: Intended Audience :: Developers
|
| 944 |
+
Classifier: License :: OSI Approved :: BSD License
|
| 945 |
+
Classifier: Programming Language :: C
|
| 946 |
+
Classifier: Programming Language :: Python
|
| 947 |
+
Classifier: Programming Language :: Python :: 3
|
| 948 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 949 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 950 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 951 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 952 |
+
Classifier: Topic :: Software Development :: Libraries
|
| 953 |
+
Classifier: Topic :: Scientific/Engineering
|
| 954 |
+
Classifier: Operating System :: Microsoft :: Windows
|
| 955 |
+
Classifier: Operating System :: POSIX :: Linux
|
| 956 |
+
Classifier: Operating System :: POSIX
|
| 957 |
+
Classifier: Operating System :: Unix
|
| 958 |
+
Classifier: Operating System :: MacOS
|
| 959 |
+
Project-URL: Homepage, https://scipy.org/
|
| 960 |
+
Project-URL: Documentation, https://docs.scipy.org/doc/scipy/
|
| 961 |
+
Project-URL: Source, https://github.com/scipy/scipy
|
| 962 |
+
Project-URL: Download, https://github.com/scipy/scipy/releases
|
| 963 |
+
Project-URL: Tracker, https://github.com/scipy/scipy/issues
|
| 964 |
+
Requires-Python: >=3.9
|
| 965 |
+
Requires-Dist: numpy<2.3,>=1.22.4
|
| 966 |
+
Requires-Dist: pytest; extra == "test"
|
| 967 |
+
Requires-Dist: pytest-cov; extra == "test"
|
| 968 |
+
Requires-Dist: pytest-timeout; extra == "test"
|
| 969 |
+
Requires-Dist: pytest-xdist; extra == "test"
|
| 970 |
+
Requires-Dist: asv; extra == "test"
|
| 971 |
+
Requires-Dist: mpmath; extra == "test"
|
| 972 |
+
Requires-Dist: gmpy2; extra == "test"
|
| 973 |
+
Requires-Dist: threadpoolctl; extra == "test"
|
| 974 |
+
Requires-Dist: scikit-umfpack; extra == "test"
|
| 975 |
+
Requires-Dist: pooch; extra == "test"
|
| 976 |
+
Requires-Dist: hypothesis>=6.30; extra == "test"
|
| 977 |
+
Requires-Dist: array-api-strict; extra == "test"
|
| 978 |
+
Requires-Dist: sphinx>=5.0.0; extra == "doc"
|
| 979 |
+
Requires-Dist: pydata-sphinx-theme>=0.15.2; extra == "doc"
|
| 980 |
+
Requires-Dist: sphinx-design>=0.4.0; extra == "doc"
|
| 981 |
+
Requires-Dist: matplotlib>=3.5; extra == "doc"
|
| 982 |
+
Requires-Dist: numpydoc; extra == "doc"
|
| 983 |
+
Requires-Dist: jupytext; extra == "doc"
|
| 984 |
+
Requires-Dist: myst-nb; extra == "doc"
|
| 985 |
+
Requires-Dist: pooch; extra == "doc"
|
| 986 |
+
Requires-Dist: jupyterlite-sphinx>=0.12.0; extra == "doc"
|
| 987 |
+
Requires-Dist: jupyterlite-pyodide-kernel; extra == "doc"
|
| 988 |
+
Requires-Dist: mypy; extra == "dev"
|
| 989 |
+
Requires-Dist: typing_extensions; extra == "dev"
|
| 990 |
+
Requires-Dist: types-psutil; extra == "dev"
|
| 991 |
+
Requires-Dist: pycodestyle; extra == "dev"
|
| 992 |
+
Requires-Dist: ruff; extra == "dev"
|
| 993 |
+
Requires-Dist: cython-lint>=0.12.2; extra == "dev"
|
| 994 |
+
Requires-Dist: rich-click; extra == "dev"
|
| 995 |
+
Requires-Dist: doit>=0.36.0; extra == "dev"
|
| 996 |
+
Requires-Dist: pydevtool; extra == "dev"
|
| 997 |
+
Provides-Extra: test
|
| 998 |
+
Provides-Extra: doc
|
| 999 |
+
Provides-Extra: dev
|
| 1000 |
+
Description-Content-Type: text/x-rst
|
| 1001 |
+
|
| 1002 |
+
.. image:: https://raw.githubusercontent.com/scipy/scipy/main/doc/source/_static/logo.svg
|
| 1003 |
+
:target: https://scipy.org
|
| 1004 |
+
:width: 110
|
| 1005 |
+
:height: 110
|
| 1006 |
+
:align: left
|
| 1007 |
+
|
| 1008 |
+
.. image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
|
| 1009 |
+
:target: https://numfocus.org
|
| 1010 |
+
|
| 1011 |
+
.. image:: https://img.shields.io/pypi/dm/scipy.svg?label=Pypi%20downloads
|
| 1012 |
+
:target: https://pypi.org/project/scipy/
|
| 1013 |
+
|
| 1014 |
+
.. image:: https://img.shields.io/conda/dn/conda-forge/scipy.svg?label=Conda%20downloads
|
| 1015 |
+
:target: https://anaconda.org/conda-forge/scipy
|
| 1016 |
+
|
| 1017 |
+
.. image:: https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg
|
| 1018 |
+
:target: https://stackoverflow.com/questions/tagged/scipy
|
| 1019 |
+
|
| 1020 |
+
.. image:: https://img.shields.io/badge/DOI-10.1038%2Fs41592--019--0686--2-blue
|
| 1021 |
+
:target: https://www.nature.com/articles/s41592-019-0686-2
|
| 1022 |
+
|
| 1023 |
+
SciPy (pronounced "Sigh Pie") is an open-source software for mathematics,
|
| 1024 |
+
science, and engineering. It includes modules for statistics, optimization,
|
| 1025 |
+
integration, linear algebra, Fourier transforms, signal and image processing,
|
| 1026 |
+
ODE solvers, and more.
|
| 1027 |
+
|
| 1028 |
+
- **Website:** https://scipy.org
|
| 1029 |
+
- **Documentation:** https://docs.scipy.org/doc/scipy/
|
| 1030 |
+
- **Development version of the documentation:** https://scipy.github.io/devdocs
|
| 1031 |
+
- **Mailing list:** https://mail.python.org/mailman3/lists/scipy-dev.python.org/
|
| 1032 |
+
- **Source code:** https://github.com/scipy/scipy
|
| 1033 |
+
- **Contributing:** https://scipy.github.io/devdocs/dev/index.html
|
| 1034 |
+
- **Bug reports:** https://github.com/scipy/scipy/issues
|
| 1035 |
+
- **Code of Conduct:** https://docs.scipy.org/doc/scipy/dev/conduct/code_of_conduct.html
|
| 1036 |
+
- **Report a security vulnerability:** https://tidelift.com/docs/security
|
| 1037 |
+
- **Citing in your work:** https://www.scipy.org/citing-scipy/
|
| 1038 |
+
|
| 1039 |
+
SciPy is built to work with
|
| 1040 |
+
NumPy arrays, and provides many user-friendly and efficient numerical routines,
|
| 1041 |
+
such as routines for numerical integration and optimization. Together, they
|
| 1042 |
+
run on all popular operating systems, are quick to install, and are free of
|
| 1043 |
+
charge. NumPy and SciPy are easy to use, but powerful enough to be depended
|
| 1044 |
+
upon by some of the world's leading scientists and engineers. If you need to
|
| 1045 |
+
manipulate numbers on a computer and display or publish the results, give
|
| 1046 |
+
SciPy a try!
|
| 1047 |
+
|
| 1048 |
+
For the installation instructions, see `our install
|
| 1049 |
+
guide <https://scipy.org/install/>`__.
|
| 1050 |
+
|
| 1051 |
+
|
| 1052 |
+
Call for Contributions
|
| 1053 |
+
----------------------
|
| 1054 |
+
|
| 1055 |
+
We appreciate and welcome contributions. Small improvements or fixes are always appreciated; issues labeled as "good
|
| 1056 |
+
first issue" may be a good starting point. Have a look at `our contributing
|
| 1057 |
+
guide <https://scipy.github.io/devdocs/dev/index.html>`__.
|
| 1058 |
+
|
| 1059 |
+
Writing code isn’t the only way to contribute to SciPy. You can also:
|
| 1060 |
+
|
| 1061 |
+
- review pull requests
|
| 1062 |
+
- triage issues
|
| 1063 |
+
- develop tutorials, presentations, and other educational materials
|
| 1064 |
+
- maintain and improve `our website <https://github.com/scipy/scipy.org>`__
|
| 1065 |
+
- develop graphic design for our brand assets and promotional materials
|
| 1066 |
+
- help with outreach and onboard new contributors
|
| 1067 |
+
- write grant proposals and help with other fundraising efforts
|
| 1068 |
+
|
| 1069 |
+
If you’re unsure where to start or how your skills fit in, reach out! You can
|
| 1070 |
+
ask on the mailing list or here, on GitHub, by leaving a
|
| 1071 |
+
comment on a relevant issue that is already open.
|
| 1072 |
+
|
| 1073 |
+
If you are new to contributing to open source, `this
|
| 1074 |
+
guide <https://opensource.guide/how-to-contribute/>`__ helps explain why, what,
|
| 1075 |
+
and how to get involved.
|
.venv/Lib/site-packages/scipy-1.13.1.dist-info/RECORD
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
.venv/Lib/site-packages/scipy-1.13.1.dist-info/REQUESTED
ADDED
|
File without changes
|
.venv/Lib/site-packages/scipy-1.13.1.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: meson
|
| 3 |
+
Root-Is-Purelib: false
|
| 4 |
+
Tag: cp39-cp39-win_amd64
|
.venv/Lib/site-packages/scipy.libs/.load-order-scipy-1.13.1
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
libopenblas_v0.3.27--3aa239bc726cfb0bd8e5330d8d4c15c6.dll
|
.venv/Lib/site-packages/scipy/__pycache__/__config__.cpython-39.pyc
ADDED
|
Binary file (3.64 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file (4.77 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/__pycache__/_distributor_init.cpython-39.pyc
ADDED
|
Binary file (949 Bytes). View file
|
|
|
.venv/Lib/site-packages/scipy/__pycache__/version.cpython-39.pyc
ADDED
|
Binary file (318 Bytes). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file (539 Bytes). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_array_api.cpython-39.pyc
ADDED
|
Binary file (9.5 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_bunch.cpython-39.pyc
ADDED
|
Binary file (6.9 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_ccallback.cpython-39.pyc
ADDED
|
Binary file (7.05 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_docscrape.cpython-39.pyc
ADDED
|
Binary file (18.9 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_finite_differences.cpython-39.pyc
ADDED
|
Binary file (4.06 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_pep440.cpython-39.pyc
ADDED
|
Binary file (13.1 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_testutils.cpython-39.pyc
ADDED
|
Binary file (7.82 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_threadsafety.cpython-39.pyc
ADDED
|
Binary file (2.29 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/_util.cpython-39.pyc
ADDED
|
Binary file (30.5 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/decorator.cpython-39.pyc
ADDED
|
Binary file (11.4 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/deprecation.cpython-39.pyc
ADDED
|
Binary file (7.39 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/doccer.cpython-39.pyc
ADDED
|
Binary file (7.8 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/__pycache__/uarray.cpython-39.pyc
ADDED
|
Binary file (791 Bytes). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/_uarray/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
BSD 3-Clause License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2018, Quansight-Labs
|
| 4 |
+
All rights reserved.
|
| 5 |
+
|
| 6 |
+
Redistribution and use in source and binary forms, with or without
|
| 7 |
+
modification, are permitted provided that the following conditions are met:
|
| 8 |
+
|
| 9 |
+
* Redistributions of source code must retain the above copyright notice, this
|
| 10 |
+
list of conditions and the following disclaimer.
|
| 11 |
+
|
| 12 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
| 13 |
+
this list of conditions and the following disclaimer in the documentation
|
| 14 |
+
and/or other materials provided with the distribution.
|
| 15 |
+
|
| 16 |
+
* Neither the name of the copyright holder nor the names of its
|
| 17 |
+
contributors may be used to endorse or promote products derived from
|
| 18 |
+
this software without specific prior written permission.
|
| 19 |
+
|
| 20 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 21 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 22 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 23 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
| 24 |
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 25 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 26 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
| 27 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
| 28 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 29 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
.venv/Lib/site-packages/scipy/_lib/_uarray/__init__.py
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
.. note:
|
| 3 |
+
If you are looking for overrides for NumPy-specific methods, see the
|
| 4 |
+
documentation for :obj:`unumpy`. This page explains how to write
|
| 5 |
+
back-ends and multimethods.
|
| 6 |
+
|
| 7 |
+
``uarray`` is built around a back-end protocol, and overridable multimethods.
|
| 8 |
+
It is necessary to define multimethods for back-ends to be able to override them.
|
| 9 |
+
See the documentation of :obj:`generate_multimethod` on how to write multimethods.
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
Let's start with the simplest:
|
| 14 |
+
|
| 15 |
+
``__ua_domain__`` defines the back-end *domain*. The domain consists of period-
|
| 16 |
+
separated string consisting of the modules you extend plus the submodule. For
|
| 17 |
+
example, if a submodule ``module2.submodule`` extends ``module1``
|
| 18 |
+
(i.e., it exposes dispatchables marked as types available in ``module1``),
|
| 19 |
+
then the domain string should be ``"module1.module2.submodule"``.
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
For the purpose of this demonstration, we'll be creating an object and setting
|
| 23 |
+
its attributes directly. However, note that you can use a module or your own type
|
| 24 |
+
as a backend as well.
|
| 25 |
+
|
| 26 |
+
>>> class Backend: pass
|
| 27 |
+
>>> be = Backend()
|
| 28 |
+
>>> be.__ua_domain__ = "ua_examples"
|
| 29 |
+
|
| 30 |
+
It might be useful at this point to sidetrack to the documentation of
|
| 31 |
+
:obj:`generate_multimethod` to find out how to generate a multimethod
|
| 32 |
+
overridable by :obj:`uarray`. Needless to say, writing a backend and
|
| 33 |
+
creating multimethods are mostly orthogonal activities, and knowing
|
| 34 |
+
one doesn't necessarily require knowledge of the other, although it
|
| 35 |
+
is certainly helpful. We expect core API designers/specifiers to write the
|
| 36 |
+
multimethods, and implementors to override them. But, as is often the case,
|
| 37 |
+
similar people write both.
|
| 38 |
+
|
| 39 |
+
Without further ado, here's an example multimethod:
|
| 40 |
+
|
| 41 |
+
>>> import uarray as ua
|
| 42 |
+
>>> from uarray import Dispatchable
|
| 43 |
+
>>> def override_me(a, b):
|
| 44 |
+
... return Dispatchable(a, int),
|
| 45 |
+
>>> def override_replacer(args, kwargs, dispatchables):
|
| 46 |
+
... return (dispatchables[0], args[1]), {}
|
| 47 |
+
>>> overridden_me = ua.generate_multimethod(
|
| 48 |
+
... override_me, override_replacer, "ua_examples"
|
| 49 |
+
... )
|
| 50 |
+
|
| 51 |
+
Next comes the part about overriding the multimethod. This requires
|
| 52 |
+
the ``__ua_function__`` protocol, and the ``__ua_convert__``
|
| 53 |
+
protocol. The ``__ua_function__`` protocol has the signature
|
| 54 |
+
``(method, args, kwargs)`` where ``method`` is the passed
|
| 55 |
+
multimethod, ``args``/``kwargs`` specify the arguments and ``dispatchables``
|
| 56 |
+
is the list of converted dispatchables passed in.
|
| 57 |
+
|
| 58 |
+
>>> def __ua_function__(method, args, kwargs):
|
| 59 |
+
... return method.__name__, args, kwargs
|
| 60 |
+
>>> be.__ua_function__ = __ua_function__
|
| 61 |
+
|
| 62 |
+
The other protocol of interest is the ``__ua_convert__`` protocol. It has the
|
| 63 |
+
signature ``(dispatchables, coerce)``. When ``coerce`` is ``False``, conversion
|
| 64 |
+
between the formats should ideally be an ``O(1)`` operation, but it means that
|
| 65 |
+
no memory copying should be involved, only views of the existing data.
|
| 66 |
+
|
| 67 |
+
>>> def __ua_convert__(dispatchables, coerce):
|
| 68 |
+
... for d in dispatchables:
|
| 69 |
+
... if d.type is int:
|
| 70 |
+
... if coerce and d.coercible:
|
| 71 |
+
... yield str(d.value)
|
| 72 |
+
... else:
|
| 73 |
+
... yield d.value
|
| 74 |
+
>>> be.__ua_convert__ = __ua_convert__
|
| 75 |
+
|
| 76 |
+
Now that we have defined the backend, the next thing to do is to call the multimethod.
|
| 77 |
+
|
| 78 |
+
>>> with ua.set_backend(be):
|
| 79 |
+
... overridden_me(1, "2")
|
| 80 |
+
('override_me', (1, '2'), {})
|
| 81 |
+
|
| 82 |
+
Note that the marked type has no effect on the actual type of the passed object.
|
| 83 |
+
We can also coerce the type of the input.
|
| 84 |
+
|
| 85 |
+
>>> with ua.set_backend(be, coerce=True):
|
| 86 |
+
... overridden_me(1, "2")
|
| 87 |
+
... overridden_me(1.0, "2")
|
| 88 |
+
('override_me', ('1', '2'), {})
|
| 89 |
+
('override_me', ('1.0', '2'), {})
|
| 90 |
+
|
| 91 |
+
Another feature is that if you remove ``__ua_convert__``, the arguments are not
|
| 92 |
+
converted at all and it's up to the backend to handle that.
|
| 93 |
+
|
| 94 |
+
>>> del be.__ua_convert__
|
| 95 |
+
>>> with ua.set_backend(be):
|
| 96 |
+
... overridden_me(1, "2")
|
| 97 |
+
('override_me', (1, '2'), {})
|
| 98 |
+
|
| 99 |
+
You also have the option to return ``NotImplemented``, in which case processing moves on
|
| 100 |
+
to the next back-end, which in this case, doesn't exist. The same applies to
|
| 101 |
+
``__ua_convert__``.
|
| 102 |
+
|
| 103 |
+
>>> be.__ua_function__ = lambda *a, **kw: NotImplemented
|
| 104 |
+
>>> with ua.set_backend(be):
|
| 105 |
+
... overridden_me(1, "2")
|
| 106 |
+
Traceback (most recent call last):
|
| 107 |
+
...
|
| 108 |
+
uarray.BackendNotImplementedError: ...
|
| 109 |
+
|
| 110 |
+
The last possibility is if we don't have ``__ua_convert__``, in which case the job is
|
| 111 |
+
left up to ``__ua_function__``, but putting things back into arrays after conversion
|
| 112 |
+
will not be possible.
|
| 113 |
+
"""
|
| 114 |
+
|
| 115 |
+
from ._backend import *
|
| 116 |
+
__version__ = '0.8.8.dev0+aa94c5a4.scipy'
|
.venv/Lib/site-packages/scipy/_lib/_uarray/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file (4.7 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/_uarray/__pycache__/_backend.cpython-39.pyc
ADDED
|
Binary file (20.4 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/_uarray/_backend.py
ADDED
|
@@ -0,0 +1,704 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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4 |
+
import functools
|
| 5 |
+
from . import _uarray
|
| 6 |
+
import copyreg
|
| 7 |
+
import pickle
|
| 8 |
+
import contextlib
|
| 9 |
+
|
| 10 |
+
from ._uarray import ( # type: ignore
|
| 11 |
+
BackendNotImplementedError,
|
| 12 |
+
_Function,
|
| 13 |
+
_SkipBackendContext,
|
| 14 |
+
_SetBackendContext,
|
| 15 |
+
_BackendState,
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
__all__ = [
|
| 19 |
+
"set_backend",
|
| 20 |
+
"set_global_backend",
|
| 21 |
+
"skip_backend",
|
| 22 |
+
"register_backend",
|
| 23 |
+
"determine_backend",
|
| 24 |
+
"determine_backend_multi",
|
| 25 |
+
"clear_backends",
|
| 26 |
+
"create_multimethod",
|
| 27 |
+
"generate_multimethod",
|
| 28 |
+
"_Function",
|
| 29 |
+
"BackendNotImplementedError",
|
| 30 |
+
"Dispatchable",
|
| 31 |
+
"wrap_single_convertor",
|
| 32 |
+
"wrap_single_convertor_instance",
|
| 33 |
+
"all_of_type",
|
| 34 |
+
"mark_as",
|
| 35 |
+
"set_state",
|
| 36 |
+
"get_state",
|
| 37 |
+
"reset_state",
|
| 38 |
+
"_BackendState",
|
| 39 |
+
"_SkipBackendContext",
|
| 40 |
+
"_SetBackendContext",
|
| 41 |
+
]
|
| 42 |
+
|
| 43 |
+
ArgumentExtractorType = typing.Callable[..., tuple["Dispatchable", ...]]
|
| 44 |
+
ArgumentReplacerType = typing.Callable[
|
| 45 |
+
[tuple, dict, tuple], tuple[tuple, dict]
|
| 46 |
+
]
|
| 47 |
+
|
| 48 |
+
def unpickle_function(mod_name, qname, self_):
|
| 49 |
+
import importlib
|
| 50 |
+
|
| 51 |
+
try:
|
| 52 |
+
module = importlib.import_module(mod_name)
|
| 53 |
+
qname = qname.split(".")
|
| 54 |
+
func = module
|
| 55 |
+
for q in qname:
|
| 56 |
+
func = getattr(func, q)
|
| 57 |
+
|
| 58 |
+
if self_ is not None:
|
| 59 |
+
func = types.MethodType(func, self_)
|
| 60 |
+
|
| 61 |
+
return func
|
| 62 |
+
except (ImportError, AttributeError) as e:
|
| 63 |
+
from pickle import UnpicklingError
|
| 64 |
+
|
| 65 |
+
raise UnpicklingError from e
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def pickle_function(func):
|
| 69 |
+
mod_name = getattr(func, "__module__", None)
|
| 70 |
+
qname = getattr(func, "__qualname__", None)
|
| 71 |
+
self_ = getattr(func, "__self__", None)
|
| 72 |
+
|
| 73 |
+
try:
|
| 74 |
+
test = unpickle_function(mod_name, qname, self_)
|
| 75 |
+
except pickle.UnpicklingError:
|
| 76 |
+
test = None
|
| 77 |
+
|
| 78 |
+
if test is not func:
|
| 79 |
+
raise pickle.PicklingError(
|
| 80 |
+
f"Can't pickle {func}: it's not the same object as {test}"
|
| 81 |
+
)
|
| 82 |
+
|
| 83 |
+
return unpickle_function, (mod_name, qname, self_)
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def pickle_state(state):
|
| 87 |
+
return _uarray._BackendState._unpickle, state._pickle()
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
def pickle_set_backend_context(ctx):
|
| 91 |
+
return _SetBackendContext, ctx._pickle()
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
def pickle_skip_backend_context(ctx):
|
| 95 |
+
return _SkipBackendContext, ctx._pickle()
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
copyreg.pickle(_Function, pickle_function)
|
| 99 |
+
copyreg.pickle(_uarray._BackendState, pickle_state)
|
| 100 |
+
copyreg.pickle(_SetBackendContext, pickle_set_backend_context)
|
| 101 |
+
copyreg.pickle(_SkipBackendContext, pickle_skip_backend_context)
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def get_state():
|
| 105 |
+
"""
|
| 106 |
+
Returns an opaque object containing the current state of all the backends.
|
| 107 |
+
|
| 108 |
+
Can be used for synchronization between threads/processes.
|
| 109 |
+
|
| 110 |
+
See Also
|
| 111 |
+
--------
|
| 112 |
+
set_state
|
| 113 |
+
Sets the state returned by this function.
|
| 114 |
+
"""
|
| 115 |
+
return _uarray.get_state()
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
@contextlib.contextmanager
|
| 119 |
+
def reset_state():
|
| 120 |
+
"""
|
| 121 |
+
Returns a context manager that resets all state once exited.
|
| 122 |
+
|
| 123 |
+
See Also
|
| 124 |
+
--------
|
| 125 |
+
set_state
|
| 126 |
+
Context manager that sets the backend state.
|
| 127 |
+
get_state
|
| 128 |
+
Gets a state to be set by this context manager.
|
| 129 |
+
"""
|
| 130 |
+
with set_state(get_state()):
|
| 131 |
+
yield
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
@contextlib.contextmanager
|
| 135 |
+
def set_state(state):
|
| 136 |
+
"""
|
| 137 |
+
A context manager that sets the state of the backends to one returned by :obj:`get_state`.
|
| 138 |
+
|
| 139 |
+
See Also
|
| 140 |
+
--------
|
| 141 |
+
get_state
|
| 142 |
+
Gets a state to be set by this context manager.
|
| 143 |
+
""" # noqa: E501
|
| 144 |
+
old_state = get_state()
|
| 145 |
+
_uarray.set_state(state)
|
| 146 |
+
try:
|
| 147 |
+
yield
|
| 148 |
+
finally:
|
| 149 |
+
_uarray.set_state(old_state, True)
|
| 150 |
+
|
| 151 |
+
|
| 152 |
+
def create_multimethod(*args, **kwargs):
|
| 153 |
+
"""
|
| 154 |
+
Creates a decorator for generating multimethods.
|
| 155 |
+
|
| 156 |
+
This function creates a decorator that can be used with an argument
|
| 157 |
+
extractor in order to generate a multimethod. Other than for the
|
| 158 |
+
argument extractor, all arguments are passed on to
|
| 159 |
+
:obj:`generate_multimethod`.
|
| 160 |
+
|
| 161 |
+
See Also
|
| 162 |
+
--------
|
| 163 |
+
generate_multimethod
|
| 164 |
+
Generates a multimethod.
|
| 165 |
+
"""
|
| 166 |
+
|
| 167 |
+
def wrapper(a):
|
| 168 |
+
return generate_multimethod(a, *args, **kwargs)
|
| 169 |
+
|
| 170 |
+
return wrapper
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
def generate_multimethod(
|
| 174 |
+
argument_extractor: ArgumentExtractorType,
|
| 175 |
+
argument_replacer: ArgumentReplacerType,
|
| 176 |
+
domain: str,
|
| 177 |
+
default: typing.Optional[typing.Callable] = None,
|
| 178 |
+
):
|
| 179 |
+
"""
|
| 180 |
+
Generates a multimethod.
|
| 181 |
+
|
| 182 |
+
Parameters
|
| 183 |
+
----------
|
| 184 |
+
argument_extractor : ArgumentExtractorType
|
| 185 |
+
A callable which extracts the dispatchable arguments. Extracted arguments
|
| 186 |
+
should be marked by the :obj:`Dispatchable` class. It has the same signature
|
| 187 |
+
as the desired multimethod.
|
| 188 |
+
argument_replacer : ArgumentReplacerType
|
| 189 |
+
A callable with the signature (args, kwargs, dispatchables), which should also
|
| 190 |
+
return an (args, kwargs) pair with the dispatchables replaced inside the
|
| 191 |
+
args/kwargs.
|
| 192 |
+
domain : str
|
| 193 |
+
A string value indicating the domain of this multimethod.
|
| 194 |
+
default: Optional[Callable], optional
|
| 195 |
+
The default implementation of this multimethod, where ``None`` (the default)
|
| 196 |
+
specifies there is no default implementation.
|
| 197 |
+
|
| 198 |
+
Examples
|
| 199 |
+
--------
|
| 200 |
+
In this example, ``a`` is to be dispatched over, so we return it, while marking it
|
| 201 |
+
as an ``int``.
|
| 202 |
+
The trailing comma is needed because the args have to be returned as an iterable.
|
| 203 |
+
|
| 204 |
+
>>> def override_me(a, b):
|
| 205 |
+
... return Dispatchable(a, int),
|
| 206 |
+
|
| 207 |
+
Next, we define the argument replacer that replaces the dispatchables inside
|
| 208 |
+
args/kwargs with the supplied ones.
|
| 209 |
+
|
| 210 |
+
>>> def override_replacer(args, kwargs, dispatchables):
|
| 211 |
+
... return (dispatchables[0], args[1]), {}
|
| 212 |
+
|
| 213 |
+
Next, we define the multimethod.
|
| 214 |
+
|
| 215 |
+
>>> overridden_me = generate_multimethod(
|
| 216 |
+
... override_me, override_replacer, "ua_examples"
|
| 217 |
+
... )
|
| 218 |
+
|
| 219 |
+
Notice that there's no default implementation, unless you supply one.
|
| 220 |
+
|
| 221 |
+
>>> overridden_me(1, "a")
|
| 222 |
+
Traceback (most recent call last):
|
| 223 |
+
...
|
| 224 |
+
uarray.BackendNotImplementedError: ...
|
| 225 |
+
|
| 226 |
+
>>> overridden_me2 = generate_multimethod(
|
| 227 |
+
... override_me, override_replacer, "ua_examples", default=lambda x, y: (x, y)
|
| 228 |
+
... )
|
| 229 |
+
>>> overridden_me2(1, "a")
|
| 230 |
+
(1, 'a')
|
| 231 |
+
|
| 232 |
+
See Also
|
| 233 |
+
--------
|
| 234 |
+
uarray
|
| 235 |
+
See the module documentation for how to override the method by creating
|
| 236 |
+
backends.
|
| 237 |
+
"""
|
| 238 |
+
kw_defaults, arg_defaults, opts = get_defaults(argument_extractor)
|
| 239 |
+
ua_func = _Function(
|
| 240 |
+
argument_extractor,
|
| 241 |
+
argument_replacer,
|
| 242 |
+
domain,
|
| 243 |
+
arg_defaults,
|
| 244 |
+
kw_defaults,
|
| 245 |
+
default,
|
| 246 |
+
)
|
| 247 |
+
|
| 248 |
+
return functools.update_wrapper(ua_func, argument_extractor)
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
def set_backend(backend, coerce=False, only=False):
|
| 252 |
+
"""
|
| 253 |
+
A context manager that sets the preferred backend.
|
| 254 |
+
|
| 255 |
+
Parameters
|
| 256 |
+
----------
|
| 257 |
+
backend
|
| 258 |
+
The backend to set.
|
| 259 |
+
coerce
|
| 260 |
+
Whether or not to coerce to a specific backend's types. Implies ``only``.
|
| 261 |
+
only
|
| 262 |
+
Whether or not this should be the last backend to try.
|
| 263 |
+
|
| 264 |
+
See Also
|
| 265 |
+
--------
|
| 266 |
+
skip_backend: A context manager that allows skipping of backends.
|
| 267 |
+
set_global_backend: Set a single, global backend for a domain.
|
| 268 |
+
"""
|
| 269 |
+
try:
|
| 270 |
+
return backend.__ua_cache__["set", coerce, only]
|
| 271 |
+
except AttributeError:
|
| 272 |
+
backend.__ua_cache__ = {}
|
| 273 |
+
except KeyError:
|
| 274 |
+
pass
|
| 275 |
+
|
| 276 |
+
ctx = _SetBackendContext(backend, coerce, only)
|
| 277 |
+
backend.__ua_cache__["set", coerce, only] = ctx
|
| 278 |
+
return ctx
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
def skip_backend(backend):
|
| 282 |
+
"""
|
| 283 |
+
A context manager that allows one to skip a given backend from processing
|
| 284 |
+
entirely. This allows one to use another backend's code in a library that
|
| 285 |
+
is also a consumer of the same backend.
|
| 286 |
+
|
| 287 |
+
Parameters
|
| 288 |
+
----------
|
| 289 |
+
backend
|
| 290 |
+
The backend to skip.
|
| 291 |
+
|
| 292 |
+
See Also
|
| 293 |
+
--------
|
| 294 |
+
set_backend: A context manager that allows setting of backends.
|
| 295 |
+
set_global_backend: Set a single, global backend for a domain.
|
| 296 |
+
"""
|
| 297 |
+
try:
|
| 298 |
+
return backend.__ua_cache__["skip"]
|
| 299 |
+
except AttributeError:
|
| 300 |
+
backend.__ua_cache__ = {}
|
| 301 |
+
except KeyError:
|
| 302 |
+
pass
|
| 303 |
+
|
| 304 |
+
ctx = _SkipBackendContext(backend)
|
| 305 |
+
backend.__ua_cache__["skip"] = ctx
|
| 306 |
+
return ctx
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
def get_defaults(f):
|
| 310 |
+
sig = inspect.signature(f)
|
| 311 |
+
kw_defaults = {}
|
| 312 |
+
arg_defaults = []
|
| 313 |
+
opts = set()
|
| 314 |
+
for k, v in sig.parameters.items():
|
| 315 |
+
if v.default is not inspect.Parameter.empty:
|
| 316 |
+
kw_defaults[k] = v.default
|
| 317 |
+
if v.kind in (
|
| 318 |
+
inspect.Parameter.POSITIONAL_ONLY,
|
| 319 |
+
inspect.Parameter.POSITIONAL_OR_KEYWORD,
|
| 320 |
+
):
|
| 321 |
+
arg_defaults.append(v.default)
|
| 322 |
+
opts.add(k)
|
| 323 |
+
|
| 324 |
+
return kw_defaults, tuple(arg_defaults), opts
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
def set_global_backend(backend, coerce=False, only=False, *, try_last=False):
|
| 328 |
+
"""
|
| 329 |
+
This utility method replaces the default backend for permanent use. It
|
| 330 |
+
will be tried in the list of backends automatically, unless the
|
| 331 |
+
``only`` flag is set on a backend. This will be the first tried
|
| 332 |
+
backend outside the :obj:`set_backend` context manager.
|
| 333 |
+
|
| 334 |
+
Note that this method is not thread-safe.
|
| 335 |
+
|
| 336 |
+
.. warning::
|
| 337 |
+
We caution library authors against using this function in
|
| 338 |
+
their code. We do *not* support this use-case. This function
|
| 339 |
+
is meant to be used only by users themselves, or by a reference
|
| 340 |
+
implementation, if one exists.
|
| 341 |
+
|
| 342 |
+
Parameters
|
| 343 |
+
----------
|
| 344 |
+
backend
|
| 345 |
+
The backend to register.
|
| 346 |
+
coerce : bool
|
| 347 |
+
Whether to coerce input types when trying this backend.
|
| 348 |
+
only : bool
|
| 349 |
+
If ``True``, no more backends will be tried if this fails.
|
| 350 |
+
Implied by ``coerce=True``.
|
| 351 |
+
try_last : bool
|
| 352 |
+
If ``True``, the global backend is tried after registered backends.
|
| 353 |
+
|
| 354 |
+
See Also
|
| 355 |
+
--------
|
| 356 |
+
set_backend: A context manager that allows setting of backends.
|
| 357 |
+
skip_backend: A context manager that allows skipping of backends.
|
| 358 |
+
"""
|
| 359 |
+
_uarray.set_global_backend(backend, coerce, only, try_last)
|
| 360 |
+
|
| 361 |
+
|
| 362 |
+
def register_backend(backend):
|
| 363 |
+
"""
|
| 364 |
+
This utility method sets registers backend for permanent use. It
|
| 365 |
+
will be tried in the list of backends automatically, unless the
|
| 366 |
+
``only`` flag is set on a backend.
|
| 367 |
+
|
| 368 |
+
Note that this method is not thread-safe.
|
| 369 |
+
|
| 370 |
+
Parameters
|
| 371 |
+
----------
|
| 372 |
+
backend
|
| 373 |
+
The backend to register.
|
| 374 |
+
"""
|
| 375 |
+
_uarray.register_backend(backend)
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
def clear_backends(domain, registered=True, globals=False):
|
| 379 |
+
"""
|
| 380 |
+
This utility method clears registered backends.
|
| 381 |
+
|
| 382 |
+
.. warning::
|
| 383 |
+
We caution library authors against using this function in
|
| 384 |
+
their code. We do *not* support this use-case. This function
|
| 385 |
+
is meant to be used only by users themselves.
|
| 386 |
+
|
| 387 |
+
.. warning::
|
| 388 |
+
Do NOT use this method inside a multimethod call, or the
|
| 389 |
+
program is likely to crash.
|
| 390 |
+
|
| 391 |
+
Parameters
|
| 392 |
+
----------
|
| 393 |
+
domain : Optional[str]
|
| 394 |
+
The domain for which to de-register backends. ``None`` means
|
| 395 |
+
de-register for all domains.
|
| 396 |
+
registered : bool
|
| 397 |
+
Whether or not to clear registered backends. See :obj:`register_backend`.
|
| 398 |
+
globals : bool
|
| 399 |
+
Whether or not to clear global backends. See :obj:`set_global_backend`.
|
| 400 |
+
|
| 401 |
+
See Also
|
| 402 |
+
--------
|
| 403 |
+
register_backend : Register a backend globally.
|
| 404 |
+
set_global_backend : Set a global backend.
|
| 405 |
+
"""
|
| 406 |
+
_uarray.clear_backends(domain, registered, globals)
|
| 407 |
+
|
| 408 |
+
|
| 409 |
+
class Dispatchable:
|
| 410 |
+
"""
|
| 411 |
+
A utility class which marks an argument with a specific dispatch type.
|
| 412 |
+
|
| 413 |
+
|
| 414 |
+
Attributes
|
| 415 |
+
----------
|
| 416 |
+
value
|
| 417 |
+
The value of the Dispatchable.
|
| 418 |
+
|
| 419 |
+
type
|
| 420 |
+
The type of the Dispatchable.
|
| 421 |
+
|
| 422 |
+
Examples
|
| 423 |
+
--------
|
| 424 |
+
>>> x = Dispatchable(1, str)
|
| 425 |
+
>>> x
|
| 426 |
+
<Dispatchable: type=<class 'str'>, value=1>
|
| 427 |
+
|
| 428 |
+
See Also
|
| 429 |
+
--------
|
| 430 |
+
all_of_type
|
| 431 |
+
Marks all unmarked parameters of a function.
|
| 432 |
+
|
| 433 |
+
mark_as
|
| 434 |
+
Allows one to create a utility function to mark as a given type.
|
| 435 |
+
"""
|
| 436 |
+
|
| 437 |
+
def __init__(self, value, dispatch_type, coercible=True):
|
| 438 |
+
self.value = value
|
| 439 |
+
self.type = dispatch_type
|
| 440 |
+
self.coercible = coercible
|
| 441 |
+
|
| 442 |
+
def __getitem__(self, index):
|
| 443 |
+
return (self.type, self.value)[index]
|
| 444 |
+
|
| 445 |
+
def __str__(self):
|
| 446 |
+
return f"<{type(self).__name__}: type={self.type!r}, value={self.value!r}>"
|
| 447 |
+
|
| 448 |
+
__repr__ = __str__
|
| 449 |
+
|
| 450 |
+
|
| 451 |
+
def mark_as(dispatch_type):
|
| 452 |
+
"""
|
| 453 |
+
Creates a utility function to mark something as a specific type.
|
| 454 |
+
|
| 455 |
+
Examples
|
| 456 |
+
--------
|
| 457 |
+
>>> mark_int = mark_as(int)
|
| 458 |
+
>>> mark_int(1)
|
| 459 |
+
<Dispatchable: type=<class 'int'>, value=1>
|
| 460 |
+
"""
|
| 461 |
+
return functools.partial(Dispatchable, dispatch_type=dispatch_type)
|
| 462 |
+
|
| 463 |
+
|
| 464 |
+
def all_of_type(arg_type):
|
| 465 |
+
"""
|
| 466 |
+
Marks all unmarked arguments as a given type.
|
| 467 |
+
|
| 468 |
+
Examples
|
| 469 |
+
--------
|
| 470 |
+
>>> @all_of_type(str)
|
| 471 |
+
... def f(a, b):
|
| 472 |
+
... return a, Dispatchable(b, int)
|
| 473 |
+
>>> f('a', 1)
|
| 474 |
+
(<Dispatchable: type=<class 'str'>, value='a'>,
|
| 475 |
+
<Dispatchable: type=<class 'int'>, value=1>)
|
| 476 |
+
"""
|
| 477 |
+
|
| 478 |
+
def outer(func):
|
| 479 |
+
@functools.wraps(func)
|
| 480 |
+
def inner(*args, **kwargs):
|
| 481 |
+
extracted_args = func(*args, **kwargs)
|
| 482 |
+
return tuple(
|
| 483 |
+
Dispatchable(arg, arg_type)
|
| 484 |
+
if not isinstance(arg, Dispatchable)
|
| 485 |
+
else arg
|
| 486 |
+
for arg in extracted_args
|
| 487 |
+
)
|
| 488 |
+
|
| 489 |
+
return inner
|
| 490 |
+
|
| 491 |
+
return outer
|
| 492 |
+
|
| 493 |
+
|
| 494 |
+
def wrap_single_convertor(convert_single):
|
| 495 |
+
"""
|
| 496 |
+
Wraps a ``__ua_convert__`` defined for a single element to all elements.
|
| 497 |
+
If any of them return ``NotImplemented``, the operation is assumed to be
|
| 498 |
+
undefined.
|
| 499 |
+
|
| 500 |
+
Accepts a signature of (value, type, coerce).
|
| 501 |
+
"""
|
| 502 |
+
|
| 503 |
+
@functools.wraps(convert_single)
|
| 504 |
+
def __ua_convert__(dispatchables, coerce):
|
| 505 |
+
converted = []
|
| 506 |
+
for d in dispatchables:
|
| 507 |
+
c = convert_single(d.value, d.type, coerce and d.coercible)
|
| 508 |
+
|
| 509 |
+
if c is NotImplemented:
|
| 510 |
+
return NotImplemented
|
| 511 |
+
|
| 512 |
+
converted.append(c)
|
| 513 |
+
|
| 514 |
+
return converted
|
| 515 |
+
|
| 516 |
+
return __ua_convert__
|
| 517 |
+
|
| 518 |
+
|
| 519 |
+
def wrap_single_convertor_instance(convert_single):
|
| 520 |
+
"""
|
| 521 |
+
Wraps a ``__ua_convert__`` defined for a single element to all elements.
|
| 522 |
+
If any of them return ``NotImplemented``, the operation is assumed to be
|
| 523 |
+
undefined.
|
| 524 |
+
|
| 525 |
+
Accepts a signature of (value, type, coerce).
|
| 526 |
+
"""
|
| 527 |
+
|
| 528 |
+
@functools.wraps(convert_single)
|
| 529 |
+
def __ua_convert__(self, dispatchables, coerce):
|
| 530 |
+
converted = []
|
| 531 |
+
for d in dispatchables:
|
| 532 |
+
c = convert_single(self, d.value, d.type, coerce and d.coercible)
|
| 533 |
+
|
| 534 |
+
if c is NotImplemented:
|
| 535 |
+
return NotImplemented
|
| 536 |
+
|
| 537 |
+
converted.append(c)
|
| 538 |
+
|
| 539 |
+
return converted
|
| 540 |
+
|
| 541 |
+
return __ua_convert__
|
| 542 |
+
|
| 543 |
+
|
| 544 |
+
def determine_backend(value, dispatch_type, *, domain, only=True, coerce=False):
|
| 545 |
+
"""Set the backend to the first active backend that supports ``value``
|
| 546 |
+
|
| 547 |
+
This is useful for functions that call multimethods without any dispatchable
|
| 548 |
+
arguments. You can use :func:`determine_backend` to ensure the same backend
|
| 549 |
+
is used everywhere in a block of multimethod calls.
|
| 550 |
+
|
| 551 |
+
Parameters
|
| 552 |
+
----------
|
| 553 |
+
value
|
| 554 |
+
The value being tested
|
| 555 |
+
dispatch_type
|
| 556 |
+
The dispatch type associated with ``value``, aka
|
| 557 |
+
":ref:`marking <MarkingGlossary>`".
|
| 558 |
+
domain: string
|
| 559 |
+
The domain to query for backends and set.
|
| 560 |
+
coerce: bool
|
| 561 |
+
Whether or not to allow coercion to the backend's types. Implies ``only``.
|
| 562 |
+
only: bool
|
| 563 |
+
Whether or not this should be the last backend to try.
|
| 564 |
+
|
| 565 |
+
See Also
|
| 566 |
+
--------
|
| 567 |
+
set_backend: For when you know which backend to set
|
| 568 |
+
|
| 569 |
+
Notes
|
| 570 |
+
-----
|
| 571 |
+
|
| 572 |
+
Support is determined by the ``__ua_convert__`` protocol. Backends not
|
| 573 |
+
supporting the type must return ``NotImplemented`` from their
|
| 574 |
+
``__ua_convert__`` if they don't support input of that type.
|
| 575 |
+
|
| 576 |
+
Examples
|
| 577 |
+
--------
|
| 578 |
+
|
| 579 |
+
Suppose we have two backends ``BackendA`` and ``BackendB`` each supporting
|
| 580 |
+
different types, ``TypeA`` and ``TypeB``. Neither supporting the other type:
|
| 581 |
+
|
| 582 |
+
>>> with ua.set_backend(ex.BackendA):
|
| 583 |
+
... ex.call_multimethod(ex.TypeB(), ex.TypeB())
|
| 584 |
+
Traceback (most recent call last):
|
| 585 |
+
...
|
| 586 |
+
uarray.BackendNotImplementedError: ...
|
| 587 |
+
|
| 588 |
+
Now consider a multimethod that creates a new object of ``TypeA``, or
|
| 589 |
+
``TypeB`` depending on the active backend.
|
| 590 |
+
|
| 591 |
+
>>> with ua.set_backend(ex.BackendA), ua.set_backend(ex.BackendB):
|
| 592 |
+
... res = ex.creation_multimethod()
|
| 593 |
+
... ex.call_multimethod(res, ex.TypeA())
|
| 594 |
+
Traceback (most recent call last):
|
| 595 |
+
...
|
| 596 |
+
uarray.BackendNotImplementedError: ...
|
| 597 |
+
|
| 598 |
+
``res`` is an object of ``TypeB`` because ``BackendB`` is set in the
|
| 599 |
+
innermost with statement. So, ``call_multimethod`` fails since the types
|
| 600 |
+
don't match.
|
| 601 |
+
|
| 602 |
+
Instead, we need to first find a backend suitable for all of our objects.
|
| 603 |
+
|
| 604 |
+
>>> with ua.set_backend(ex.BackendA), ua.set_backend(ex.BackendB):
|
| 605 |
+
... x = ex.TypeA()
|
| 606 |
+
... with ua.determine_backend(x, "mark", domain="ua_examples"):
|
| 607 |
+
... res = ex.creation_multimethod()
|
| 608 |
+
... ex.call_multimethod(res, x)
|
| 609 |
+
TypeA
|
| 610 |
+
|
| 611 |
+
"""
|
| 612 |
+
dispatchables = (Dispatchable(value, dispatch_type, coerce),)
|
| 613 |
+
backend = _uarray.determine_backend(domain, dispatchables, coerce)
|
| 614 |
+
|
| 615 |
+
return set_backend(backend, coerce=coerce, only=only)
|
| 616 |
+
|
| 617 |
+
|
| 618 |
+
def determine_backend_multi(
|
| 619 |
+
dispatchables, *, domain, only=True, coerce=False, **kwargs
|
| 620 |
+
):
|
| 621 |
+
"""Set a backend supporting all ``dispatchables``
|
| 622 |
+
|
| 623 |
+
This is useful for functions that call multimethods without any dispatchable
|
| 624 |
+
arguments. You can use :func:`determine_backend_multi` to ensure the same
|
| 625 |
+
backend is used everywhere in a block of multimethod calls involving
|
| 626 |
+
multiple arrays.
|
| 627 |
+
|
| 628 |
+
Parameters
|
| 629 |
+
----------
|
| 630 |
+
dispatchables: Sequence[Union[uarray.Dispatchable, Any]]
|
| 631 |
+
The dispatchables that must be supported
|
| 632 |
+
domain: string
|
| 633 |
+
The domain to query for backends and set.
|
| 634 |
+
coerce: bool
|
| 635 |
+
Whether or not to allow coercion to the backend's types. Implies ``only``.
|
| 636 |
+
only: bool
|
| 637 |
+
Whether or not this should be the last backend to try.
|
| 638 |
+
dispatch_type: Optional[Any]
|
| 639 |
+
The default dispatch type associated with ``dispatchables``, aka
|
| 640 |
+
":ref:`marking <MarkingGlossary>`".
|
| 641 |
+
|
| 642 |
+
See Also
|
| 643 |
+
--------
|
| 644 |
+
determine_backend: For a single dispatch value
|
| 645 |
+
set_backend: For when you know which backend to set
|
| 646 |
+
|
| 647 |
+
Notes
|
| 648 |
+
-----
|
| 649 |
+
|
| 650 |
+
Support is determined by the ``__ua_convert__`` protocol. Backends not
|
| 651 |
+
supporting the type must return ``NotImplemented`` from their
|
| 652 |
+
``__ua_convert__`` if they don't support input of that type.
|
| 653 |
+
|
| 654 |
+
Examples
|
| 655 |
+
--------
|
| 656 |
+
|
| 657 |
+
:func:`determine_backend` allows the backend to be set from a single
|
| 658 |
+
object. :func:`determine_backend_multi` allows multiple objects to be
|
| 659 |
+
checked simultaneously for support in the backend. Suppose we have a
|
| 660 |
+
``BackendAB`` which supports ``TypeA`` and ``TypeB`` in the same call,
|
| 661 |
+
and a ``BackendBC`` that doesn't support ``TypeA``.
|
| 662 |
+
|
| 663 |
+
>>> with ua.set_backend(ex.BackendAB), ua.set_backend(ex.BackendBC):
|
| 664 |
+
... a, b = ex.TypeA(), ex.TypeB()
|
| 665 |
+
... with ua.determine_backend_multi(
|
| 666 |
+
... [ua.Dispatchable(a, "mark"), ua.Dispatchable(b, "mark")],
|
| 667 |
+
... domain="ua_examples"
|
| 668 |
+
... ):
|
| 669 |
+
... res = ex.creation_multimethod()
|
| 670 |
+
... ex.call_multimethod(res, a, b)
|
| 671 |
+
TypeA
|
| 672 |
+
|
| 673 |
+
This won't call ``BackendBC`` because it doesn't support ``TypeA``.
|
| 674 |
+
|
| 675 |
+
We can also use leave out the ``ua.Dispatchable`` if we specify the
|
| 676 |
+
default ``dispatch_type`` for the ``dispatchables`` argument.
|
| 677 |
+
|
| 678 |
+
>>> with ua.set_backend(ex.BackendAB), ua.set_backend(ex.BackendBC):
|
| 679 |
+
... a, b = ex.TypeA(), ex.TypeB()
|
| 680 |
+
... with ua.determine_backend_multi(
|
| 681 |
+
... [a, b], dispatch_type="mark", domain="ua_examples"
|
| 682 |
+
... ):
|
| 683 |
+
... res = ex.creation_multimethod()
|
| 684 |
+
... ex.call_multimethod(res, a, b)
|
| 685 |
+
TypeA
|
| 686 |
+
|
| 687 |
+
"""
|
| 688 |
+
if "dispatch_type" in kwargs:
|
| 689 |
+
disp_type = kwargs.pop("dispatch_type")
|
| 690 |
+
dispatchables = tuple(
|
| 691 |
+
d if isinstance(d, Dispatchable) else Dispatchable(d, disp_type)
|
| 692 |
+
for d in dispatchables
|
| 693 |
+
)
|
| 694 |
+
else:
|
| 695 |
+
dispatchables = tuple(dispatchables)
|
| 696 |
+
if not all(isinstance(d, Dispatchable) for d in dispatchables):
|
| 697 |
+
raise TypeError("dispatchables must be instances of uarray.Dispatchable")
|
| 698 |
+
|
| 699 |
+
if len(kwargs) != 0:
|
| 700 |
+
raise TypeError(f"Received unexpected keyword arguments: {kwargs}")
|
| 701 |
+
|
| 702 |
+
backend = _uarray.determine_backend(domain, dispatchables, coerce)
|
| 703 |
+
|
| 704 |
+
return set_backend(backend, coerce=coerce, only=only)
|
.venv/Lib/site-packages/scipy/_lib/_uarray/_uarray.cp39-win_amd64.dll.a
ADDED
|
Binary file (1.54 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/_uarray/_uarray.cp39-win_amd64.pyd
ADDED
|
Binary file (233 kB). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/array_api_compat/cupy/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from cupy import *
|
| 2 |
+
|
| 3 |
+
# from cupy import * doesn't overwrite these builtin names
|
| 4 |
+
from cupy import abs, max, min, round
|
| 5 |
+
|
| 6 |
+
# These imports may overwrite names from the import * above.
|
| 7 |
+
from ._aliases import *
|
| 8 |
+
|
| 9 |
+
# See the comment in the numpy __init__.py
|
| 10 |
+
__import__(__package__ + '.linalg')
|
| 11 |
+
|
| 12 |
+
from .linalg import matrix_transpose, vecdot
|
| 13 |
+
|
| 14 |
+
from ..common._helpers import *
|
| 15 |
+
|
| 16 |
+
__array_api_version__ = '2022.12'
|
.venv/Lib/site-packages/scipy/_lib/array_api_compat/cupy/_typing.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
__all__ = [
|
| 4 |
+
"ndarray",
|
| 5 |
+
"Device",
|
| 6 |
+
"Dtype",
|
| 7 |
+
]
|
| 8 |
+
|
| 9 |
+
import sys
|
| 10 |
+
from typing import (
|
| 11 |
+
Union,
|
| 12 |
+
TYPE_CHECKING,
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
from cupy import (
|
| 16 |
+
ndarray,
|
| 17 |
+
dtype,
|
| 18 |
+
int8,
|
| 19 |
+
int16,
|
| 20 |
+
int32,
|
| 21 |
+
int64,
|
| 22 |
+
uint8,
|
| 23 |
+
uint16,
|
| 24 |
+
uint32,
|
| 25 |
+
uint64,
|
| 26 |
+
float32,
|
| 27 |
+
float64,
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
from cupy.cuda.device import Device
|
| 31 |
+
|
| 32 |
+
if TYPE_CHECKING or sys.version_info >= (3, 9):
|
| 33 |
+
Dtype = dtype[Union[
|
| 34 |
+
int8,
|
| 35 |
+
int16,
|
| 36 |
+
int32,
|
| 37 |
+
int64,
|
| 38 |
+
uint8,
|
| 39 |
+
uint16,
|
| 40 |
+
uint32,
|
| 41 |
+
uint64,
|
| 42 |
+
float32,
|
| 43 |
+
float64,
|
| 44 |
+
]]
|
| 45 |
+
else:
|
| 46 |
+
Dtype = dtype
|
.venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/__init__.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from numpy import *
|
| 2 |
+
|
| 3 |
+
# from numpy import * doesn't overwrite these builtin names
|
| 4 |
+
from numpy import abs, max, min, round
|
| 5 |
+
|
| 6 |
+
# These imports may overwrite names from the import * above.
|
| 7 |
+
from ._aliases import *
|
| 8 |
+
|
| 9 |
+
# Don't know why, but we have to do an absolute import to import linalg. If we
|
| 10 |
+
# instead do
|
| 11 |
+
#
|
| 12 |
+
# from . import linalg
|
| 13 |
+
#
|
| 14 |
+
# It doesn't overwrite np.linalg from above. The import is generated
|
| 15 |
+
# dynamically so that the library can be vendored.
|
| 16 |
+
__import__(__package__ + '.linalg')
|
| 17 |
+
|
| 18 |
+
from .linalg import matrix_transpose, vecdot
|
| 19 |
+
|
| 20 |
+
from ..common._helpers import *
|
| 21 |
+
|
| 22 |
+
__array_api_version__ = '2022.12'
|
.venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/__pycache__/linalg.cpython-39.pyc
ADDED
|
Binary file (987 Bytes). View file
|
|
|
.venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/_aliases.py
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from functools import partial
|
| 4 |
+
|
| 5 |
+
from ..common import _aliases
|
| 6 |
+
|
| 7 |
+
from .._internal import get_xp
|
| 8 |
+
|
| 9 |
+
asarray = asarray_numpy = partial(_aliases._asarray, namespace='numpy')
|
| 10 |
+
asarray.__doc__ = _aliases._asarray.__doc__
|
| 11 |
+
del partial
|
| 12 |
+
|
| 13 |
+
import numpy as np
|
| 14 |
+
bool = np.bool_
|
| 15 |
+
|
| 16 |
+
# Basic renames
|
| 17 |
+
acos = np.arccos
|
| 18 |
+
acosh = np.arccosh
|
| 19 |
+
asin = np.arcsin
|
| 20 |
+
asinh = np.arcsinh
|
| 21 |
+
atan = np.arctan
|
| 22 |
+
atan2 = np.arctan2
|
| 23 |
+
atanh = np.arctanh
|
| 24 |
+
bitwise_left_shift = np.left_shift
|
| 25 |
+
bitwise_invert = np.invert
|
| 26 |
+
bitwise_right_shift = np.right_shift
|
| 27 |
+
concat = np.concatenate
|
| 28 |
+
pow = np.power
|
| 29 |
+
|
| 30 |
+
arange = get_xp(np)(_aliases.arange)
|
| 31 |
+
empty = get_xp(np)(_aliases.empty)
|
| 32 |
+
empty_like = get_xp(np)(_aliases.empty_like)
|
| 33 |
+
eye = get_xp(np)(_aliases.eye)
|
| 34 |
+
full = get_xp(np)(_aliases.full)
|
| 35 |
+
full_like = get_xp(np)(_aliases.full_like)
|
| 36 |
+
linspace = get_xp(np)(_aliases.linspace)
|
| 37 |
+
ones = get_xp(np)(_aliases.ones)
|
| 38 |
+
ones_like = get_xp(np)(_aliases.ones_like)
|
| 39 |
+
zeros = get_xp(np)(_aliases.zeros)
|
| 40 |
+
zeros_like = get_xp(np)(_aliases.zeros_like)
|
| 41 |
+
UniqueAllResult = get_xp(np)(_aliases.UniqueAllResult)
|
| 42 |
+
UniqueCountsResult = get_xp(np)(_aliases.UniqueCountsResult)
|
| 43 |
+
UniqueInverseResult = get_xp(np)(_aliases.UniqueInverseResult)
|
| 44 |
+
unique_all = get_xp(np)(_aliases.unique_all)
|
| 45 |
+
unique_counts = get_xp(np)(_aliases.unique_counts)
|
| 46 |
+
unique_inverse = get_xp(np)(_aliases.unique_inverse)
|
| 47 |
+
unique_values = get_xp(np)(_aliases.unique_values)
|
| 48 |
+
astype = _aliases.astype
|
| 49 |
+
std = get_xp(np)(_aliases.std)
|
| 50 |
+
var = get_xp(np)(_aliases.var)
|
| 51 |
+
permute_dims = get_xp(np)(_aliases.permute_dims)
|
| 52 |
+
reshape = get_xp(np)(_aliases.reshape)
|
| 53 |
+
argsort = get_xp(np)(_aliases.argsort)
|
| 54 |
+
sort = get_xp(np)(_aliases.sort)
|
| 55 |
+
nonzero = get_xp(np)(_aliases.nonzero)
|
| 56 |
+
sum = get_xp(np)(_aliases.sum)
|
| 57 |
+
prod = get_xp(np)(_aliases.prod)
|
| 58 |
+
ceil = get_xp(np)(_aliases.ceil)
|
| 59 |
+
floor = get_xp(np)(_aliases.floor)
|
| 60 |
+
trunc = get_xp(np)(_aliases.trunc)
|
| 61 |
+
matmul = get_xp(np)(_aliases.matmul)
|
| 62 |
+
matrix_transpose = get_xp(np)(_aliases.matrix_transpose)
|
| 63 |
+
tensordot = get_xp(np)(_aliases.tensordot)
|
| 64 |
+
|
| 65 |
+
# These functions are completely new here. If the library already has them
|
| 66 |
+
# (i.e., numpy 2.0), use the library version instead of our wrapper.
|
| 67 |
+
if hasattr(np, 'vecdot'):
|
| 68 |
+
vecdot = np.vecdot
|
| 69 |
+
else:
|
| 70 |
+
vecdot = get_xp(np)(_aliases.vecdot)
|
| 71 |
+
if hasattr(np, 'isdtype'):
|
| 72 |
+
isdtype = np.isdtype
|
| 73 |
+
else:
|
| 74 |
+
isdtype = get_xp(np)(_aliases.isdtype)
|
| 75 |
+
|
| 76 |
+
__all__ = _aliases.__all__ + ['asarray', 'asarray_numpy', 'bool', 'acos',
|
| 77 |
+
'acosh', 'asin', 'asinh', 'atan', 'atan2',
|
| 78 |
+
'atanh', 'bitwise_left_shift', 'bitwise_invert',
|
| 79 |
+
'bitwise_right_shift', 'concat', 'pow']
|
.venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/_typing.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
__all__ = [
|
| 4 |
+
"ndarray",
|
| 5 |
+
"Device",
|
| 6 |
+
"Dtype",
|
| 7 |
+
]
|
| 8 |
+
|
| 9 |
+
import sys
|
| 10 |
+
from typing import (
|
| 11 |
+
Literal,
|
| 12 |
+
Union,
|
| 13 |
+
TYPE_CHECKING,
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
from numpy import (
|
| 17 |
+
ndarray,
|
| 18 |
+
dtype,
|
| 19 |
+
int8,
|
| 20 |
+
int16,
|
| 21 |
+
int32,
|
| 22 |
+
int64,
|
| 23 |
+
uint8,
|
| 24 |
+
uint16,
|
| 25 |
+
uint32,
|
| 26 |
+
uint64,
|
| 27 |
+
float32,
|
| 28 |
+
float64,
|
| 29 |
+
)
|
| 30 |
+
|
| 31 |
+
Device = Literal["cpu"]
|
| 32 |
+
if TYPE_CHECKING or sys.version_info >= (3, 9):
|
| 33 |
+
Dtype = dtype[Union[
|
| 34 |
+
int8,
|
| 35 |
+
int16,
|
| 36 |
+
int32,
|
| 37 |
+
int64,
|
| 38 |
+
uint8,
|
| 39 |
+
uint16,
|
| 40 |
+
uint32,
|
| 41 |
+
uint64,
|
| 42 |
+
float32,
|
| 43 |
+
float64,
|
| 44 |
+
]]
|
| 45 |
+
else:
|
| 46 |
+
Dtype = dtype
|
.venv/Lib/site-packages/scipy/_lib/array_api_compat/numpy/linalg.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from numpy.linalg import *
|
| 2 |
+
from numpy.linalg import __all__ as linalg_all
|
| 3 |
+
|
| 4 |
+
from ..common import _linalg
|
| 5 |
+
from .._internal import get_xp
|
| 6 |
+
from ._aliases import (matmul, matrix_transpose, tensordot, vecdot)
|
| 7 |
+
|
| 8 |
+
import numpy as np
|
| 9 |
+
|
| 10 |
+
cross = get_xp(np)(_linalg.cross)
|
| 11 |
+
outer = get_xp(np)(_linalg.outer)
|
| 12 |
+
EighResult = _linalg.EighResult
|
| 13 |
+
QRResult = _linalg.QRResult
|
| 14 |
+
SlogdetResult = _linalg.SlogdetResult
|
| 15 |
+
SVDResult = _linalg.SVDResult
|
| 16 |
+
eigh = get_xp(np)(_linalg.eigh)
|
| 17 |
+
qr = get_xp(np)(_linalg.qr)
|
| 18 |
+
slogdet = get_xp(np)(_linalg.slogdet)
|
| 19 |
+
svd = get_xp(np)(_linalg.svd)
|
| 20 |
+
cholesky = get_xp(np)(_linalg.cholesky)
|
| 21 |
+
matrix_rank = get_xp(np)(_linalg.matrix_rank)
|
| 22 |
+
pinv = get_xp(np)(_linalg.pinv)
|
| 23 |
+
matrix_norm = get_xp(np)(_linalg.matrix_norm)
|
| 24 |
+
svdvals = get_xp(np)(_linalg.svdvals)
|
| 25 |
+
diagonal = get_xp(np)(_linalg.diagonal)
|
| 26 |
+
trace = get_xp(np)(_linalg.trace)
|
| 27 |
+
|
| 28 |
+
# These functions are completely new here. If the library already has them
|
| 29 |
+
# (i.e., numpy 2.0), use the library version instead of our wrapper.
|
| 30 |
+
if hasattr(np.linalg, 'vector_norm'):
|
| 31 |
+
vector_norm = np.linalg.vector_norm
|
| 32 |
+
else:
|
| 33 |
+
vector_norm = get_xp(np)(_linalg.vector_norm)
|
| 34 |
+
|
| 35 |
+
__all__ = linalg_all + _linalg.__all__
|
| 36 |
+
|
| 37 |
+
del get_xp
|
| 38 |
+
del np
|
| 39 |
+
del linalg_all
|
| 40 |
+
del _linalg
|
.venv/Lib/site-packages/scipy/_lib/tests/__init__.py
ADDED
|
File without changes
|
.venv/Lib/site-packages/scipy/_lib/tests/test__gcutils.py
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
""" Test for assert_deallocated context manager and gc utilities
|
| 2 |
+
"""
|
| 3 |
+
import gc
|
| 4 |
+
|
| 5 |
+
from scipy._lib._gcutils import (set_gc_state, gc_state, assert_deallocated,
|
| 6 |
+
ReferenceError, IS_PYPY)
|
| 7 |
+
|
| 8 |
+
from numpy.testing import assert_equal
|
| 9 |
+
|
| 10 |
+
import pytest
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def test_set_gc_state():
|
| 14 |
+
gc_status = gc.isenabled()
|
| 15 |
+
try:
|
| 16 |
+
for state in (True, False):
|
| 17 |
+
gc.enable()
|
| 18 |
+
set_gc_state(state)
|
| 19 |
+
assert_equal(gc.isenabled(), state)
|
| 20 |
+
gc.disable()
|
| 21 |
+
set_gc_state(state)
|
| 22 |
+
assert_equal(gc.isenabled(), state)
|
| 23 |
+
finally:
|
| 24 |
+
if gc_status:
|
| 25 |
+
gc.enable()
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def test_gc_state():
|
| 29 |
+
# Test gc_state context manager
|
| 30 |
+
gc_status = gc.isenabled()
|
| 31 |
+
try:
|
| 32 |
+
for pre_state in (True, False):
|
| 33 |
+
set_gc_state(pre_state)
|
| 34 |
+
for with_state in (True, False):
|
| 35 |
+
# Check the gc state is with_state in with block
|
| 36 |
+
with gc_state(with_state):
|
| 37 |
+
assert_equal(gc.isenabled(), with_state)
|
| 38 |
+
# And returns to previous state outside block
|
| 39 |
+
assert_equal(gc.isenabled(), pre_state)
|
| 40 |
+
# Even if the gc state is set explicitly within the block
|
| 41 |
+
with gc_state(with_state):
|
| 42 |
+
assert_equal(gc.isenabled(), with_state)
|
| 43 |
+
set_gc_state(not with_state)
|
| 44 |
+
assert_equal(gc.isenabled(), pre_state)
|
| 45 |
+
finally:
|
| 46 |
+
if gc_status:
|
| 47 |
+
gc.enable()
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
@pytest.mark.skipif(IS_PYPY, reason="Test not meaningful on PyPy")
|
| 51 |
+
def test_assert_deallocated():
|
| 52 |
+
# Ordinary use
|
| 53 |
+
class C:
|
| 54 |
+
def __init__(self, arg0, arg1, name='myname'):
|
| 55 |
+
self.name = name
|
| 56 |
+
for gc_current in (True, False):
|
| 57 |
+
with gc_state(gc_current):
|
| 58 |
+
# We are deleting from with-block context, so that's OK
|
| 59 |
+
with assert_deallocated(C, 0, 2, 'another name') as c:
|
| 60 |
+
assert_equal(c.name, 'another name')
|
| 61 |
+
del c
|
| 62 |
+
# Or not using the thing in with-block context, also OK
|
| 63 |
+
with assert_deallocated(C, 0, 2, name='third name'):
|
| 64 |
+
pass
|
| 65 |
+
assert_equal(gc.isenabled(), gc_current)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
@pytest.mark.skipif(IS_PYPY, reason="Test not meaningful on PyPy")
|
| 69 |
+
def test_assert_deallocated_nodel():
|
| 70 |
+
class C:
|
| 71 |
+
pass
|
| 72 |
+
with pytest.raises(ReferenceError):
|
| 73 |
+
# Need to delete after using if in with-block context
|
| 74 |
+
# Note: assert_deallocated(C) needs to be assigned for the test
|
| 75 |
+
# to function correctly. It is assigned to _, but _ itself is
|
| 76 |
+
# not referenced in the body of the with, it is only there for
|
| 77 |
+
# the refcount.
|
| 78 |
+
with assert_deallocated(C) as _:
|
| 79 |
+
pass
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
@pytest.mark.skipif(IS_PYPY, reason="Test not meaningful on PyPy")
|
| 83 |
+
def test_assert_deallocated_circular():
|
| 84 |
+
class C:
|
| 85 |
+
def __init__(self):
|
| 86 |
+
self._circular = self
|
| 87 |
+
with pytest.raises(ReferenceError):
|
| 88 |
+
# Circular reference, no automatic garbage collection
|
| 89 |
+
with assert_deallocated(C) as c:
|
| 90 |
+
del c
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
@pytest.mark.skipif(IS_PYPY, reason="Test not meaningful on PyPy")
|
| 94 |
+
def test_assert_deallocated_circular2():
|
| 95 |
+
class C:
|
| 96 |
+
def __init__(self):
|
| 97 |
+
self._circular = self
|
| 98 |
+
with pytest.raises(ReferenceError):
|
| 99 |
+
# Still circular reference, no automatic garbage collection
|
| 100 |
+
with assert_deallocated(C):
|
| 101 |
+
pass
|
.venv/Lib/site-packages/scipy/_lib/tests/test__pep440.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pytest import raises as assert_raises
|
| 2 |
+
from scipy._lib._pep440 import Version, parse
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def test_main_versions():
|
| 6 |
+
assert Version('1.8.0') == Version('1.8.0')
|
| 7 |
+
for ver in ['1.9.0', '2.0.0', '1.8.1']:
|
| 8 |
+
assert Version('1.8.0') < Version(ver)
|
| 9 |
+
|
| 10 |
+
for ver in ['1.7.0', '1.7.1', '0.9.9']:
|
| 11 |
+
assert Version('1.8.0') > Version(ver)
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def test_version_1_point_10():
|
| 15 |
+
# regression test for gh-2998.
|
| 16 |
+
assert Version('1.9.0') < Version('1.10.0')
|
| 17 |
+
assert Version('1.11.0') < Version('1.11.1')
|
| 18 |
+
assert Version('1.11.0') == Version('1.11.0')
|
| 19 |
+
assert Version('1.99.11') < Version('1.99.12')
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def test_alpha_beta_rc():
|
| 23 |
+
assert Version('1.8.0rc1') == Version('1.8.0rc1')
|
| 24 |
+
for ver in ['1.8.0', '1.8.0rc2']:
|
| 25 |
+
assert Version('1.8.0rc1') < Version(ver)
|
| 26 |
+
|
| 27 |
+
for ver in ['1.8.0a2', '1.8.0b3', '1.7.2rc4']:
|
| 28 |
+
assert Version('1.8.0rc1') > Version(ver)
|
| 29 |
+
|
| 30 |
+
assert Version('1.8.0b1') > Version('1.8.0a2')
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def test_dev_version():
|
| 34 |
+
assert Version('1.9.0.dev+Unknown') < Version('1.9.0')
|
| 35 |
+
for ver in ['1.9.0', '1.9.0a1', '1.9.0b2', '1.9.0b2.dev+ffffffff', '1.9.0.dev1']:
|
| 36 |
+
assert Version('1.9.0.dev+f16acvda') < Version(ver)
|
| 37 |
+
|
| 38 |
+
assert Version('1.9.0.dev+f16acvda') == Version('1.9.0.dev+f16acvda')
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def test_dev_a_b_rc_mixed():
|
| 42 |
+
assert Version('1.9.0a2.dev+f16acvda') == Version('1.9.0a2.dev+f16acvda')
|
| 43 |
+
assert Version('1.9.0a2.dev+6acvda54') < Version('1.9.0a2')
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def test_dev0_version():
|
| 47 |
+
assert Version('1.9.0.dev0+Unknown') < Version('1.9.0')
|
| 48 |
+
for ver in ['1.9.0', '1.9.0a1', '1.9.0b2', '1.9.0b2.dev0+ffffffff']:
|
| 49 |
+
assert Version('1.9.0.dev0+f16acvda') < Version(ver)
|
| 50 |
+
|
| 51 |
+
assert Version('1.9.0.dev0+f16acvda') == Version('1.9.0.dev0+f16acvda')
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
def test_dev0_a_b_rc_mixed():
|
| 55 |
+
assert Version('1.9.0a2.dev0+f16acvda') == Version('1.9.0a2.dev0+f16acvda')
|
| 56 |
+
assert Version('1.9.0a2.dev0+6acvda54') < Version('1.9.0a2')
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
def test_raises():
|
| 60 |
+
for ver in ['1,9.0', '1.7.x']:
|
| 61 |
+
assert_raises(ValueError, Version, ver)
|
| 62 |
+
|
| 63 |
+
def test_legacy_version():
|
| 64 |
+
# Non-PEP-440 version identifiers always compare less. For NumPy this only
|
| 65 |
+
# occurs on dev builds prior to 1.10.0 which are unsupported anyway.
|
| 66 |
+
assert parse('invalid') < Version('0.0.0')
|
| 67 |
+
assert parse('1.9.0-f16acvda') < Version('1.0.0')
|
.venv/Lib/site-packages/scipy/_lib/tests/test__testutils.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from scipy._lib._testutils import _parse_size, _get_mem_available
|
| 3 |
+
import pytest
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def test__parse_size():
|
| 7 |
+
expected = {
|
| 8 |
+
'12': 12e6,
|
| 9 |
+
'12 b': 12,
|
| 10 |
+
'12k': 12e3,
|
| 11 |
+
' 12 M ': 12e6,
|
| 12 |
+
' 12 G ': 12e9,
|
| 13 |
+
' 12Tb ': 12e12,
|
| 14 |
+
'12 Mib ': 12 * 1024.0**2,
|
| 15 |
+
'12Tib': 12 * 1024.0**4,
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
for inp, outp in sorted(expected.items()):
|
| 19 |
+
if outp is None:
|
| 20 |
+
with pytest.raises(ValueError):
|
| 21 |
+
_parse_size(inp)
|
| 22 |
+
else:
|
| 23 |
+
assert _parse_size(inp) == outp
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def test__mem_available():
|
| 27 |
+
# May return None on non-Linux platforms
|
| 28 |
+
available = _get_mem_available()
|
| 29 |
+
if sys.platform.startswith('linux'):
|
| 30 |
+
assert available >= 0
|
| 31 |
+
else:
|
| 32 |
+
assert available is None or available >= 0
|
.venv/Lib/site-packages/scipy/_lib/tests/test__threadsafety.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import threading
|
| 2 |
+
import time
|
| 3 |
+
import traceback
|
| 4 |
+
|
| 5 |
+
from numpy.testing import assert_
|
| 6 |
+
from pytest import raises as assert_raises
|
| 7 |
+
|
| 8 |
+
from scipy._lib._threadsafety import ReentrancyLock, non_reentrant, ReentrancyError
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def test_parallel_threads():
|
| 12 |
+
# Check that ReentrancyLock serializes work in parallel threads.
|
| 13 |
+
#
|
| 14 |
+
# The test is not fully deterministic, and may succeed falsely if
|
| 15 |
+
# the timings go wrong.
|
| 16 |
+
|
| 17 |
+
lock = ReentrancyLock("failure")
|
| 18 |
+
|
| 19 |
+
failflag = [False]
|
| 20 |
+
exceptions_raised = []
|
| 21 |
+
|
| 22 |
+
def worker(k):
|
| 23 |
+
try:
|
| 24 |
+
with lock:
|
| 25 |
+
assert_(not failflag[0])
|
| 26 |
+
failflag[0] = True
|
| 27 |
+
time.sleep(0.1 * k)
|
| 28 |
+
assert_(failflag[0])
|
| 29 |
+
failflag[0] = False
|
| 30 |
+
except Exception:
|
| 31 |
+
exceptions_raised.append(traceback.format_exc(2))
|
| 32 |
+
|
| 33 |
+
threads = [threading.Thread(target=lambda k=k: worker(k))
|
| 34 |
+
for k in range(3)]
|
| 35 |
+
for t in threads:
|
| 36 |
+
t.start()
|
| 37 |
+
for t in threads:
|
| 38 |
+
t.join()
|
| 39 |
+
|
| 40 |
+
exceptions_raised = "\n".join(exceptions_raised)
|
| 41 |
+
assert_(not exceptions_raised, exceptions_raised)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def test_reentering():
|
| 45 |
+
# Check that ReentrancyLock prevents re-entering from the same thread.
|
| 46 |
+
|
| 47 |
+
@non_reentrant()
|
| 48 |
+
def func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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from multiprocessing import Pool
|
| 2 |
+
from multiprocessing.pool import Pool as PWL
|
| 3 |
+
import re
|
| 4 |
+
import math
|
| 5 |
+
from fractions import Fraction
|
| 6 |
+
|
| 7 |
+
import numpy as np
|
| 8 |
+
from numpy.testing import assert_equal, assert_
|
| 9 |
+
import pytest
|
| 10 |
+
from pytest import raises as assert_raises
|
| 11 |
+
import hypothesis.extra.numpy as npst
|
| 12 |
+
from hypothesis import given, strategies, reproduce_failure # noqa: F401
|
| 13 |
+
from scipy.conftest import array_api_compatible
|
| 14 |
+
|
| 15 |
+
from scipy._lib._array_api import xp_assert_equal
|
| 16 |
+
from scipy._lib._util import (_aligned_zeros, check_random_state, MapWrapper,
|
| 17 |
+
getfullargspec_no_self, FullArgSpec,
|
| 18 |
+
rng_integers, _validate_int, _rename_parameter,
|
| 19 |
+
_contains_nan, _rng_html_rewrite, _lazywhere)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def test__aligned_zeros():
|
| 23 |
+
niter = 10
|
| 24 |
+
|
| 25 |
+
def check(shape, dtype, order, align):
|
| 26 |
+
err_msg = repr((shape, dtype, order, align))
|
| 27 |
+
x = _aligned_zeros(shape, dtype, order, align=align)
|
| 28 |
+
if align is None:
|
| 29 |
+
align = np.dtype(dtype).alignment
|
| 30 |
+
assert_equal(x.__array_interface__['data'][0] % align, 0)
|
| 31 |
+
if hasattr(shape, '__len__'):
|
| 32 |
+
assert_equal(x.shape, shape, err_msg)
|
| 33 |
+
else:
|
| 34 |
+
assert_equal(x.shape, (shape,), err_msg)
|
| 35 |
+
assert_equal(x.dtype, dtype)
|
| 36 |
+
if order == "C":
|
| 37 |
+
assert_(x.flags.c_contiguous, err_msg)
|
| 38 |
+
elif order == "F":
|
| 39 |
+
if x.size > 0:
|
| 40 |
+
# Size-0 arrays get invalid flags on NumPy 1.5
|
| 41 |
+
assert_(x.flags.f_contiguous, err_msg)
|
| 42 |
+
elif order is None:
|
| 43 |
+
assert_(x.flags.c_contiguous, err_msg)
|
| 44 |
+
else:
|
| 45 |
+
raise ValueError()
|
| 46 |
+
|
| 47 |
+
# try various alignments
|
| 48 |
+
for align in [1, 2, 3, 4, 8, 16, 32, 64, None]:
|
| 49 |
+
for n in [0, 1, 3, 11]:
|
| 50 |
+
for order in ["C", "F", None]:
|
| 51 |
+
for dtype in [np.uint8, np.float64]:
|
| 52 |
+
for shape in [n, (1, 2, 3, n)]:
|
| 53 |
+
for j in range(niter):
|
| 54 |
+
check(shape, dtype, order, align)
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def test_check_random_state():
|
| 58 |
+
# If seed is None, return the RandomState singleton used by np.random.
|
| 59 |
+
# If seed is an int, return a new RandomState instance seeded with seed.
|
| 60 |
+
# If seed is already a RandomState instance, return it.
|
| 61 |
+
# Otherwise raise ValueError.
|
| 62 |
+
rsi = check_random_state(1)
|
| 63 |
+
assert_equal(type(rsi), np.random.RandomState)
|
| 64 |
+
rsi = check_random_state(rsi)
|
| 65 |
+
assert_equal(type(rsi), np.random.RandomState)
|
| 66 |
+
rsi = check_random_state(None)
|
| 67 |
+
assert_equal(type(rsi), np.random.RandomState)
|
| 68 |
+
assert_raises(ValueError, check_random_state, 'a')
|
| 69 |
+
rg = np.random.Generator(np.random.PCG64())
|
| 70 |
+
rsi = check_random_state(rg)
|
| 71 |
+
assert_equal(type(rsi), np.random.Generator)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def test_getfullargspec_no_self():
|
| 75 |
+
p = MapWrapper(1)
|
| 76 |
+
argspec = getfullargspec_no_self(p.__init__)
|
| 77 |
+
assert_equal(argspec, FullArgSpec(['pool'], None, None, (1,), [],
|
| 78 |
+
None, {}))
|
| 79 |
+
argspec = getfullargspec_no_self(p.__call__)
|
| 80 |
+
assert_equal(argspec, FullArgSpec(['func', 'iterable'], None, None, None,
|
| 81 |
+
[], None, {}))
|
| 82 |
+
|
| 83 |
+
class _rv_generic:
|
| 84 |
+
def _rvs(self, a, b=2, c=3, *args, size=None, **kwargs):
|
| 85 |
+
return None
|
| 86 |
+
|
| 87 |
+
rv_obj = _rv_generic()
|
| 88 |
+
argspec = getfullargspec_no_self(rv_obj._rvs)
|
| 89 |
+
assert_equal(argspec, FullArgSpec(['a', 'b', 'c'], 'args', 'kwargs',
|
| 90 |
+
(2, 3), ['size'], {'size': None}, {}))
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def test_mapwrapper_serial():
|
| 94 |
+
in_arg = np.arange(10.)
|
| 95 |
+
out_arg = np.sin(in_arg)
|
| 96 |
+
|
| 97 |
+
p = MapWrapper(1)
|
| 98 |
+
assert_(p._mapfunc is map)
|
| 99 |
+
assert_(p.pool is None)
|
| 100 |
+
assert_(p._own_pool is False)
|
| 101 |
+
out = list(p(np.sin, in_arg))
|
| 102 |
+
assert_equal(out, out_arg)
|
| 103 |
+
|
| 104 |
+
with assert_raises(RuntimeError):
|
| 105 |
+
p = MapWrapper(0)
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
def test_pool():
|
| 109 |
+
with Pool(2) as p:
|
| 110 |
+
p.map(math.sin, [1, 2, 3, 4])
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
def test_mapwrapper_parallel():
|
| 114 |
+
in_arg = np.arange(10.)
|
| 115 |
+
out_arg = np.sin(in_arg)
|
| 116 |
+
|
| 117 |
+
with MapWrapper(2) as p:
|
| 118 |
+
out = p(np.sin, in_arg)
|
| 119 |
+
assert_equal(list(out), out_arg)
|
| 120 |
+
|
| 121 |
+
assert_(p._own_pool is True)
|
| 122 |
+
assert_(isinstance(p.pool, PWL))
|
| 123 |
+
assert_(p._mapfunc is not None)
|
| 124 |
+
|
| 125 |
+
# the context manager should've closed the internal pool
|
| 126 |
+
# check that it has by asking it to calculate again.
|
| 127 |
+
with assert_raises(Exception) as excinfo:
|
| 128 |
+
p(np.sin, in_arg)
|
| 129 |
+
|
| 130 |
+
assert_(excinfo.type is ValueError)
|
| 131 |
+
|
| 132 |
+
# can also set a PoolWrapper up with a map-like callable instance
|
| 133 |
+
with Pool(2) as p:
|
| 134 |
+
q = MapWrapper(p.map)
|
| 135 |
+
|
| 136 |
+
assert_(q._own_pool is False)
|
| 137 |
+
q.close()
|
| 138 |
+
|
| 139 |
+
# closing the PoolWrapper shouldn't close the internal pool
|
| 140 |
+
# because it didn't create it
|
| 141 |
+
out = p.map(np.sin, in_arg)
|
| 142 |
+
assert_equal(list(out), out_arg)
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def test_rng_integers():
|
| 146 |
+
rng = np.random.RandomState()
|
| 147 |
+
|
| 148 |
+
# test that numbers are inclusive of high point
|
| 149 |
+
arr = rng_integers(rng, low=2, high=5, size=100, endpoint=True)
|
| 150 |
+
assert np.max(arr) == 5
|
| 151 |
+
assert np.min(arr) == 2
|
| 152 |
+
assert arr.shape == (100, )
|
| 153 |
+
|
| 154 |
+
# test that numbers are inclusive of high point
|
| 155 |
+
arr = rng_integers(rng, low=5, size=100, endpoint=True)
|
| 156 |
+
assert np.max(arr) == 5
|
| 157 |
+
assert np.min(arr) == 0
|
| 158 |
+
assert arr.shape == (100, )
|
| 159 |
+
|
| 160 |
+
# test that numbers are exclusive of high point
|
| 161 |
+
arr = rng_integers(rng, low=2, high=5, size=100, endpoint=False)
|
| 162 |
+
assert np.max(arr) == 4
|
| 163 |
+
assert np.min(arr) == 2
|
| 164 |
+
assert arr.shape == (100, )
|
| 165 |
+
|
| 166 |
+
# test that numbers are exclusive of high point
|
| 167 |
+
arr = rng_integers(rng, low=5, size=100, endpoint=False)
|
| 168 |
+
assert np.max(arr) == 4
|
| 169 |
+
assert np.min(arr) == 0
|
| 170 |
+
assert arr.shape == (100, )
|
| 171 |
+
|
| 172 |
+
# now try with np.random.Generator
|
| 173 |
+
try:
|
| 174 |
+
rng = np.random.default_rng()
|
| 175 |
+
except AttributeError:
|
| 176 |
+
return
|
| 177 |
+
|
| 178 |
+
# test that numbers are inclusive of high point
|
| 179 |
+
arr = rng_integers(rng, low=2, high=5, size=100, endpoint=True)
|
| 180 |
+
assert np.max(arr) == 5
|
| 181 |
+
assert np.min(arr) == 2
|
| 182 |
+
assert arr.shape == (100, )
|
| 183 |
+
|
| 184 |
+
# test that numbers are inclusive of high point
|
| 185 |
+
arr = rng_integers(rng, low=5, size=100, endpoint=True)
|
| 186 |
+
assert np.max(arr) == 5
|
| 187 |
+
assert np.min(arr) == 0
|
| 188 |
+
assert arr.shape == (100, )
|
| 189 |
+
|
| 190 |
+
# test that numbers are exclusive of high point
|
| 191 |
+
arr = rng_integers(rng, low=2, high=5, size=100, endpoint=False)
|
| 192 |
+
assert np.max(arr) == 4
|
| 193 |
+
assert np.min(arr) == 2
|
| 194 |
+
assert arr.shape == (100, )
|
| 195 |
+
|
| 196 |
+
# test that numbers are exclusive of high point
|
| 197 |
+
arr = rng_integers(rng, low=5, size=100, endpoint=False)
|
| 198 |
+
assert np.max(arr) == 4
|
| 199 |
+
assert np.min(arr) == 0
|
| 200 |
+
assert arr.shape == (100, )
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
class TestValidateInt:
|
| 204 |
+
|
| 205 |
+
@pytest.mark.parametrize('n', [4, np.uint8(4), np.int16(4), np.array(4)])
|
| 206 |
+
def test_validate_int(self, n):
|
| 207 |
+
n = _validate_int(n, 'n')
|
| 208 |
+
assert n == 4
|
| 209 |
+
|
| 210 |
+
@pytest.mark.parametrize('n', [4.0, np.array([4]), Fraction(4, 1)])
|
| 211 |
+
def test_validate_int_bad(self, n):
|
| 212 |
+
with pytest.raises(TypeError, match='n must be an integer'):
|
| 213 |
+
_validate_int(n, 'n')
|
| 214 |
+
|
| 215 |
+
def test_validate_int_below_min(self):
|
| 216 |
+
with pytest.raises(ValueError, match='n must be an integer not '
|
| 217 |
+
'less than 0'):
|
| 218 |
+
_validate_int(-1, 'n', 0)
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
class TestRenameParameter:
|
| 222 |
+
# check that wrapper `_rename_parameter` for backward-compatible
|
| 223 |
+
# keyword renaming works correctly
|
| 224 |
+
|
| 225 |
+
# Example method/function that still accepts keyword `old`
|
| 226 |
+
@_rename_parameter("old", "new")
|
| 227 |
+
def old_keyword_still_accepted(self, new):
|
| 228 |
+
return new
|
| 229 |
+
|
| 230 |
+
# Example method/function for which keyword `old` is deprecated
|
| 231 |
+
@_rename_parameter("old", "new", dep_version="1.9.0")
|
| 232 |
+
def old_keyword_deprecated(self, new):
|
| 233 |
+
return new
|
| 234 |
+
|
| 235 |
+
def test_old_keyword_still_accepted(self):
|
| 236 |
+
# positional argument and both keyword work identically
|
| 237 |
+
res1 = self.old_keyword_still_accepted(10)
|
| 238 |
+
res2 = self.old_keyword_still_accepted(new=10)
|
| 239 |
+
res3 = self.old_keyword_still_accepted(old=10)
|
| 240 |
+
assert res1 == res2 == res3 == 10
|
| 241 |
+
|
| 242 |
+
# unexpected keyword raises an error
|
| 243 |
+
message = re.escape("old_keyword_still_accepted() got an unexpected")
|
| 244 |
+
with pytest.raises(TypeError, match=message):
|
| 245 |
+
self.old_keyword_still_accepted(unexpected=10)
|
| 246 |
+
|
| 247 |
+
# multiple values for the same parameter raises an error
|
| 248 |
+
message = re.escape("old_keyword_still_accepted() got multiple")
|
| 249 |
+
with pytest.raises(TypeError, match=message):
|
| 250 |
+
self.old_keyword_still_accepted(10, new=10)
|
| 251 |
+
with pytest.raises(TypeError, match=message):
|
| 252 |
+
self.old_keyword_still_accepted(10, old=10)
|
| 253 |
+
with pytest.raises(TypeError, match=message):
|
| 254 |
+
self.old_keyword_still_accepted(new=10, old=10)
|
| 255 |
+
|
| 256 |
+
def test_old_keyword_deprecated(self):
|
| 257 |
+
# positional argument and both keyword work identically,
|
| 258 |
+
# but use of old keyword results in DeprecationWarning
|
| 259 |
+
dep_msg = "Use of keyword argument `old` is deprecated"
|
| 260 |
+
res1 = self.old_keyword_deprecated(10)
|
| 261 |
+
res2 = self.old_keyword_deprecated(new=10)
|
| 262 |
+
with pytest.warns(DeprecationWarning, match=dep_msg):
|
| 263 |
+
res3 = self.old_keyword_deprecated(old=10)
|
| 264 |
+
assert res1 == res2 == res3 == 10
|
| 265 |
+
|
| 266 |
+
# unexpected keyword raises an error
|
| 267 |
+
message = re.escape("old_keyword_deprecated() got an unexpected")
|
| 268 |
+
with pytest.raises(TypeError, match=message):
|
| 269 |
+
self.old_keyword_deprecated(unexpected=10)
|
| 270 |
+
|
| 271 |
+
# multiple values for the same parameter raises an error and,
|
| 272 |
+
# if old keyword is used, results in DeprecationWarning
|
| 273 |
+
message = re.escape("old_keyword_deprecated() got multiple")
|
| 274 |
+
with pytest.raises(TypeError, match=message):
|
| 275 |
+
self.old_keyword_deprecated(10, new=10)
|
| 276 |
+
with pytest.raises(TypeError, match=message), \
|
| 277 |
+
pytest.warns(DeprecationWarning, match=dep_msg):
|
| 278 |
+
self.old_keyword_deprecated(10, old=10)
|
| 279 |
+
with pytest.raises(TypeError, match=message), \
|
| 280 |
+
pytest.warns(DeprecationWarning, match=dep_msg):
|
| 281 |
+
self.old_keyword_deprecated(new=10, old=10)
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
class TestContainsNaNTest:
|
| 285 |
+
|
| 286 |
+
def test_policy(self):
|
| 287 |
+
data = np.array([1, 2, 3, np.nan])
|
| 288 |
+
|
| 289 |
+
contains_nan, nan_policy = _contains_nan(data, nan_policy="propagate")
|
| 290 |
+
assert contains_nan
|
| 291 |
+
assert nan_policy == "propagate"
|
| 292 |
+
|
| 293 |
+
contains_nan, nan_policy = _contains_nan(data, nan_policy="omit")
|
| 294 |
+
assert contains_nan
|
| 295 |
+
assert nan_policy == "omit"
|
| 296 |
+
|
| 297 |
+
msg = "The input contains nan values"
|
| 298 |
+
with pytest.raises(ValueError, match=msg):
|
| 299 |
+
_contains_nan(data, nan_policy="raise")
|
| 300 |
+
|
| 301 |
+
msg = "nan_policy must be one of"
|
| 302 |
+
with pytest.raises(ValueError, match=msg):
|
| 303 |
+
_contains_nan(data, nan_policy="nan")
|
| 304 |
+
|
| 305 |
+
def test_contains_nan_1d(self):
|
| 306 |
+
data1 = np.array([1, 2, 3])
|
| 307 |
+
assert not _contains_nan(data1)[0]
|
| 308 |
+
|
| 309 |
+
data2 = np.array([1, 2, 3, np.nan])
|
| 310 |
+
assert _contains_nan(data2)[0]
|
| 311 |
+
|
| 312 |
+
data3 = np.array([np.nan, 2, 3, np.nan])
|
| 313 |
+
assert _contains_nan(data3)[0]
|
| 314 |
+
|
| 315 |
+
data4 = np.array([1, 2, "3", np.nan]) # converted to string "nan"
|
| 316 |
+
assert not _contains_nan(data4)[0]
|
| 317 |
+
|
| 318 |
+
data5 = np.array([1, 2, "3", np.nan], dtype='object')
|
| 319 |
+
assert _contains_nan(data5)[0]
|
| 320 |
+
|
| 321 |
+
def test_contains_nan_2d(self):
|
| 322 |
+
data1 = np.array([[1, 2], [3, 4]])
|
| 323 |
+
assert not _contains_nan(data1)[0]
|
| 324 |
+
|
| 325 |
+
data2 = np.array([[1, 2], [3, np.nan]])
|
| 326 |
+
assert _contains_nan(data2)[0]
|
| 327 |
+
|
| 328 |
+
data3 = np.array([["1", 2], [3, np.nan]]) # converted to string "nan"
|
| 329 |
+
assert not _contains_nan(data3)[0]
|
| 330 |
+
|
| 331 |
+
data4 = np.array([["1", 2], [3, np.nan]], dtype='object')
|
| 332 |
+
assert _contains_nan(data4)[0]
|
| 333 |
+
|
| 334 |
+
|
| 335 |
+
def test__rng_html_rewrite():
|
| 336 |
+
def mock_str():
|
| 337 |
+
lines = [
|
| 338 |
+
'np.random.default_rng(8989843)',
|
| 339 |
+
'np.random.default_rng(seed)',
|
| 340 |
+
'np.random.default_rng(0x9a71b21474694f919882289dc1559ca)',
|
| 341 |
+
' bob ',
|
| 342 |
+
]
|
| 343 |
+
return lines
|
| 344 |
+
|
| 345 |
+
res = _rng_html_rewrite(mock_str)()
|
| 346 |
+
ref = [
|
| 347 |
+
'np.random.default_rng()',
|
| 348 |
+
'np.random.default_rng(seed)',
|
| 349 |
+
'np.random.default_rng()',
|
| 350 |
+
' bob ',
|
| 351 |
+
]
|
| 352 |
+
|
| 353 |
+
assert res == ref
|
| 354 |
+
|
| 355 |
+
|
| 356 |
+
class TestLazywhere:
|
| 357 |
+
n_arrays = strategies.integers(min_value=1, max_value=3)
|
| 358 |
+
rng_seed = strategies.integers(min_value=1000000000, max_value=9999999999)
|
| 359 |
+
dtype = strategies.sampled_from((np.float32, np.float64))
|
| 360 |
+
p = strategies.floats(min_value=0, max_value=1)
|
| 361 |
+
data = strategies.data()
|
| 362 |
+
|
| 363 |
+
@pytest.mark.filterwarnings('ignore::RuntimeWarning') # overflows, etc.
|
| 364 |
+
@array_api_compatible
|
| 365 |
+
@given(n_arrays=n_arrays, rng_seed=rng_seed, dtype=dtype, p=p, data=data)
|
| 366 |
+
def test_basic(self, n_arrays, rng_seed, dtype, p, data, xp):
|
| 367 |
+
mbs = npst.mutually_broadcastable_shapes(num_shapes=n_arrays+1,
|
| 368 |
+
min_side=0)
|
| 369 |
+
input_shapes, result_shape = data.draw(mbs)
|
| 370 |
+
cond_shape, *shapes = input_shapes
|
| 371 |
+
fillvalue = xp.asarray(data.draw(npst.arrays(dtype=dtype, shape=tuple())))
|
| 372 |
+
arrays = [xp.asarray(data.draw(npst.arrays(dtype=dtype, shape=shape)))
|
| 373 |
+
for shape in shapes]
|
| 374 |
+
|
| 375 |
+
def f(*args):
|
| 376 |
+
return sum(arg for arg in args)
|
| 377 |
+
|
| 378 |
+
def f2(*args):
|
| 379 |
+
return sum(arg for arg in args) / 2
|
| 380 |
+
|
| 381 |
+
rng = np.random.default_rng(rng_seed)
|
| 382 |
+
cond = xp.asarray(rng.random(size=cond_shape) > p)
|
| 383 |
+
|
| 384 |
+
res1 = _lazywhere(cond, arrays, f, fillvalue)
|
| 385 |
+
res2 = _lazywhere(cond, arrays, f, f2=f2)
|
| 386 |
+
|
| 387 |
+
# Ensure arrays are at least 1d to follow sane type promotion rules.
|
| 388 |
+
if xp == np:
|
| 389 |
+
cond, fillvalue, *arrays = np.atleast_1d(cond, fillvalue, *arrays)
|
| 390 |
+
|
| 391 |
+
ref1 = xp.where(cond, f(*arrays), fillvalue)
|
| 392 |
+
ref2 = xp.where(cond, f(*arrays), f2(*arrays))
|
| 393 |
+
|
| 394 |
+
if xp == np:
|
| 395 |
+
ref1 = ref1.reshape(result_shape)
|
| 396 |
+
ref2 = ref2.reshape(result_shape)
|
| 397 |
+
res1 = xp.asarray(res1)[()]
|
| 398 |
+
res2 = xp.asarray(res2)[()]
|
| 399 |
+
|
| 400 |
+
isinstance(res1, type(xp.asarray([])))
|
| 401 |
+
xp_assert_equal(res1, ref1)
|
| 402 |
+
assert_equal(res1.shape, ref1.shape)
|
| 403 |
+
assert_equal(res1.dtype, ref1.dtype)
|
| 404 |
+
|
| 405 |
+
isinstance(res2, type(xp.asarray([])))
|
| 406 |
+
xp_assert_equal(res2, ref2)
|
| 407 |
+
assert_equal(res2.shape, ref2.shape)
|
| 408 |
+
assert_equal(res2.dtype, ref2.dtype)
|
.venv/Lib/site-packages/scipy/_lib/tests/test_deprecation.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def test_cython_api_deprecation():
|
| 5 |
+
match = ("`scipy._lib._test_deprecation_def.foo_deprecated` "
|
| 6 |
+
"is deprecated, use `foo` instead!\n"
|
| 7 |
+
"Deprecated in Scipy 42.0.0")
|
| 8 |
+
with pytest.warns(DeprecationWarning, match=match):
|
| 9 |
+
from .. import _test_deprecation_call
|
| 10 |
+
assert _test_deprecation_call.call() == (1, 1)
|
.venv/Lib/site-packages/scipy/_lib/tests/test_import_cycles.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import subprocess
|
| 3 |
+
|
| 4 |
+
from .test_public_api import PUBLIC_MODULES
|
| 5 |
+
|
| 6 |
+
# Regression tests for gh-6793.
|
| 7 |
+
# Check that all modules are importable in a new Python process.
|
| 8 |
+
# This is not necessarily true if there are import cycles present.
|
| 9 |
+
|
| 10 |
+
def test_public_modules_importable():
|
| 11 |
+
pids = [subprocess.Popen([sys.executable, '-c', f'import {module}'])
|
| 12 |
+
for module in PUBLIC_MODULES]
|
| 13 |
+
for i, pid in enumerate(pids):
|
| 14 |
+
assert pid.wait() == 0, f'Failed to import {PUBLIC_MODULES[i]}'
|
.venv/Lib/site-packages/scipy/_lib/tests/test_public_api.py
ADDED
|
@@ -0,0 +1,491 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
This test script is adopted from:
|
| 3 |
+
https://github.com/numpy/numpy/blob/main/numpy/tests/test_public_api.py
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import pkgutil
|
| 7 |
+
import types
|
| 8 |
+
import importlib
|
| 9 |
+
import warnings
|
| 10 |
+
from importlib import import_module
|
| 11 |
+
|
| 12 |
+
import pytest
|
| 13 |
+
|
| 14 |
+
import scipy
|
| 15 |
+
|
| 16 |
+
from scipy.conftest import xp_available_backends
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def test_dir_testing():
|
| 20 |
+
"""Assert that output of dir has only one "testing/tester"
|
| 21 |
+
attribute without duplicate"""
|
| 22 |
+
assert len(dir(scipy)) == len(set(dir(scipy)))
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
# Historically SciPy has not used leading underscores for private submodules
|
| 26 |
+
# much. This has resulted in lots of things that look like public modules
|
| 27 |
+
# (i.e. things that can be imported as `import scipy.somesubmodule.somefile`),
|
| 28 |
+
# but were never intended to be public. The PUBLIC_MODULES list contains
|
| 29 |
+
# modules that are either public because they were meant to be, or because they
|
| 30 |
+
# contain public functions/objects that aren't present in any other namespace
|
| 31 |
+
# for whatever reason and therefore should be treated as public.
|
| 32 |
+
PUBLIC_MODULES = ["scipy." + s for s in [
|
| 33 |
+
"cluster",
|
| 34 |
+
"cluster.vq",
|
| 35 |
+
"cluster.hierarchy",
|
| 36 |
+
"constants",
|
| 37 |
+
"datasets",
|
| 38 |
+
"fft",
|
| 39 |
+
"fftpack",
|
| 40 |
+
"integrate",
|
| 41 |
+
"interpolate",
|
| 42 |
+
"io",
|
| 43 |
+
"io.arff",
|
| 44 |
+
"io.matlab",
|
| 45 |
+
"io.wavfile",
|
| 46 |
+
"linalg",
|
| 47 |
+
"linalg.blas",
|
| 48 |
+
"linalg.cython_blas",
|
| 49 |
+
"linalg.lapack",
|
| 50 |
+
"linalg.cython_lapack",
|
| 51 |
+
"linalg.interpolative",
|
| 52 |
+
"misc",
|
| 53 |
+
"ndimage",
|
| 54 |
+
"odr",
|
| 55 |
+
"optimize",
|
| 56 |
+
"signal",
|
| 57 |
+
"signal.windows",
|
| 58 |
+
"sparse",
|
| 59 |
+
"sparse.linalg",
|
| 60 |
+
"sparse.csgraph",
|
| 61 |
+
"spatial",
|
| 62 |
+
"spatial.distance",
|
| 63 |
+
"spatial.transform",
|
| 64 |
+
"special",
|
| 65 |
+
"stats",
|
| 66 |
+
"stats.contingency",
|
| 67 |
+
"stats.distributions",
|
| 68 |
+
"stats.mstats",
|
| 69 |
+
"stats.qmc",
|
| 70 |
+
"stats.sampling"
|
| 71 |
+
]]
|
| 72 |
+
|
| 73 |
+
# The PRIVATE_BUT_PRESENT_MODULES list contains modules that lacked underscores
|
| 74 |
+
# in their name and hence looked public, but weren't meant to be. All these
|
| 75 |
+
# namespace were deprecated in the 1.8.0 release - see "clear split between
|
| 76 |
+
# public and private API" in the 1.8.0 release notes.
|
| 77 |
+
# These private modules support will be removed in SciPy v2.0.0, as the
|
| 78 |
+
# deprecation messages emitted by each of these modules say.
|
| 79 |
+
PRIVATE_BUT_PRESENT_MODULES = [
|
| 80 |
+
'scipy.constants.codata',
|
| 81 |
+
'scipy.constants.constants',
|
| 82 |
+
'scipy.fftpack.basic',
|
| 83 |
+
'scipy.fftpack.convolve',
|
| 84 |
+
'scipy.fftpack.helper',
|
| 85 |
+
'scipy.fftpack.pseudo_diffs',
|
| 86 |
+
'scipy.fftpack.realtransforms',
|
| 87 |
+
'scipy.integrate.dop',
|
| 88 |
+
'scipy.integrate.lsoda',
|
| 89 |
+
'scipy.integrate.odepack',
|
| 90 |
+
'scipy.integrate.quadpack',
|
| 91 |
+
'scipy.integrate.vode',
|
| 92 |
+
'scipy.interpolate.dfitpack',
|
| 93 |
+
'scipy.interpolate.fitpack',
|
| 94 |
+
'scipy.interpolate.fitpack2',
|
| 95 |
+
'scipy.interpolate.interpnd',
|
| 96 |
+
'scipy.interpolate.interpolate',
|
| 97 |
+
'scipy.interpolate.ndgriddata',
|
| 98 |
+
'scipy.interpolate.polyint',
|
| 99 |
+
'scipy.interpolate.rbf',
|
| 100 |
+
'scipy.io.arff.arffread',
|
| 101 |
+
'scipy.io.harwell_boeing',
|
| 102 |
+
'scipy.io.idl',
|
| 103 |
+
'scipy.io.matlab.byteordercodes',
|
| 104 |
+
'scipy.io.matlab.mio',
|
| 105 |
+
'scipy.io.matlab.mio4',
|
| 106 |
+
'scipy.io.matlab.mio5',
|
| 107 |
+
'scipy.io.matlab.mio5_params',
|
| 108 |
+
'scipy.io.matlab.mio5_utils',
|
| 109 |
+
'scipy.io.matlab.mio_utils',
|
| 110 |
+
'scipy.io.matlab.miobase',
|
| 111 |
+
'scipy.io.matlab.streams',
|
| 112 |
+
'scipy.io.mmio',
|
| 113 |
+
'scipy.io.netcdf',
|
| 114 |
+
'scipy.linalg.basic',
|
| 115 |
+
'scipy.linalg.decomp',
|
| 116 |
+
'scipy.linalg.decomp_cholesky',
|
| 117 |
+
'scipy.linalg.decomp_lu',
|
| 118 |
+
'scipy.linalg.decomp_qr',
|
| 119 |
+
'scipy.linalg.decomp_schur',
|
| 120 |
+
'scipy.linalg.decomp_svd',
|
| 121 |
+
'scipy.linalg.matfuncs',
|
| 122 |
+
'scipy.linalg.misc',
|
| 123 |
+
'scipy.linalg.special_matrices',
|
| 124 |
+
'scipy.misc.common',
|
| 125 |
+
'scipy.misc.doccer',
|
| 126 |
+
'scipy.ndimage.filters',
|
| 127 |
+
'scipy.ndimage.fourier',
|
| 128 |
+
'scipy.ndimage.interpolation',
|
| 129 |
+
'scipy.ndimage.measurements',
|
| 130 |
+
'scipy.ndimage.morphology',
|
| 131 |
+
'scipy.odr.models',
|
| 132 |
+
'scipy.odr.odrpack',
|
| 133 |
+
'scipy.optimize.cobyla',
|
| 134 |
+
'scipy.optimize.cython_optimize',
|
| 135 |
+
'scipy.optimize.lbfgsb',
|
| 136 |
+
'scipy.optimize.linesearch',
|
| 137 |
+
'scipy.optimize.minpack',
|
| 138 |
+
'scipy.optimize.minpack2',
|
| 139 |
+
'scipy.optimize.moduleTNC',
|
| 140 |
+
'scipy.optimize.nonlin',
|
| 141 |
+
'scipy.optimize.optimize',
|
| 142 |
+
'scipy.optimize.slsqp',
|
| 143 |
+
'scipy.optimize.tnc',
|
| 144 |
+
'scipy.optimize.zeros',
|
| 145 |
+
'scipy.signal.bsplines',
|
| 146 |
+
'scipy.signal.filter_design',
|
| 147 |
+
'scipy.signal.fir_filter_design',
|
| 148 |
+
'scipy.signal.lti_conversion',
|
| 149 |
+
'scipy.signal.ltisys',
|
| 150 |
+
'scipy.signal.signaltools',
|
| 151 |
+
'scipy.signal.spectral',
|
| 152 |
+
'scipy.signal.spline',
|
| 153 |
+
'scipy.signal.waveforms',
|
| 154 |
+
'scipy.signal.wavelets',
|
| 155 |
+
'scipy.signal.windows.windows',
|
| 156 |
+
'scipy.sparse.base',
|
| 157 |
+
'scipy.sparse.bsr',
|
| 158 |
+
'scipy.sparse.compressed',
|
| 159 |
+
'scipy.sparse.construct',
|
| 160 |
+
'scipy.sparse.coo',
|
| 161 |
+
'scipy.sparse.csc',
|
| 162 |
+
'scipy.sparse.csr',
|
| 163 |
+
'scipy.sparse.data',
|
| 164 |
+
'scipy.sparse.dia',
|
| 165 |
+
'scipy.sparse.dok',
|
| 166 |
+
'scipy.sparse.extract',
|
| 167 |
+
'scipy.sparse.lil',
|
| 168 |
+
'scipy.sparse.linalg.dsolve',
|
| 169 |
+
'scipy.sparse.linalg.eigen',
|
| 170 |
+
'scipy.sparse.linalg.interface',
|
| 171 |
+
'scipy.sparse.linalg.isolve',
|
| 172 |
+
'scipy.sparse.linalg.matfuncs',
|
| 173 |
+
'scipy.sparse.sparsetools',
|
| 174 |
+
'scipy.sparse.spfuncs',
|
| 175 |
+
'scipy.sparse.sputils',
|
| 176 |
+
'scipy.spatial.ckdtree',
|
| 177 |
+
'scipy.spatial.kdtree',
|
| 178 |
+
'scipy.spatial.qhull',
|
| 179 |
+
'scipy.spatial.transform.rotation',
|
| 180 |
+
'scipy.special.add_newdocs',
|
| 181 |
+
'scipy.special.basic',
|
| 182 |
+
'scipy.special.cython_special',
|
| 183 |
+
'scipy.special.orthogonal',
|
| 184 |
+
'scipy.special.sf_error',
|
| 185 |
+
'scipy.special.specfun',
|
| 186 |
+
'scipy.special.spfun_stats',
|
| 187 |
+
'scipy.stats.biasedurn',
|
| 188 |
+
'scipy.stats.kde',
|
| 189 |
+
'scipy.stats.morestats',
|
| 190 |
+
'scipy.stats.mstats_basic',
|
| 191 |
+
'scipy.stats.mstats_extras',
|
| 192 |
+
'scipy.stats.mvn',
|
| 193 |
+
'scipy.stats.stats',
|
| 194 |
+
]
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
def is_unexpected(name):
|
| 198 |
+
"""Check if this needs to be considered."""
|
| 199 |
+
if '._' in name or '.tests' in name or '.setup' in name:
|
| 200 |
+
return False
|
| 201 |
+
|
| 202 |
+
if name in PUBLIC_MODULES:
|
| 203 |
+
return False
|
| 204 |
+
|
| 205 |
+
if name in PRIVATE_BUT_PRESENT_MODULES:
|
| 206 |
+
return False
|
| 207 |
+
|
| 208 |
+
return True
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
SKIP_LIST = [
|
| 212 |
+
'scipy.conftest',
|
| 213 |
+
'scipy.version',
|
| 214 |
+
]
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
# XXX: this test does more than it says on the tin - in using `pkgutil.walk_packages`,
|
| 218 |
+
# it will raise if it encounters any exceptions which are not handled by `ignore_errors`
|
| 219 |
+
# while attempting to import each discovered package.
|
| 220 |
+
# For now, `ignore_errors` only ignores what is necessary, but this could be expanded -
|
| 221 |
+
# for example, to all errors from private modules or git subpackages - if desired.
|
| 222 |
+
def test_all_modules_are_expected():
|
| 223 |
+
"""
|
| 224 |
+
Test that we don't add anything that looks like a new public module by
|
| 225 |
+
accident. Check is based on filenames.
|
| 226 |
+
"""
|
| 227 |
+
|
| 228 |
+
def ignore_errors(name):
|
| 229 |
+
# if versions of other array libraries are installed which are incompatible
|
| 230 |
+
# with the installed NumPy version, there can be errors on importing
|
| 231 |
+
# `array_api_compat`. This should only raise if SciPy is configured with
|
| 232 |
+
# that library as an available backend.
|
| 233 |
+
for backend, dir_name in {'cupy': 'cupy', 'pytorch': 'torch'}.items():
|
| 234 |
+
path = f'array_api_compat.{dir_name}'
|
| 235 |
+
if path in name and backend not in xp_available_backends:
|
| 236 |
+
return
|
| 237 |
+
raise
|
| 238 |
+
|
| 239 |
+
modnames = []
|
| 240 |
+
|
| 241 |
+
for _, modname, _ in pkgutil.walk_packages(path=scipy.__path__,
|
| 242 |
+
prefix=scipy.__name__ + '.',
|
| 243 |
+
onerror=ignore_errors):
|
| 244 |
+
if is_unexpected(modname) and modname not in SKIP_LIST:
|
| 245 |
+
# We have a name that is new. If that's on purpose, add it to
|
| 246 |
+
# PUBLIC_MODULES. We don't expect to have to add anything to
|
| 247 |
+
# PRIVATE_BUT_PRESENT_MODULES. Use an underscore in the name!
|
| 248 |
+
modnames.append(modname)
|
| 249 |
+
|
| 250 |
+
if modnames:
|
| 251 |
+
raise AssertionError(f'Found unexpected modules: {modnames}')
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
# Stuff that clearly shouldn't be in the API and is detected by the next test
|
| 255 |
+
# below
|
| 256 |
+
SKIP_LIST_2 = [
|
| 257 |
+
'scipy.char',
|
| 258 |
+
'scipy.rec',
|
| 259 |
+
'scipy.emath',
|
| 260 |
+
'scipy.math',
|
| 261 |
+
'scipy.random',
|
| 262 |
+
'scipy.ctypeslib',
|
| 263 |
+
'scipy.ma'
|
| 264 |
+
]
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def test_all_modules_are_expected_2():
|
| 268 |
+
"""
|
| 269 |
+
Method checking all objects. The pkgutil-based method in
|
| 270 |
+
`test_all_modules_are_expected` does not catch imports into a namespace,
|
| 271 |
+
only filenames.
|
| 272 |
+
"""
|
| 273 |
+
|
| 274 |
+
def find_unexpected_members(mod_name):
|
| 275 |
+
members = []
|
| 276 |
+
module = importlib.import_module(mod_name)
|
| 277 |
+
if hasattr(module, '__all__'):
|
| 278 |
+
objnames = module.__all__
|
| 279 |
+
else:
|
| 280 |
+
objnames = dir(module)
|
| 281 |
+
|
| 282 |
+
for objname in objnames:
|
| 283 |
+
if not objname.startswith('_'):
|
| 284 |
+
fullobjname = mod_name + '.' + objname
|
| 285 |
+
if isinstance(getattr(module, objname), types.ModuleType):
|
| 286 |
+
if is_unexpected(fullobjname) and fullobjname not in SKIP_LIST_2:
|
| 287 |
+
members.append(fullobjname)
|
| 288 |
+
|
| 289 |
+
return members
|
| 290 |
+
|
| 291 |
+
unexpected_members = find_unexpected_members("scipy")
|
| 292 |
+
for modname in PUBLIC_MODULES:
|
| 293 |
+
unexpected_members.extend(find_unexpected_members(modname))
|
| 294 |
+
|
| 295 |
+
if unexpected_members:
|
| 296 |
+
raise AssertionError("Found unexpected object(s) that look like "
|
| 297 |
+
f"modules: {unexpected_members}")
|
| 298 |
+
|
| 299 |
+
|
| 300 |
+
def test_api_importable():
|
| 301 |
+
"""
|
| 302 |
+
Check that all submodules listed higher up in this file can be imported
|
| 303 |
+
Note that if a PRIVATE_BUT_PRESENT_MODULES entry goes missing, it may
|
| 304 |
+
simply need to be removed from the list (deprecation may or may not be
|
| 305 |
+
needed - apply common sense).
|
| 306 |
+
"""
|
| 307 |
+
def check_importable(module_name):
|
| 308 |
+
try:
|
| 309 |
+
importlib.import_module(module_name)
|
| 310 |
+
except (ImportError, AttributeError):
|
| 311 |
+
return False
|
| 312 |
+
|
| 313 |
+
return True
|
| 314 |
+
|
| 315 |
+
module_names = []
|
| 316 |
+
for module_name in PUBLIC_MODULES:
|
| 317 |
+
if not check_importable(module_name):
|
| 318 |
+
module_names.append(module_name)
|
| 319 |
+
|
| 320 |
+
if module_names:
|
| 321 |
+
raise AssertionError("Modules in the public API that cannot be "
|
| 322 |
+
f"imported: {module_names}")
|
| 323 |
+
|
| 324 |
+
with warnings.catch_warnings(record=True):
|
| 325 |
+
warnings.filterwarnings('always', category=DeprecationWarning)
|
| 326 |
+
warnings.filterwarnings('always', category=ImportWarning)
|
| 327 |
+
for module_name in PRIVATE_BUT_PRESENT_MODULES:
|
| 328 |
+
if not check_importable(module_name):
|
| 329 |
+
module_names.append(module_name)
|
| 330 |
+
|
| 331 |
+
if module_names:
|
| 332 |
+
raise AssertionError("Modules that are not really public but looked "
|
| 333 |
+
"public and can not be imported: "
|
| 334 |
+
f"{module_names}")
|
| 335 |
+
|
| 336 |
+
|
| 337 |
+
@pytest.mark.parametrize(("module_name", "correct_module"),
|
| 338 |
+
[('scipy.constants.codata', None),
|
| 339 |
+
('scipy.constants.constants', None),
|
| 340 |
+
('scipy.fftpack.basic', None),
|
| 341 |
+
('scipy.fftpack.helper', None),
|
| 342 |
+
('scipy.fftpack.pseudo_diffs', None),
|
| 343 |
+
('scipy.fftpack.realtransforms', None),
|
| 344 |
+
('scipy.integrate.dop', None),
|
| 345 |
+
('scipy.integrate.lsoda', None),
|
| 346 |
+
('scipy.integrate.odepack', None),
|
| 347 |
+
('scipy.integrate.quadpack', None),
|
| 348 |
+
('scipy.integrate.vode', None),
|
| 349 |
+
('scipy.interpolate.fitpack', None),
|
| 350 |
+
('scipy.interpolate.fitpack2', None),
|
| 351 |
+
('scipy.interpolate.interpolate', None),
|
| 352 |
+
('scipy.interpolate.ndgriddata', None),
|
| 353 |
+
('scipy.interpolate.polyint', None),
|
| 354 |
+
('scipy.interpolate.rbf', None),
|
| 355 |
+
('scipy.io.harwell_boeing', None),
|
| 356 |
+
('scipy.io.idl', None),
|
| 357 |
+
('scipy.io.mmio', None),
|
| 358 |
+
('scipy.io.netcdf', None),
|
| 359 |
+
('scipy.io.arff.arffread', 'arff'),
|
| 360 |
+
('scipy.io.matlab.byteordercodes', 'matlab'),
|
| 361 |
+
('scipy.io.matlab.mio_utils', 'matlab'),
|
| 362 |
+
('scipy.io.matlab.mio', 'matlab'),
|
| 363 |
+
('scipy.io.matlab.mio4', 'matlab'),
|
| 364 |
+
('scipy.io.matlab.mio5_params', 'matlab'),
|
| 365 |
+
('scipy.io.matlab.mio5_utils', 'matlab'),
|
| 366 |
+
('scipy.io.matlab.mio5', 'matlab'),
|
| 367 |
+
('scipy.io.matlab.miobase', 'matlab'),
|
| 368 |
+
('scipy.io.matlab.streams', 'matlab'),
|
| 369 |
+
('scipy.linalg.basic', None),
|
| 370 |
+
('scipy.linalg.decomp', None),
|
| 371 |
+
('scipy.linalg.decomp_cholesky', None),
|
| 372 |
+
('scipy.linalg.decomp_lu', None),
|
| 373 |
+
('scipy.linalg.decomp_qr', None),
|
| 374 |
+
('scipy.linalg.decomp_schur', None),
|
| 375 |
+
('scipy.linalg.decomp_svd', None),
|
| 376 |
+
('scipy.linalg.matfuncs', None),
|
| 377 |
+
('scipy.linalg.misc', None),
|
| 378 |
+
('scipy.linalg.special_matrices', None),
|
| 379 |
+
('scipy.misc.common', None),
|
| 380 |
+
('scipy.ndimage.filters', None),
|
| 381 |
+
('scipy.ndimage.fourier', None),
|
| 382 |
+
('scipy.ndimage.interpolation', None),
|
| 383 |
+
('scipy.ndimage.measurements', None),
|
| 384 |
+
('scipy.ndimage.morphology', None),
|
| 385 |
+
('scipy.odr.models', None),
|
| 386 |
+
('scipy.odr.odrpack', None),
|
| 387 |
+
('scipy.optimize.cobyla', None),
|
| 388 |
+
('scipy.optimize.lbfgsb', None),
|
| 389 |
+
('scipy.optimize.linesearch', None),
|
| 390 |
+
('scipy.optimize.minpack', None),
|
| 391 |
+
('scipy.optimize.minpack2', None),
|
| 392 |
+
('scipy.optimize.moduleTNC', None),
|
| 393 |
+
('scipy.optimize.nonlin', None),
|
| 394 |
+
('scipy.optimize.optimize', None),
|
| 395 |
+
('scipy.optimize.slsqp', None),
|
| 396 |
+
('scipy.optimize.tnc', None),
|
| 397 |
+
('scipy.optimize.zeros', None),
|
| 398 |
+
('scipy.signal.bsplines', None),
|
| 399 |
+
('scipy.signal.filter_design', None),
|
| 400 |
+
('scipy.signal.fir_filter_design', None),
|
| 401 |
+
('scipy.signal.lti_conversion', None),
|
| 402 |
+
('scipy.signal.ltisys', None),
|
| 403 |
+
('scipy.signal.signaltools', None),
|
| 404 |
+
('scipy.signal.spectral', None),
|
| 405 |
+
('scipy.signal.waveforms', None),
|
| 406 |
+
('scipy.signal.wavelets', None),
|
| 407 |
+
('scipy.signal.windows.windows', 'windows'),
|
| 408 |
+
('scipy.sparse.lil', None),
|
| 409 |
+
('scipy.sparse.linalg.dsolve', 'linalg'),
|
| 410 |
+
('scipy.sparse.linalg.eigen', 'linalg'),
|
| 411 |
+
('scipy.sparse.linalg.interface', 'linalg'),
|
| 412 |
+
('scipy.sparse.linalg.isolve', 'linalg'),
|
| 413 |
+
('scipy.sparse.linalg.matfuncs', 'linalg'),
|
| 414 |
+
('scipy.sparse.sparsetools', None),
|
| 415 |
+
('scipy.sparse.spfuncs', None),
|
| 416 |
+
('scipy.sparse.sputils', None),
|
| 417 |
+
('scipy.spatial.ckdtree', None),
|
| 418 |
+
('scipy.spatial.kdtree', None),
|
| 419 |
+
('scipy.spatial.qhull', None),
|
| 420 |
+
('scipy.spatial.transform.rotation', 'transform'),
|
| 421 |
+
('scipy.special.add_newdocs', None),
|
| 422 |
+
('scipy.special.basic', None),
|
| 423 |
+
('scipy.special.orthogonal', None),
|
| 424 |
+
('scipy.special.sf_error', None),
|
| 425 |
+
('scipy.special.specfun', None),
|
| 426 |
+
('scipy.special.spfun_stats', None),
|
| 427 |
+
('scipy.stats.biasedurn', None),
|
| 428 |
+
('scipy.stats.kde', None),
|
| 429 |
+
('scipy.stats.morestats', None),
|
| 430 |
+
('scipy.stats.mstats_basic', 'mstats'),
|
| 431 |
+
('scipy.stats.mstats_extras', 'mstats'),
|
| 432 |
+
('scipy.stats.mvn', None),
|
| 433 |
+
('scipy.stats.stats', None)])
|
| 434 |
+
def test_private_but_present_deprecation(module_name, correct_module):
|
| 435 |
+
# gh-18279, gh-17572, gh-17771 noted that deprecation warnings
|
| 436 |
+
# for imports from private modules
|
| 437 |
+
# were misleading. Check that this is resolved.
|
| 438 |
+
module = import_module(module_name)
|
| 439 |
+
if correct_module is None:
|
| 440 |
+
import_name = f'scipy.{module_name.split(".")[1]}'
|
| 441 |
+
else:
|
| 442 |
+
import_name = f'scipy.{module_name.split(".")[1]}.{correct_module}'
|
| 443 |
+
|
| 444 |
+
correct_import = import_module(import_name)
|
| 445 |
+
|
| 446 |
+
# Attributes that were formerly in `module_name` can still be imported from
|
| 447 |
+
# `module_name`, albeit with a deprecation warning. The specific message
|
| 448 |
+
# depends on whether the attribute is public in `scipy.xxx` or not.
|
| 449 |
+
for attr_name in module.__all__:
|
| 450 |
+
attr = getattr(correct_import, attr_name, None)
|
| 451 |
+
if attr is None:
|
| 452 |
+
message = f"`{module_name}.{attr_name}` is deprecated..."
|
| 453 |
+
else:
|
| 454 |
+
message = f"Please import `{attr_name}` from the `{import_name}`..."
|
| 455 |
+
with pytest.deprecated_call(match=message):
|
| 456 |
+
getattr(module, attr_name)
|
| 457 |
+
|
| 458 |
+
# Attributes that were not in `module_name` get an error notifying the user
|
| 459 |
+
# that the attribute is not in `module_name` and that `module_name` is deprecated.
|
| 460 |
+
message = f"`{module_name}` is deprecated..."
|
| 461 |
+
with pytest.raises(AttributeError, match=message):
|
| 462 |
+
getattr(module, "ekki")
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
def test_misc_doccer_deprecation():
|
| 466 |
+
# gh-18279, gh-17572, gh-17771 noted that deprecation warnings
|
| 467 |
+
# for imports from private modules were misleading.
|
| 468 |
+
# Check that this is resolved.
|
| 469 |
+
# `test_private_but_present_deprecation` cannot be used since `correct_import`
|
| 470 |
+
# is a different subpackage (`_lib` instead of `misc`).
|
| 471 |
+
module = import_module('scipy.misc.doccer')
|
| 472 |
+
correct_import = import_module('scipy._lib.doccer')
|
| 473 |
+
|
| 474 |
+
# Attributes that were formerly in `scipy.misc.doccer` can still be imported from
|
| 475 |
+
# `scipy.misc.doccer`, albeit with a deprecation warning. The specific message
|
| 476 |
+
# depends on whether the attribute is in `scipy._lib.doccer` or not.
|
| 477 |
+
for attr_name in module.__all__:
|
| 478 |
+
attr = getattr(correct_import, attr_name, None)
|
| 479 |
+
if attr is None:
|
| 480 |
+
message = f"`scipy.misc.{attr_name}` is deprecated..."
|
| 481 |
+
else:
|
| 482 |
+
message = f"Please import `{attr_name}` from the `scipy._lib.doccer`..."
|
| 483 |
+
with pytest.deprecated_call(match=message):
|
| 484 |
+
getattr(module, attr_name)
|
| 485 |
+
|
| 486 |
+
# Attributes that were not in `scipy.misc.doccer` get an error
|
| 487 |
+
# notifying the user that the attribute is not in `scipy.misc.doccer`
|
| 488 |
+
# and that `scipy.misc.doccer` is deprecated.
|
| 489 |
+
message = "`scipy.misc.doccer` is deprecated..."
|
| 490 |
+
with pytest.raises(AttributeError, match=message):
|
| 491 |
+
getattr(module, "ekki")
|