diff options
author | shadchin <shadchin@yandex-team.com> | 2023-11-27 20:58:03 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2023-11-27 21:30:01 +0300 |
commit | 5bb4e90974958750a82f9055c1e8086bbc292379 (patch) | |
tree | a15fedd1996d4cb881c9a7b5e50ea44bcab641a7 | |
parent | 9b5a63115fe14de9ec5c3dabbb18cf8bac373d77 (diff) | |
download | ydb-5bb4e90974958750a82f9055c1e8086bbc292379.tar.gz |
Update numpy to 1.26.2
235 files changed, 13874 insertions, 11773 deletions
diff --git a/contrib/python/numpy/py3/.dist-info/METADATA b/contrib/python/numpy/py3/.dist-info/METADATA index ed54cb49b3..7341e57f9d 100644 --- a/contrib/python/numpy/py3/.dist-info/METADATA +++ b/contrib/python/numpy/py3/.dist-info/METADATA @@ -1,21 +1,986 @@ Metadata-Version: 2.1 Name: numpy -Version: 1.25.2 +Version: 1.26.2 Summary: Fundamental package for array computing in Python -Home-page: https://www.numpy.org +Home-page: https://numpy.org Author: Travis E. Oliphant et al. -Maintainer: NumPy Developers -Maintainer-email: numpy-discussion@python.org -License: BSD-3-Clause -Download-URL: https://pypi.python.org/pypi/numpy -Project-URL: Bug Tracker, https://github.com/numpy/numpy/issues -Project-URL: Documentation, https://numpy.org/doc/1.25 -Project-URL: Source Code, https://github.com/numpy/numpy -Platform: Windows -Platform: Linux -Platform: Solaris -Platform: Mac OS-X -Platform: Unix +Maintainer-Email: NumPy Developers <numpy-discussion@python.org> +License: Copyright (c) 2005-2023, NumPy Developers. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the NumPy Developers nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ---- + + The NumPy repository and source distributions bundle several libraries that are + compatibly licensed. We list these here. + + Name: lapack-lite + Files: numpy/linalg/lapack_lite/* + License: BSD-3-Clause + For details, see numpy/linalg/lapack_lite/LICENSE.txt + + Name: tempita + Files: tools/npy_tempita/* + License: MIT + For details, see tools/npy_tempita/license.txt + + Name: dragon4 + Files: numpy/core/src/multiarray/dragon4.c + License: MIT + For license text, see numpy/core/src/multiarray/dragon4.c + + Name: libdivide + Files: numpy/core/include/numpy/libdivide/* + License: Zlib + For license text, see numpy/core/include/numpy/libdivide/LICENSE.txt + + + Note that the following files are vendored in the repository and sdist but not + installed in built numpy packages: + + Name: Meson + Files: vendored-meson/meson/* + License: Apache 2.0 + For license text, see vendored-meson/meson/COPYING + + Name: meson-python + Files: vendored-meson/meson-python/* + License: MIT + For license text, see vendored-meson/meson-python/LICENSE + + Name: spin + Files: .spin/cmds.py + License: BSD-3 + For license text, see .spin/LICENSE + + ---- + + This binary distribution of NumPy also bundles the following software: + + + Name: OpenBLAS + Files: numpy.libs/libopenblas*.so + Description: bundled as a dynamically linked library + Availability: https://github.com/OpenMathLib/OpenBLAS/ + License: BSD-3-Clause + Copyright (c) 2011-2014, The OpenBLAS Project + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. Neither the name of the OpenBLAS project nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + Name: LAPACK + Files: numpy.libs/libopenblas*.so + Description: bundled in OpenBLAS + Availability: https://github.com/OpenMathLib/OpenBLAS/ + License: BSD-3-Clause-Attribution + Copyright (c) 1992-2013 The University of Tennessee and The University + of Tennessee Research Foundation. All rights + reserved. + Copyright (c) 2000-2013 The University of California Berkeley. All + rights reserved. + Copyright (c) 2006-2013 The University of Colorado Denver. All rights + reserved. + + $COPYRIGHT$ + + Additional copyrights may follow + + $HEADER$ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer listed + in this license in the documentation and/or other materials + provided with the distribution. + + - Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + The copyright holders provide no reassurances that the source code + provided does not infringe any patent, copyright, or any other + intellectual property rights of third parties. The copyright holders + disclaim any liability to any recipient for claims brought against + recipient by any third party for infringement of that parties + intellectual property rights. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + Name: GCC runtime library + Files: numpy.libs/libgfortran*.so + Description: dynamically linked to files compiled with gcc + Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgfortran + License: GPL-3.0-with-GCC-exception + Copyright (C) 2002-2017 Free Software Foundation, Inc. + + Libgfortran is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + Libgfortran is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. + + ---- + + Full text of license texts referred to above follows (that they are + listed below does not necessarily imply the conditions apply to the + present binary release): + + ---- + + GCC RUNTIME LIBRARY EXCEPTION + + Version 3.1, 31 March 2009 + + Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/> + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + + This GCC Runtime Library Exception ("Exception") is an additional + permission under section 7 of the GNU General Public License, version + 3 ("GPLv3"). It applies to a given file (the "Runtime Library") that + bears a notice placed by the copyright holder of the file stating that + the file is governed by GPLv3 along with this Exception. + + When you use GCC to compile a program, GCC may combine portions of + certain GCC header files and runtime libraries with the compiled + program. The purpose of this Exception is to allow compilation of + non-GPL (including proprietary) programs to use, in this way, the + header files and runtime libraries covered by this Exception. + + 0. Definitions. + + A file is an "Independent Module" if it either requires the Runtime + Library for execution after a Compilation Process, or makes use of an + interface provided by the Runtime Library, but is not otherwise based + on the Runtime Library. + + "GCC" means a version of the GNU Compiler Collection, with or without + modifications, governed by version 3 (or a specified later version) of + the GNU General Public License (GPL) with the option of using any + subsequent versions published by the FSF. + + "GPL-compatible Software" is software whose conditions of propagation, + modification and use would permit combination with GCC in accord with + the license of GCC. + + "Target Code" refers to output from any compiler for a real or virtual + target processor architecture, in executable form or suitable for + input to an assembler, loader, linker and/or execution + phase. Notwithstanding that, Target Code does not include data in any + format that is used as a compiler intermediate representation, or used + for producing a compiler intermediate representation. + + The "Compilation Process" transforms code entirely represented in + non-intermediate languages designed for human-written code, and/or in + Java Virtual Machine byte code, into Target Code. Thus, for example, + use of source code generators and preprocessors need not be considered + part of the Compilation Process, since the Compilation Process can be + understood as starting with the output of the generators or + preprocessors. + + A Compilation Process is "Eligible" if it is done using GCC, alone or + with other GPL-compatible software, or if it is done without using any + work based on GCC. For example, using non-GPL-compatible Software to + optimize any GCC intermediate representations would not qualify as an + Eligible Compilation Process. + + 1. Grant of Additional Permission. + + You have permission to propagate a work of Target Code formed by + combining the Runtime Library with Independent Modules, even if such + propagation would otherwise violate the terms of GPLv3, provided that + all Target Code was generated by Eligible Compilation Processes. You + may then convey such a combination under terms of your choice, + consistent with the licensing of the Independent Modules. + + 2. No Weakening of GCC Copyleft. + + The availability of this Exception does not imply any general + presumption that third-party software is unaffected by the copyleft + requirements of the license of GCC. + + ---- + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for + software and other kinds of works. + + The licenses for most software and other practical works are designed + to take away your freedom to share and change the works. By contrast, + the GNU General Public License is intended to guarantee your freedom to + share and change all versions of a program--to make sure it remains free + software for all its users. We, the Free Software Foundation, use the + GNU General Public License for most of our software; it applies also to + any other work released this way by its authors. You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + them if you wish), that you receive source code or can get it if you + want it, that you can change the software or use pieces of it in new + free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you + these rights or asking you to surrender the rights. Therefore, you have + certain responsibilities if you distribute copies of the software, or if + you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must pass on to the recipients the same + freedoms that you received. You must make sure that they, too, receive + or can get the source code. And you must show them these terms so they + know their rights. + + Developers that use the GNU GPL protect your rights with two steps: + (1) assert copyright on the software, and (2) offer you this License + giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains + that there is no warranty for this free software. For both users' and + authors' sake, the GPL requires that modified versions be marked as + changed, so that their problems will not be attributed erroneously to + authors of previous versions. + + Some devices are designed to deny users access to install or run + modified versions of the software inside them, although the manufacturer + can do so. This is fundamentally incompatible with the aim of + protecting users' freedom to change the software. The systematic + pattern of such abuse occurs in the area of products for individuals to + use, which is precisely where it is most unacceptable. Therefore, we + have designed this version of the GPL to prohibit the practice for those + products. If such problems arise substantially in other domains, we + stand ready to extend this provision to those domains in future versions + of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. + States should not allow patents to restrict development and use of + software on general-purpose computers, but in those that do, we wish to + avoid the special danger that patents applied to a free program could + make it effectively proprietary. To prevent this, the GPL assures that + patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and + modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of + works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work + in a fashion requiring copyright permission, other than the making of an + exact copy. The resulting work is called a "modified version" of the + earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based + on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on a + computer or modifying a private copy. Propagation includes copying, + distribution (with or without modification), making available to the + public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user through + a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to the + extent that warranties are provided), that licensees may convey the + work under this License, and how to view a copy of this License. If + the interface presents a list of user commands or options, such as a + menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an official + standard defined by a recognized standards body, or, in the case of + interfaces specified for a particular programming language, one that + is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other + than the work as a whole, that (a) is included in the normal form of + packaging a Major Component, but which is not part of that Major + Component, and (b) serves only to enable use of the work with that + Major Component, or to implement a Standard Interface for which an + implementation is available to the public in source code form. A + "Major Component", in this context, means a major essential component + (kernel, window system, and so on) of the specific operating system + (if any) on which the executable work runs, or a compiler used to + produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts to + control those activities. However, it does not include the work's + System Libraries, or general-purpose tools or generally available free + programs which are used unmodified in performing those activities but + which are not part of the work. For example, Corresponding Source + includes interface definition files associated with source files for + the work, and the source code for shared libraries and dynamically + linked subprograms that the work is specifically designed to require, + such as by intimate data communication or control flow between those + subprograms and other parts of the work. + + The Corresponding Source need not include anything that users + can regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running a + covered work is covered by this License only if the output, given its + content, constitutes a covered work. This License acknowledges your + rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise remains + in force. You may convey covered works to others for the sole purpose + of having them make modifications exclusively for you, or provide you + with facilities for running those works, provided that you comply with + the terms of this License in conveying all material for which you do + not control copyright. Those thus making or running the covered works + for you must do so exclusively on your behalf, under your direction + and control, on terms that prohibit them from making any copies of + your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section 10 + makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under article + 11 of the WIPO copyright treaty adopted on 20 December 1996, or + similar laws prohibiting or restricting circumvention of such + measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such circumvention + is effected by exercising rights under this License with respect to + the covered work, and you disclaim any intention to limit operation or + modification of the work as a means of enforcing, against the work's + users, your or third parties' legal rights to forbid circumvention of + technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the code; + keep intact all notices of the absence of any warranty; and give all + recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered work, + and which are not combined with it such as to form a larger program, + in or on a volume of a storage or distribution medium, is called an + "aggregate" if the compilation and its resulting copyright are not + used to limit the access or legal rights of the compilation's users + beyond what the individual works permit. Inclusion of a covered work + in an aggregate does not cause this License to apply to the other + parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this License, + in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded + from the Corresponding Source as a System Library, need not be + included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any + tangible personal property which is normally used for personal, family, + or household purposes, or (2) anything designed or sold for incorporation + into a dwelling. In determining whether a product is a consumer product, + doubtful cases shall be resolved in favor of coverage. For a particular + product received by a particular user, "normally used" refers to a + typical or common use of that class of product, regardless of the status + of the particular user or of the way in which the particular user + actually uses, or expects or is expected to use, the product. A product + is a consumer product regardless of whether the product has substantial + commercial, industrial or non-consumer uses, unless such uses represent + the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to install + and execute modified versions of a covered work in that User Product from + a modified version of its Corresponding Source. The information must + suffice to ensure that the continued functioning of the modified object + code is in no case prevented or interfered with solely because + modification has been made. + + If you convey an object code work under this section in, or with, or + specifically for use in, a User Product, and the conveying occurs as + part of a transaction in which the right of possession and use of the + User Product is transferred to the recipient in perpetuity or for a + fixed term (regardless of how the transaction is characterized), the + Corresponding Source conveyed under this section must be accompanied + by the Installation Information. But this requirement does not apply + if neither you nor any third party retains the ability to install + modified object code on the User Product (for example, the work has + been installed in ROM). + + The requirement to provide Installation Information does not include a + requirement to continue to provide support service, warranty, or updates + for a work that has been modified or installed by the recipient, or for + the User Product in which it has been modified or installed. Access to a + network may be denied when the modification itself materially and + adversely affects the operation of the network or violates the rules and + protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, + in accord with this section must be in a format that is publicly + documented (and with an implementation available to the public in + source code form), and must require no special password or key for + unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this + License by making exceptions from one or more of its conditions. + Additional permissions that are applicable to the entire Program shall + be treated as though they were included in this License, to the extent + that they are valid under applicable law. If additional permissions + apply only to part of the Program, that part may be used separately + under those permissions, but the entire Program remains governed by + this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part of + it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you + add to a covered work, you may (if authorized by the copyright holders of + that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as you + received it, or any part of it, contains a notice stating that it is + governed by this License along with a term that is a further + restriction, you may remove that term. If a license document contains + a further restriction but permits relicensing or conveying under this + License, you may add to a covered work material governed by the terms + of that license document, provided that the further restriction does + not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the + form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights under + this License (including any patent licenses granted under the third + paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the copyright + holder fails to notify you of the violation by some reasonable means + prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from that + copyright holder, and you cure the violation prior to 30 days after + your receipt of the notice. + + Termination of your rights under this section does not terminate the + licenses of parties who have received copies or rights from you under + this License. If your rights have been terminated and not permanently + reinstated, you do not qualify to receive new licenses for the same + material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer transmission + to receive a copy likewise does not require acceptance. However, + nothing other than this License grants you permission to propagate or + modify any covered work. These actions infringe copyright if you do + not accept this License. Therefore, by modifying or propagating a + covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not responsible + for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a covered + work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or could + give under the previous paragraph, plus a right to possession of the + Corresponding Source of the work from the predecessor in interest, if + the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you may + not impose a license fee, royalty, or other charge for exercise of + rights granted under this License, and you may not initiate litigation + (including a cross-claim or counterclaim in a lawsuit) alleging that + any patent claim is infringed by making, using, selling, offering for + sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. The + work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, permitted + by this License, of making, using, or selling its contributor version, + but do not include claims that would be infringed only as a + consequence of further modification of the contributor version. For + purposes of this definition, "control" includes the right to grant + patent sublicenses in a manner consistent with the requirements of + this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free + patent license under the contributor's essential patent claims, to + make, use, sell, offer for sale, import and otherwise run, modify and + propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express + agreement or commitment, however denominated, not to enforce a patent + (such as an express permission to practice a patent or covenant not to + sue for patent infringement). To "grant" such a patent license to a + party means to make such an agreement or commitment not to enforce a + patent against the party. + + If you convey a covered work, knowingly relying on a patent license, + and the Corresponding Source of the work is not available for anyone + to copy, free of charge and under the terms of this License, through a + publicly available network server or other readily accessible means, + then you must either (1) cause the Corresponding Source to be so + available, or (2) arrange to deprive yourself of the benefit of the + patent license for this particular work, or (3) arrange, in a manner + consistent with the requirements of this License, to extend the patent + license to downstream recipients. "Knowingly relying" means you have + actual knowledge that, but for the patent license, your conveying the + covered work in a country, or your recipient's use of the covered work + in a country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, modify + or convey a specific copy of the covered work, then the patent license + you grant is automatically extended to all recipients of the covered + work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that are + specifically granted under this License. You may not convey a covered + work if you are a party to an arrangement with a third party that is + in the business of distributing software, under which you make payment + to the third party based on the extent of your activity of conveying + the work, and under which the third party grants, to any of the + parties who would receive the covered work from you, a discriminatory + patent license (a) in connection with copies of the covered work + conveyed by you (or copies made from those copies), or (b) primarily + for and in connection with specific products or compilations that + contain the covered work, unless you entered into that arrangement, + or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot convey a + covered work so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you may + not convey it at all. For example, if you agree to terms that obligate you + to collect a royalty for further conveying from those to whom you convey + the Program, the only way you could satisfy both those terms and this + License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a single + combined work, and to convey the resulting work. The terms of this + License will continue to apply to the part which is the covered work, + but the special requirements of the GNU Affero General Public License, + section 13, concerning interaction through a network will apply to the + combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of + the GNU General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU General + Public License "or any later version" applies to it, you have the + option of following the terms and conditions either of that numbered + version or of any later version published by the Free Software + Foundation. If the Program does not specify a version number of the + GNU General Public License, you may choose any version ever published + by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that proxy's + public statement of acceptance of a version permanently authorizes you + to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT + HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY + OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM + IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF + ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS + THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY + GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE + USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), + EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely approximates + an absolute waiver of all civil liability in connection with the + Program, unless a warranty or assumption of liability accompanies a + copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + state the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short + notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, your program's commands + might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, + if any, to sign a "copyright disclaimer" for the program, if necessary. + For more information on this, and how to apply and follow the GNU GPL, see + <http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program + into proprietary programs. If your program is a subroutine library, you + may consider it more useful to permit linking proprietary applications with + the library. If this is what you want to do, use the GNU Lesser General + Public License instead of this License. But first, please read + <http://www.gnu.org/philosophy/why-not-lgpl.html>. + + Name: libquadmath + Files: numpy.libs/libquadmath*.so + Description: dynamically linked to files compiled with gcc + Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libquadmath + License: LGPL-2.1-or-later + + GCC Quad-Precision Math Library + Copyright (C) 2010-2019 Free Software Foundation, Inc. + Written by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + This file is part of the libquadmath library. + Libquadmath is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Libquadmath is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Science/Research Classifier: Intended Audience :: Developers @@ -26,6 +991,7 @@ Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Software Development @@ -35,10 +1001,14 @@ Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX Classifier: Operating System :: Unix Classifier: Operating System :: MacOS +Project-URL: Homepage, https://numpy.org +Project-URL: Documentation, https://numpy.org/doc/ +Project-URL: Source, https://github.com/numpy/numpy +Project-URL: Download, https://pypi.org/project/numpy/#files +Project-URL: Tracker, https://github.com/numpy/numpy/issues +Project-URL: Release notes, https://numpy.org/doc/stable/release Requires-Python: >=3.9 Description-Content-Type: text/markdown -License-File: LICENSE.txt -License-File: LICENSES_bundled.txt <h1 align="center"> <img src="https://raw.githubusercontent.com/numpy/numpy/main/branding/logo/primary/numpylogo.svg" width="300"> @@ -125,5 +1095,3 @@ mailing list. You are very welcome to join. If you are new to contributing to open source, [this guide](https://opensource.guide/how-to-contribute/) helps explain why, what, and how to successfully get involved. - - diff --git a/contrib/python/numpy/py3/.dist-info/entry_points.txt b/contrib/python/numpy/py3/.dist-info/entry_points.txt index fce7424b73..450d8ef27b 100644 --- a/contrib/python/numpy/py3/.dist-info/entry_points.txt +++ b/contrib/python/numpy/py3/.dist-info/entry_points.txt @@ -1,11 +1,9 @@ [array_api] numpy = numpy.array_api -[console_scripts] -f2py = numpy.f2py.f2py2e:main -f2py3 = numpy.f2py.f2py2e:main -f2py3.11 = numpy.f2py.f2py2e:main - [pyinstaller40] hook-dirs = numpy:_pyinstaller_hooks_dir +[console_scripts] +f2py = numpy.f2py.f2py2e:main + diff --git a/contrib/python/numpy/py3/LICENSE.txt b/contrib/python/numpy/py3/LICENSE.txt index 2dfbf61c05..014d51c98d 100644 --- a/contrib/python/numpy/py3/LICENSE.txt +++ b/contrib/python/numpy/py3/LICENSE.txt @@ -28,27 +28,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -The NumPy repository and source distributions bundle several libraries that are -compatibly licensed. We list these here. - -Name: lapack-lite -Files: numpy/linalg/lapack_lite/* -License: BSD-3-Clause - For details, see numpy/linalg/lapack_lite/LICENSE.txt - -Name: tempita -Files: tools/npy_tempita/* -License: MIT - For details, see tools/npy_tempita/license.txt - -Name: dragon4 -Files: numpy/core/src/multiarray/dragon4.c -License: MIT - For license text, see numpy/core/src/multiarray/dragon4.c - -Name: libdivide -Files: numpy/core/include/numpy/libdivide/* -License: Zlib - For license text, see numpy/core/include/numpy/libdivide/LICENSE.txt diff --git a/contrib/python/numpy/py3/LICENSES_bundled.txt b/contrib/python/numpy/py3/LICENSES_bundled.txt new file mode 100644 index 0000000000..26faf7ff30 --- /dev/null +++ b/contrib/python/numpy/py3/LICENSES_bundled.txt @@ -0,0 +1,41 @@ +The NumPy repository and source distributions bundle several libraries that are +compatibly licensed. We list these here. + +Name: lapack-lite +Files: numpy/linalg/lapack_lite/* +License: BSD-3-Clause + For details, see numpy/linalg/lapack_lite/LICENSE.txt + +Name: tempita +Files: tools/npy_tempita/* +License: MIT + For details, see tools/npy_tempita/license.txt + +Name: dragon4 +Files: numpy/core/src/multiarray/dragon4.c +License: MIT + For license text, see numpy/core/src/multiarray/dragon4.c + +Name: libdivide +Files: numpy/core/include/numpy/libdivide/* +License: Zlib + For license text, see numpy/core/include/numpy/libdivide/LICENSE.txt + + +Note that the following files are vendored in the repository and sdist but not +installed in built numpy packages: + +Name: Meson +Files: vendored-meson/meson/* +License: Apache 2.0 + For license text, see vendored-meson/meson/COPYING + +Name: meson-python +Files: vendored-meson/meson-python/* +License: MIT + For license text, see vendored-meson/meson-python/LICENSE + +Name: spin +Files: .spin/cmds.py +License: BSD-3 + For license text, see .spin/LICENSE diff --git a/contrib/python/numpy/py3/numpy/__init__.cython-30.pxd b/contrib/python/numpy/py3/numpy/__init__.cython-30.pxd index 0dd2fff2b8..1409514f7a 100644 --- a/contrib/python/numpy/py3/numpy/__init__.cython-30.pxd +++ b/contrib/python/numpy/py3/numpy/__init__.cython-30.pxd @@ -21,7 +21,7 @@ cdef extern from *: cdef extern from "Python.h": - ctypedef Py_ssize_t Py_intptr_t + ctypedef int Py_intptr_t cdef extern from "numpy/arrayobject.h": ctypedef Py_intptr_t npy_intp @@ -852,6 +852,7 @@ cdef extern from "numpy/arrayscalars.h": NPY_FR_ps NPY_FR_fs NPY_FR_as + NPY_FR_GENERIC # diff --git a/contrib/python/numpy/py3/numpy/__init__.pxd b/contrib/python/numpy/py3/numpy/__init__.pxd index 47d9294c1c..ca0a3a6c52 100644 --- a/contrib/python/numpy/py3/numpy/__init__.pxd +++ b/contrib/python/numpy/py3/numpy/__init__.pxd @@ -810,6 +810,7 @@ cdef extern from "numpy/arrayscalars.h": NPY_FR_ps NPY_FR_fs NPY_FR_as + NPY_FR_GENERIC # diff --git a/contrib/python/numpy/py3/numpy/__init__.py b/contrib/python/numpy/py3/numpy/__init__.py index a6c9fe1603..4120c2c116 100644 --- a/contrib/python/numpy/py3/numpy/__init__.py +++ b/contrib/python/numpy/py3/numpy/__init__.py @@ -66,7 +66,7 @@ testing NumPy testing tools distutils Enhancements to distutils with support for - Fortran compilers support and more. + Fortran compilers support and more (for Python <= 3.11). Utilities --------- @@ -108,6 +108,11 @@ from .exceptions import ( ComplexWarning, ModuleDeprecationWarning, VisibleDeprecationWarning, TooHardError, AxisError) + +# If a version with git hash was stored, use that instead +from . import version +from .version import __version__ + # We first need to detect if we're being called as part of the numpy setup # procedure itself in a reliable manner. try: @@ -447,8 +452,5 @@ else: del os -# get the version using versioneer -from .version import __version__, git_revision as __git_version__ - # Remove symbols imported for internal use del sys, warnings diff --git a/contrib/python/numpy/py3/numpy/__init__.pyi b/contrib/python/numpy/py3/numpy/__init__.pyi index 45c3023c6a..a185bfe754 100644 --- a/contrib/python/numpy/py3/numpy/__init__.pyi +++ b/contrib/python/numpy/py3/numpy/__init__.pyi @@ -1,4 +1,5 @@ import builtins +import sys import os import mmap import ctypes as ct @@ -666,7 +667,6 @@ class _SupportsWrite(Protocol[_AnyStr_contra]): __all__: list[str] __path__: list[str] __version__: str -__git_version__: str test: PytestTester # TODO: Move placeholders to their respective module once @@ -683,6 +683,7 @@ _ByteOrder = L["S", "<", ">", "=", "|", "L", "B", "N", "I"] @final class dtype(Generic[_DTypeScalar_co]): names: None | tuple[builtins.str, ...] + def __hash__(self) -> int: ... # Overload for subclass of generic @overload def __new__( @@ -1440,17 +1441,18 @@ _ShapeType = TypeVar("_ShapeType", bound=Any) _ShapeType2 = TypeVar("_ShapeType2", bound=Any) _NumberType = TypeVar("_NumberType", bound=number[Any]) -# There is currently no exhaustive way to type the buffer protocol, -# as it is implemented exclusively in the C API (python/typing#593) -_SupportsBuffer = Union[ - bytes, - bytearray, - memoryview, - _array.array[Any], - mmap.mmap, - NDArray[Any], - generic, -] +if sys.version_info >= (3, 12): + from collections.abc import Buffer as _SupportsBuffer +else: + _SupportsBuffer = ( + bytes + | bytearray + | memoryview + | _array.array[Any] + | mmap.mmap + | NDArray[Any] + | generic + ) _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) @@ -1513,6 +1515,9 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType_co]): order: _OrderKACF = ..., ) -> _ArraySelf: ... + if sys.version_info >= (3, 12): + def __buffer__(self, flags: int, /) -> memoryview: ... + def __class_getitem__(self, item: Any) -> GenericAlias: ... @overload @@ -2555,6 +2560,7 @@ class generic(_ArrayOrScalarCommon): def __array__(self: _ScalarType, dtype: None = ..., /) -> ndarray[Any, _dtype[_ScalarType]]: ... @overload def __array__(self, dtype: _DType, /) -> ndarray[Any, _DType]: ... + def __hash__(self) -> int: ... @property def base(self) -> None: ... @property @@ -2569,6 +2575,9 @@ class generic(_ArrayOrScalarCommon): @property def flat(self: _ScalarType) -> flatiter[ndarray[Any, _dtype[_ScalarType]]]: ... + if sys.version_info >= (3, 12): + def __buffer__(self, flags: int, /) -> memoryview: ... + @overload def astype( self, @@ -2771,6 +2780,9 @@ class object_(generic): def __float__(self) -> float: ... def __complex__(self) -> complex: ... + if sys.version_info >= (3, 12): + def __release_buffer__(self, buffer: memoryview, /) -> None: ... + # The `datetime64` constructors requires an object with the three attributes below, # and thus supports datetime duck typing class _DatetimeScalar(Protocol): diff --git a/contrib/python/numpy/py3/numpy/_build_utils/gitversion.py b/contrib/python/numpy/py3/numpy/_build_utils/gitversion.py new file mode 100644 index 0000000000..4ee6e00bbd --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_build_utils/gitversion.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +import os +import textwrap + + +def init_version(): + init = os.path.join(os.path.dirname(__file__), '../../pyproject.toml') + with open(init) as fid: + data = fid.readlines() + + version_line = next( + line for line in data if line.startswith('version =') + ) + + version = version_line.strip().split(' = ')[1] + version = version.replace('"', '').replace("'", '') + + return version + + +def git_version(version): + # Append last commit date and hash to dev version information, + # if available + + import subprocess + import os.path + + git_hash = '' + try: + p = subprocess.Popen( + ['git', 'log', '-1', '--format="%H %aI"'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=os.path.dirname(__file__), + ) + except FileNotFoundError: + pass + else: + out, err = p.communicate() + if p.returncode == 0: + git_hash, git_date = ( + out.decode('utf-8') + .strip() + .replace('"', '') + .split('T')[0] + .replace('-', '') + .split() + ) + + # Only attach git tag to development versions + if 'dev' in version: + version += f'+git{git_date}.{git_hash[:7]}' + + return version, git_hash + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument('--write', help="Save version to this file") + parser.add_argument( + '--meson-dist', + help='Output path is relative to MESON_DIST_ROOT', + action='store_true' + ) + args = parser.parse_args() + + version, git_hash = git_version(init_version()) + + # For NumPy 2.0, this should only have one field: `version` + template = textwrap.dedent(f''' + version = "{version}" + __version__ = version + full_version = version + + git_revision = "{git_hash}" + release = 'dev' not in version and '+' not in version + short_version = version.split("+")[0] + ''') + + if args.write: + outfile = args.write + if args.meson_dist: + outfile = os.path.join( + os.environ.get('MESON_DIST_ROOT', ''), + outfile + ) + + # Print human readable output path + relpath = os.path.relpath(outfile) + if relpath.startswith('.'): + relpath = outfile + + with open(outfile, 'w') as f: + print(f'Saving version to {relpath}') + f.write(template) + else: + print(version) diff --git a/contrib/python/numpy/py3/numpy/_build_utils/tempita.py b/contrib/python/numpy/py3/numpy/_build_utils/tempita.py index 3bcc789c56..3bcc789c56 100755..100644 --- a/contrib/python/numpy/py3/numpy/_build_utils/tempita.py +++ b/contrib/python/numpy/py3/numpy/_build_utils/tempita.py diff --git a/contrib/python/numpy/py3/numpy/_core/__init__.py b/contrib/python/numpy/py3/numpy/_core/__init__.py new file mode 100644 index 0000000000..a2f096f3f1 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/__init__.py @@ -0,0 +1,4 @@ +""" +This private module only contains stubs for interoperability with +NumPy 2.0 pickled arrays. It may not be used by the end user. +""" diff --git a/contrib/python/numpy/py3/numpy/_core/__init__.pyi b/contrib/python/numpy/py3/numpy/_core/__init__.pyi new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/__init__.pyi diff --git a/contrib/python/numpy/py3/numpy/_core/_dtype.py b/contrib/python/numpy/py3/numpy/_core/_dtype.py new file mode 100644 index 0000000000..974d93d98c --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/_dtype.py @@ -0,0 +1,6 @@ +from numpy.core import _dtype + +_globals = globals() + +for item in _dtype.__dir__(): + _globals[item] = getattr(_dtype, item) diff --git a/contrib/python/numpy/py3/numpy/_core/_dtype_ctypes.py b/contrib/python/numpy/py3/numpy/_core/_dtype_ctypes.py new file mode 100644 index 0000000000..bfa16aabf4 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/_dtype_ctypes.py @@ -0,0 +1,6 @@ +from numpy.core import _dtype_ctypes + +_globals = globals() + +for item in _dtype_ctypes.__dir__(): + _globals[item] = getattr(_dtype_ctypes, item) diff --git a/contrib/python/numpy/py3/numpy/_core/_internal.py b/contrib/python/numpy/py3/numpy/_core/_internal.py new file mode 100644 index 0000000000..52a8e90729 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/_internal.py @@ -0,0 +1,6 @@ +from numpy.core import _internal + +_globals = globals() + +for item in _internal.__dir__(): + _globals[item] = getattr(_internal, item) diff --git a/contrib/python/numpy/py3/numpy/_core/_multiarray_umath.py b/contrib/python/numpy/py3/numpy/_core/_multiarray_umath.py new file mode 100644 index 0000000000..7ce48fcb25 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/_multiarray_umath.py @@ -0,0 +1,6 @@ +from numpy.core import _multiarray_umath + +_globals = globals() + +for item in _multiarray_umath.__dir__(): + _globals[item] = getattr(_multiarray_umath, item) diff --git a/contrib/python/numpy/py3/numpy/_core/multiarray.py b/contrib/python/numpy/py3/numpy/_core/multiarray.py new file mode 100644 index 0000000000..6c37d1da9f --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/multiarray.py @@ -0,0 +1,6 @@ +from numpy.core import multiarray + +_globals = globals() + +for item in multiarray.__dir__(): + _globals[item] = getattr(multiarray, item) diff --git a/contrib/python/numpy/py3/numpy/_core/umath.py b/contrib/python/numpy/py3/numpy/_core/umath.py new file mode 100644 index 0000000000..3d08c90332 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_core/umath.py @@ -0,0 +1,6 @@ +from numpy.core import umath + +_globals = globals() + +for item in umath.__dir__(): + _globals[item] = getattr(umath, item) diff --git a/contrib/python/numpy/py3/numpy/_distributor_init.py b/contrib/python/numpy/py3/numpy/_distributor_init.py index d893ba3771..25b0eed79f 100644 --- a/contrib/python/numpy/py3/numpy/_distributor_init.py +++ b/contrib/python/numpy/py3/numpy/_distributor_init.py @@ -3,8 +3,13 @@ Distributors: you can add custom code here to support particular distributions of numpy. -For example, this is a good place to put any checks for hardware requirements. +For example, this is a good place to put any BLAS/LAPACK initialization code. The numpy standard source distribution will not put code in this file, so you can safely replace this file with your own version. """ + +try: + from . import _distributor_init_local +except ImportError: + pass diff --git a/contrib/python/numpy/py3/numpy/_pytesttester.py b/contrib/python/numpy/py3/numpy/_pytesttester.py index 01ddaaf988..1c38291ae3 100644 --- a/contrib/python/numpy/py3/numpy/_pytesttester.py +++ b/contrib/python/numpy/py3/numpy/_pytesttester.py @@ -135,12 +135,13 @@ class PytestTester: # offset verbosity. The "-q" cancels a "-v". pytest_args += ["-q"] - with warnings.catch_warnings(): - warnings.simplefilter("always") - # Filter out distutils cpu warnings (could be localized to - # distutils tests). ASV has problems with top level import, - # so fetch module for suppression here. - from numpy.distutils import cpuinfo + if sys.version_info < (3, 12): + with warnings.catch_warnings(): + warnings.simplefilter("always") + # Filter out distutils cpu warnings (could be localized to + # distutils tests). ASV has problems with top level import, + # so fetch module for suppression here. + from numpy.distutils import cpuinfo with warnings.catch_warnings(record=True): # Ignore the warning from importing the array_api submodule. This diff --git a/contrib/python/numpy/py3/numpy/_typing/_array_like.py b/contrib/python/numpy/py3/numpy/_typing/_array_like.py index cba6fffaf9..883e817d9a 100644 --- a/contrib/python/numpy/py3/numpy/_typing/_array_like.py +++ b/contrib/python/numpy/py3/numpy/_typing/_array_like.py @@ -1,7 +1,9 @@ from __future__ import annotations +import sys from collections.abc import Collection, Callable, Sequence from typing import Any, Protocol, Union, TypeVar, runtime_checkable + from numpy import ( ndarray, dtype, @@ -76,17 +78,18 @@ _DualArrayLike = Union[ _NestedSequence[_T], ] -# TODO: support buffer protocols once -# -# https://bugs.python.org/issue27501 -# -# is resolved. See also the mypy issue: -# -# https://github.com/python/typing/issues/593 -ArrayLike = _DualArrayLike[ - dtype[Any], - Union[bool, int, float, complex, str, bytes], -] +if sys.version_info >= (3, 12): + from collections.abc import Buffer + + ArrayLike = Buffer | _DualArrayLike[ + dtype[Any], + Union[bool, int, float, complex, str, bytes], + ] +else: + ArrayLike = _DualArrayLike[ + dtype[Any], + Union[bool, int, float, complex, str, bytes], + ] # `ArrayLike<X>_co`: array-like objects that can be coerced into `X` # given the casting rules `same_kind` diff --git a/contrib/python/numpy/py3/numpy/_typing/_nested_sequence.py b/contrib/python/numpy/py3/numpy/_typing/_nested_sequence.py index 4b6cafc510..3d0d25ae5b 100644 --- a/contrib/python/numpy/py3/numpy/_typing/_nested_sequence.py +++ b/contrib/python/numpy/py3/numpy/_typing/_nested_sequence.py @@ -5,7 +5,6 @@ from __future__ import annotations from collections.abc import Iterator from typing import ( Any, - overload, TypeVar, Protocol, runtime_checkable, @@ -62,12 +61,7 @@ class _NestedSequence(Protocol[_T_co]): """Implement ``len(self)``.""" raise NotImplementedError - @overload - def __getitem__(self, index: int, /) -> _T_co | _NestedSequence[_T_co]: ... - @overload - def __getitem__(self, index: slice, /) -> _NestedSequence[_T_co]: ... - - def __getitem__(self, index, /): + def __getitem__(self, index: int, /) -> _T_co | _NestedSequence[_T_co]: """Implement ``self[x]``.""" raise NotImplementedError diff --git a/contrib/python/numpy/py3/numpy/_utils/__init__.py b/contrib/python/numpy/py3/numpy/_utils/__init__.py index 60703f145a..388dd9174f 100644 --- a/contrib/python/numpy/py3/numpy/_utils/__init__.py +++ b/contrib/python/numpy/py3/numpy/_utils/__init__.py @@ -8,6 +8,8 @@ If a utility requires the import of NumPy, it probably belongs in ``numpy.core``. """ +from ._convertions import asunicode, asbytes + def set_module(module): """Private decorator for overriding __module__ on a function or class. diff --git a/contrib/python/numpy/py3/numpy/_utils/_convertions.py b/contrib/python/numpy/py3/numpy/_utils/_convertions.py new file mode 100644 index 0000000000..ab15a8ba01 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/_utils/_convertions.py @@ -0,0 +1,18 @@ +""" +A set of methods retained from np.compat module that +are still used across codebase. +""" + +__all__ = ["asunicode", "asbytes"] + + +def asunicode(s): + if isinstance(s, bytes): + return s.decode('latin1') + return str(s) + + +def asbytes(s): + if isinstance(s, bytes): + return s + return str(s).encode('latin1') diff --git a/contrib/python/numpy/py3/numpy/_version.py b/contrib/python/numpy/py3/numpy/_version.py deleted file mode 100644 index 2751085078..0000000000 --- a/contrib/python/numpy/py3/numpy/_version.py +++ /dev/null @@ -1,21 +0,0 @@ - -# This file was generated by 'versioneer.py' (0.26) from -# revision-control system data, or from the parent directory name of an -# unpacked source archive. Distribution tarballs contain a pre-generated copy -# of this file. - -import json - -version_json = ''' -{ - "date": "2023-07-30T18:52:43-0600", - "dirty": false, - "error": null, - "full-revisionid": "ea677928332c37e8052b4d599bf6ee52cf363cf9", - "version": "1.25.2" -} -''' # END VERSION_JSON - - -def get_versions(): - return json.loads(version_json) diff --git a/contrib/python/numpy/py3/numpy/array_api/_typing.py b/contrib/python/numpy/py3/numpy/array_api/_typing.py index 3f9b7186ae..e63a375b5f 100644 --- a/contrib/python/numpy/py3/numpy/array_api/_typing.py +++ b/contrib/python/numpy/py3/numpy/array_api/_typing.py @@ -17,6 +17,8 @@ __all__ = [ "PyCapsule", ] +import sys + from typing import ( Any, Literal, @@ -63,8 +65,11 @@ Dtype = dtype[Union[ float64, ]] +if sys.version_info >= (3, 12): + from collections.abc import Buffer as SupportsBufferProtocol +else: + SupportsBufferProtocol = Any -SupportsBufferProtocol = Any PyCapsule = Any class SupportsDLPack(Protocol): diff --git a/contrib/python/numpy/py3/numpy/core/__init__.py b/contrib/python/numpy/py3/numpy/core/__init__.py index 08e7173636..2d59b89e6b 100644 --- a/contrib/python/numpy/py3/numpy/core/__init__.py +++ b/contrib/python/numpy/py3/numpy/core/__init__.py @@ -6,11 +6,12 @@ are available in the main ``numpy`` namespace - use that instead. """ -from numpy.version import version as __version__ - import os import warnings +from numpy.version import version as __version__ + + # disables OpenBLAS affinity setting of the main thread that limits # python threads or processes to one core env_added = [] diff --git a/contrib/python/numpy/py3/numpy/core/code_generators/cversions.txt b/contrib/python/numpy/py3/numpy/core/code_generators/cversions.txt index e52193d7a4..651d0fe625 100644 --- a/contrib/python/numpy/py3/numpy/core/code_generators/cversions.txt +++ b/contrib/python/numpy/py3/numpy/core/code_generators/cversions.txt @@ -70,4 +70,5 @@ 0x00000010 = 04a7bf1e65350926a0e528798da263c0 # Version 17 (NumPy 1.25) No actual change. +# Version 17 (NumPy 1.26) No change. 0x00000011 = ca1aebdad799358149567d9d93cbca09 diff --git a/contrib/python/numpy/py3/numpy/core/code_generators/generate_numpy_api.py b/contrib/python/numpy/py3/numpy/core/code_generators/generate_numpy_api.py index bfcb0d0e54..ae38c4efc2 100644 --- a/contrib/python/numpy/py3/numpy/core/code_generators/generate_numpy_api.py +++ b/contrib/python/numpy/py3/numpy/core/code_generators/generate_numpy_api.py @@ -55,7 +55,6 @@ _import_array(void) c_api = PyObject_GetAttrString(numpy, "_ARRAY_API"); Py_DECREF(numpy); if (c_api == NULL) { - PyErr_SetString(PyExc_AttributeError, "_ARRAY_API not found"); return -1; } diff --git a/contrib/python/numpy/py3/numpy/core/config.h.in b/contrib/python/numpy/py3/numpy/core/config.h.in index e3b5597535..cd63a59b2a 100644 --- a/contrib/python/numpy/py3/numpy/core/config.h.in +++ b/contrib/python/numpy/py3/numpy/core/config.h.in @@ -12,6 +12,7 @@ #mesondefine HAVE___DECLSPEC_THREAD_ /* Optional headers */ +#mesondefine HAVE_FEATURES_H #mesondefine HAVE_XLOCALE_H #mesondefine HAVE_DLFCN_H #mesondefine HAVE_EXECINFO_H diff --git a/contrib/python/numpy/py3/numpy/core/fromnumeric.pyi b/contrib/python/numpy/py3/numpy/core/fromnumeric.pyi index 43d1785578..5438b2700b 100644 --- a/contrib/python/numpy/py3/numpy/core/fromnumeric.pyi +++ b/contrib/python/numpy/py3/numpy/core/fromnumeric.pyi @@ -21,6 +21,7 @@ from numpy import ( _PartitionKind, _SortKind, _SortSide, + _CastingKind, ) from numpy._typing import ( DTypeLike, @@ -393,6 +394,7 @@ def clip( subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., + casting: _CastingKind = ..., ) -> _SCT: ... @overload def clip( @@ -407,6 +409,7 @@ def clip( subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., + casting: _CastingKind = ..., ) -> Any: ... @overload def clip( @@ -421,6 +424,7 @@ def clip( subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., + casting: _CastingKind = ..., ) -> NDArray[_SCT]: ... @overload def clip( @@ -435,6 +439,7 @@ def clip( subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., + casting: _CastingKind = ..., ) -> NDArray[Any]: ... @overload def clip( @@ -449,6 +454,7 @@ def clip( subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., + casting: _CastingKind = ..., ) -> Any: ... @overload def clip( @@ -463,6 +469,7 @@ def clip( subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., + casting: _CastingKind = ..., ) -> _ArrayType: ... @overload diff --git a/contrib/python/numpy/py3/numpy/core/include/numpy/__multiarray_api.h b/contrib/python/numpy/py3/numpy/core/include/numpy/__multiarray_api.h index 3123dc8ab3..2b3dfac3f9 100644 --- a/contrib/python/numpy/py3/numpy/core/include/numpy/__multiarray_api.h +++ b/contrib/python/numpy/py3/numpy/core/include/numpy/__multiarray_api.h @@ -1495,7 +1495,6 @@ _import_array(void) c_api = PyObject_GetAttrString(numpy, "_ARRAY_API"); Py_DECREF(numpy); if (c_api == NULL) { - PyErr_SetString(PyExc_AttributeError, "_ARRAY_API not found"); return -1; } diff --git a/contrib/python/numpy/py3/numpy/core/include/numpy/npy_common.h b/contrib/python/numpy/py3/numpy/core/include/numpy/npy_common.h index fb976aa6ae..9e98f8ef5e 100644 --- a/contrib/python/numpy/py3/numpy/core/include/numpy/npy_common.h +++ b/contrib/python/numpy/py3/numpy/core/include/numpy/npy_common.h @@ -168,6 +168,9 @@ #define npy_ftell ftell #endif #include <sys/types.h> + #ifndef _WIN32 + #include <unistd.h> + #endif #define npy_lseek lseek #define npy_off_t off_t diff --git a/contrib/python/numpy/py3/numpy/core/include/numpy/npy_os.h b/contrib/python/numpy/py3/numpy/core/include/numpy/npy_os.h index 6d8317d066..0ce5d78b42 100644 --- a/contrib/python/numpy/py3/numpy/core/include/numpy/npy_os.h +++ b/contrib/python/numpy/py3/numpy/core/include/numpy/npy_os.h @@ -19,12 +19,18 @@ #define NPY_OS_SOLARIS #elif defined(__CYGWIN__) #define NPY_OS_CYGWIN -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) - #define NPY_OS_WIN32 -#elif defined(_WIN64) || defined(__WIN64__) || defined(WIN64) - #define NPY_OS_WIN64 -#elif defined(__MINGW32__) || defined(__MINGW64__) +/* We are on Windows.*/ +#elif defined(_WIN32) + /* We are using MinGW (64-bit or 32-bit)*/ + #if defined(__MINGW32__) || defined(__MINGW64__) #define NPY_OS_MINGW + /* Otherwise, if _WIN64 is defined, we are targeting 64-bit Windows*/ + #elif defined(_WIN64) + #define NPY_OS_WIN64 + /* Otherwise assume we are targeting 32-bit Windows*/ + #else + #define NPY_OS_WIN32 + #endif #elif defined(__APPLE__) #define NPY_OS_DARWIN #elif defined(__HAIKU__) diff --git a/contrib/python/numpy/py3/numpy/core/meson.build b/contrib/python/numpy/py3/numpy/core/meson.build index ab773c56d7..0823524d6a 100644 --- a/contrib/python/numpy/py3/numpy/core/meson.build +++ b/contrib/python/numpy/py3/numpy/core/meson.build @@ -50,7 +50,10 @@ C_API_VERSION = '0x00000011' # Check whether we have a mismatch between the set C API VERSION and the # actual C API VERSION. Will raise a MismatchCAPIError if so. -r = run_command('code_generators/verify_c_api_version.py', '--api-version', C_API_VERSION) +r = run_command( + 'code_generators/verify_c_api_version.py', '--api-version', C_API_VERSION, + check: true +) if r.returncode() != 0 error('verify_c_api_version.py failed with output:\n' + r.stderr().strip()) @@ -81,6 +84,7 @@ cdata.set('NPY_API_VERSION', C_API_VERSION) use_svml = ( host_machine.system() == 'linux' and host_machine.cpu_family() == 'x86_64' and + ('AVX512_SKX' in CPU_DISPATCH_NAMES or 'AVX512_SKX' in CPU_BASELINE_NAMES) and not get_option('disable-svml') ) if use_svml @@ -145,20 +149,32 @@ endif # Mandatory functions: if not found, fail the build # Some of these can still be blocklisted if the C99 implementation # is buggy, see numpy/core/src/common/npy_config.h -mandatory_funcs = [ +mandatory_math_funcs = [ 'sin', 'cos', 'tan', 'sinh', 'cosh', 'tanh', 'fabs', 'floor', 'ceil', 'sqrt', 'log10', 'log', 'exp', 'asin', 'acos', 'atan', 'fmod', 'modf', 'frexp', 'ldexp', 'expm1', 'log1p', 'acosh', 'asinh', 'atanh', - 'rint', 'trunc', 'exp2', - 'copysign', 'nextafter', 'strtoll', 'strtoull', 'cbrt', + 'rint', 'trunc', 'exp2', 'copysign', 'nextafter', 'cbrt', 'log2', 'pow', 'hypot', 'atan2', - 'csin', 'csinh', 'ccos', 'ccosh', 'ctan', 'ctanh', - 'creal', 'cimag', 'conj' ] -foreach func: mandatory_funcs - if not cc.has_function(func) - error('Function `{func}` not found') +foreach func: mandatory_math_funcs + if not cc.has_function(func, prefix: '#include <math.h>', dependencies: m_dep) + error(f'Function `@func@` not found') + endif +endforeach + +mandatory_complex_math_funcs = [ + 'csin', 'csinh', 'ccos', 'ccosh', 'ctan', 'ctanh', 'creal', 'cimag', 'conj' +] +foreach func: mandatory_complex_math_funcs + if not cc.has_function(func, prefix: '#include <complex.h>', dependencies: m_dep) + error(f'Function `@func@` not found') + endif +endforeach + +foreach func: ['strtoll', 'strtoull'] + if not cc.has_function(func, prefix: '#include <stdlib.h>') + error(f'Function `@func@` not found') endif endforeach @@ -173,13 +189,13 @@ c99_complex_funcs = [ foreach func: c99_complex_funcs func_single = func + 'f' func_longdouble = func + 'l' - if cc.has_function(func) + if cc.has_function(func, prefix: '#include <complex.h>', dependencies: m_dep) cdata.set10('HAVE_' + func.to_upper(), true) endif - if cc.has_function(func_single) + if cc.has_function(func_single, prefix: '#include <complex.h>', dependencies: m_dep) cdata.set10('HAVE_' + func_single.to_upper(), true) endif - if cc.has_function(func_longdouble) + if cc.has_function(func_longdouble, prefix: '#include <complex.h>', dependencies: m_dep) cdata.set10('HAVE_' + func_longdouble.to_upper(), true) endif endforeach @@ -188,7 +204,7 @@ endforeach # libnpymath as a C99 compat layer, these may still be relevant. c99_macros = ['isfinite', 'isinf', 'isnan', 'signbit'] foreach macro: c99_macros - if cc.has_function(macro) + if cc.has_function(macro, prefix: '#include <math.h>', dependencies: m_dep) cdata.set10('NPY_HAVE_DECL_' + macro.to_upper(), true) if not cc.has_header_symbol('Python.h', macro, dependencies: py_dep) # Add in config.h as well, except if it will clash with Python's config.h content @@ -241,37 +257,6 @@ foreach filefunc_maybe: optional_file_funcs endif endforeach -# Optional locale function -have_strtold_l = cc.has_function('strtold_l', include_directories: inc_curdir, - prefix:''' - #include <stdlib.h> - #include <xlocale.h> - #include "feature_detection_locale.h" -''') -if not have_strtold_l - # Retry with locale.h, seems to vary across Linux distros - have_strtold_l = cc.has_function('strtold_l', include_directories: inc_curdir, - prefix:''' - #include <stdlib.h> - #include <locale.h> - #include "feature_detection_locale.h" - ''') -endif -if have_strtold_l - cdata.set10('HAVE_STRTOLD_L', true) -else - # FIXME: this is wrong! the HAVE_ define should not exist, or it'll be - # interpreted as the function being available (true/false does nothing, see - # note on HAVE_ defines higher up). This is necessary though in order to make - # the Linux CI job pass. So either the check is wrong somehow, or this - # function is not available in CI. For the latter there is a fallback path, - # but that is broken because we don't have the exact long double - # representation checks. - if cc.get_argument_syntax() != 'msvc' - cdata.set10('HAVE_STRTOLD_L', false) - endif -endif - # Other optional functions optional_misc_funcs = [ 'backtrace', @@ -288,11 +273,8 @@ endforeach # SSE headers only enabled automatically on amd64/x32 builds optional_headers = [ - 'xmmintrin.h', # SSE - 'emmintrin.h', # SSE2 - 'immintrin.h', # AVX 'features.h', # for glibc version linux - 'xlocale.h', # see GH#8367 + 'xlocale.h', # removed in glibc 2.26, but may still be useful - see gh-8367 'dlfcn.h', # dladdr 'execinfo.h', # backtrace 'libunwind.h', # backtrace for LLVM/Clang using libunwind @@ -304,6 +286,19 @@ foreach header: optional_headers endif endforeach +# Optional locale function - GNU-specific +_strtold_prefix = ''' +#define _GNU_SOURCE +#include <locale.h> +#include <stdlib.h> +''' +if cdata.get('HAVE_XLOCALE_H', 0) == 1 + _strtold_prefix += '#include <xlocale.h>' +endif +if cc.has_function('strtold_l', include_directories: inc_curdir, prefix: _strtold_prefix) + cdata.set10('HAVE_STRTOLD_L', true) +endif + # Optional compiler attributes # TODO: this doesn't work with cc.has_function_attribute, see # https://github.com/mesonbuild/meson/issues/10732 @@ -319,6 +314,15 @@ optional_function_attributes = [ # endif #endforeach +# Max possible optimization flags. We pass this flags to all our dispatch-able +# (multi_targets) sources. +compiler_id = cc.get_id() +max_opt = { + 'msvc': ['/O2'], + 'intel-cl': ['/O3'], +}.get(compiler_id, ['-O3']) +max_opt = cc.has_multi_arguments(max_opt) ? max_opt : [] + # Optional GCC compiler builtins and their call arguments. # If given, a required header and definition name (HAVE_ prepended) # Call arguments are required as the compiler will do strict signature checking @@ -367,7 +371,9 @@ endforeach # https://github.com/numpy/numpy/blob/eead09a3d02c09374942cdc787c0b5e4fe9e7472/numpy/core/setup_common.py#L264-L434 # This port is in service of solving gh-23972 # as well as https://github.com/mesonbuild/meson/issues/11068 -longdouble_format = meson.get_compiler('c').run( +longdouble_format = meson.get_external_property('longdouble_format', 'UNKNOWN') +if longdouble_format == 'UNKNOWN' + longdouble_format = meson.get_compiler('c').run( ''' #include <stdio.h> #include <string.h> @@ -446,7 +452,8 @@ int main(void) { } } } -''').stdout() + ''').stdout() +endif if longdouble_format == 'UNKNOWN' or longdouble_format == 'UNDEFINED' error('Unknown long double format of size: ' + cc.sizeof('long double').to_string()) endif @@ -510,12 +517,6 @@ if cc.get_id() == 'msvc' staticlib_cflags += '-d2VolatileMetadata-' endif endif -# TODO: change to "feature" option in meson_options.txt? See -# https://mesonbuild.com/Build-options.html#build-options -if get_option('disable-simd-optimizations') - staticlib_cflags += '-DNPY_DISABLE_OPTIMIZATION' - staticlib_cppflags += '-DNPY_DISABLE_OPTIMIZATION' -endif npy_math_internal_h = custom_target( output: 'npy_math_internal.h', @@ -623,19 +624,10 @@ src_ufunc_api = custom_target('__ufunc_api', # Set common build flags for C and C++ code # ----------------------------------------- - -# TODO: change to "feature" option in meson_options.txt? See -# https://mesonbuild.com/Build-options.html#build-options -disable_simd_optimizations = [] -if get_option('disable-simd-optimizations') - disable_simd_optimizations = '-DNPY_DISABLE_OPTIMIZATION' -endif - # Common build flags c_args_common = [ '-DNPY_INTERNAL_BUILD', '-DHAVE_NPY_CONFIG_H', - disable_simd_optimizations, cflags_large_file_support, ] @@ -664,11 +656,9 @@ np_core_dep = declare_dependency( '.', 'include', 'src/common', - ], - compile_args: disable_simd_optimizations + ] ) - # Build multiarray_tests module # ----------------------------- py.extension_module('_multiarray_tests', @@ -688,15 +678,30 @@ py.extension_module('_multiarray_tests', subdir: 'numpy/core', ) +_umath_tests_mtargets = mod_features.multi_targets( + '_umath_tests.dispatch.h', + 'src/umath/_umath_tests.dispatch.c', + dispatch: [ + AVX2, SSE41, SSE2, + ASIMDHP, ASIMD, NEON, + VSX3, VSX2, VSX, + VXE, VX, + ], + baseline: CPU_BASELINE, + prefix: 'NPY_', + dependencies: [py_dep, np_core_dep] +) + test_modules_src = [ ['_umath_tests', [ src_file.process('src/umath/_umath_tests.c.src'), - 'src/umath/_umath_tests.dispatch.c', 'src/common/npy_cpu_features.c', - ]], - ['_rational_tests', 'src/umath/_rational_tests.c'], - ['_struct_ufunc_tests', 'src/umath/_struct_ufunc_tests.c'], - ['_operand_flag_tests', 'src/umath/_operand_flag_tests.c'], + ], + _umath_tests_mtargets.static_lib('_umath_tests_mtargets') + ], + ['_rational_tests', 'src/umath/_rational_tests.c', []], + ['_struct_ufunc_tests', 'src/umath/_struct_ufunc_tests.c', []], + ['_operand_flag_tests', 'src/umath/_operand_flag_tests.c', []], ] foreach gen: test_modules_src py.extension_module(gen[0], @@ -706,7 +711,257 @@ foreach gen: test_modules_src dependencies: np_core_dep, install: true, subdir: 'numpy/core', + link_with: gen[2], + ) +endforeach + +# Build multiarray dispatch-able sources +# -------------------------------------- +multiarray_gen_headers = [ + src_file.process('src/multiarray/arraytypes.h.src'), + src_file.process('src/common/npy_sort.h.src'), +] +foreach gen_mtargets : [ + [ + 'argfunc.dispatch.h', + src_file.process('src/multiarray/argfunc.dispatch.c.src'), + [ + AVX512_SKX, AVX2, XOP, SSE42, SSE2, + VSX2, + ASIMD, NEON, + VXE, VX + ] + ], +] + mtargets = mod_features.multi_targets( + gen_mtargets[0], multiarray_gen_headers + gen_mtargets[1], + dispatch: gen_mtargets[2], + baseline: CPU_BASELINE, + prefix: 'NPY_', + dependencies: [py_dep, np_core_dep], + c_args: c_args_common + max_opt, + cpp_args: cpp_args_common + max_opt, + include_directories: [ + 'include', + 'src/common', + 'src/multiarray', + 'src/npymath', + 'src/umath' + ] + ) + if not is_variable('multiarray_umath_mtargets') + multiarray_umath_mtargets = mtargets + else + multiarray_umath_mtargets.extend(mtargets) + endif +endforeach + +# Build npysort dispatch-able sources +# ----------------------------------- +foreach gen_mtargets : [ + [ + 'simd_qsort.dispatch.h', + 'src/npysort/simd_qsort.dispatch.cpp', + [AVX512_SKX] + ], + [ + 'simd_qsort_16bit.dispatch.h', + 'src/npysort/simd_qsort_16bit.dispatch.cpp', + [AVX512_SPR, AVX512_ICL] + ], +] + mtargets = mod_features.multi_targets( + gen_mtargets[0], multiarray_gen_headers + gen_mtargets[1], + dispatch: gen_mtargets[2], + # baseline: CPU_BASELINE, it doesn't provide baseline fallback + prefix: 'NPY_', + dependencies: [py_dep, np_core_dep], + c_args: c_args_common + max_opt, + cpp_args: cpp_args_common + max_opt, + include_directories: [ + 'include', + 'src/common', + 'src/multiarray', + 'src/npymath', + 'src/umath' + ] ) + if not is_variable('multiarray_umath_mtargets') + multiarray_umath_mtargets = mtargets + else + multiarray_umath_mtargets.extend(mtargets) + endif +endforeach + +# Build umath dispatch-able sources +# --------------------------------- +mod_features = import('features') +umath_gen_headers = [ + src_file.process('src/umath/loops.h.src'), + src_file.process('src/umath/loops_utils.h.src'), +] + +foreach gen_mtargets : [ + [ + 'loops_arithm_fp.dispatch.h', + src_file.process('src/umath/loops_arithm_fp.dispatch.c.src'), + [ + [AVX2, FMA3], SSE2, + ASIMD, NEON, + VSX3, VSX2, + VXE, VX, + ] + ], + [ + 'loops_arithmetic.dispatch.h', + src_file.process('src/umath/loops_arithmetic.dispatch.c.src'), + [ + AVX512_SKX, AVX512F, AVX2, SSE41, SSE2, + NEON, + VSX4, VSX2, + VX, + ] + ], + [ + 'loops_comparison.dispatch.h', + src_file.process('src/umath/loops_comparison.dispatch.c.src'), + [ + AVX512_SKX, AVX512F, AVX2, SSE42, SSE2, + VSX3, VSX2, + NEON, + VXE, VX, + ] + ], + [ + 'loops_exponent_log.dispatch.h', + src_file.process('src/umath/loops_exponent_log.dispatch.c.src'), + [ + AVX512_SKX, AVX512F, [AVX2, FMA3] + ] + ], + [ + 'loops_hyperbolic.dispatch.h', + src_file.process('src/umath/loops_hyperbolic.dispatch.c.src'), + [ + AVX512_SKX, [AVX2, FMA3], + VSX4, VSX2, + NEON_VFPV4, + VXE, VX + ] + ], + [ + 'loops_logical.dispatch.h', + src_file.process('src/umath/loops_logical.dispatch.c.src'), + [ + ASIMD, NEON, + AVX512_SKX, AVX2, SSE2, + VSX2, + VX, + ] + ], + [ + 'loops_minmax.dispatch.h', + src_file.process('src/umath/loops_minmax.dispatch.c.src'), + [ + ASIMD, NEON, + AVX512_SKX, AVX2, SSE2, + VSX2, + VXE, VX, + ] + ], + [ + 'loops_modulo.dispatch.h', + src_file.process('src/umath/loops_modulo.dispatch.c.src'), + [ + VSX4 + ] + ], + [ + 'loops_trigonometric.dispatch.h', + src_file.process('src/umath/loops_trigonometric.dispatch.c.src'), + [ + AVX512F, [AVX2, FMA3], + VSX4, VSX3, VSX2, + NEON_VFPV4, + VXE2, VXE + ] + ], + [ + 'loops_umath_fp.dispatch.h', + src_file.process('src/umath/loops_umath_fp.dispatch.c.src'), + [AVX512_SKX] + ], + [ + 'loops_unary.dispatch.h', + src_file.process('src/umath/loops_unary.dispatch.c.src'), + [ + ASIMD, NEON, + AVX512_SKX, AVX2, SSE2, + VSX2, + VXE, VX + ] + ], + [ + 'loops_unary_fp.dispatch.h', + src_file.process('src/umath/loops_unary_fp.dispatch.c.src'), + [ + SSE41, SSE2, + VSX2, + ASIMD, NEON, + VXE, VX + ] + ], + [ + 'loops_unary_fp_le.dispatch.h', + src_file.process('src/umath/loops_unary_fp_le.dispatch.c.src'), + [ + SSE41, SSE2, + VSX2, + ASIMD, NEON, + ] + ], + [ + 'loops_unary_complex.dispatch.h', + src_file.process('src/umath/loops_unary_complex.dispatch.c.src'), + [ + AVX512F, [AVX2, FMA3], SSE2, + ASIMD, NEON, + VSX3, VSX2, + VXE, VX, + ] + ], + [ + 'loops_autovec.dispatch.h', + src_file.process('src/umath/loops_autovec.dispatch.c.src'), + [ + AVX2, SSE2, + NEON, + VSX2, + VX, + ] + ], +] + mtargets = mod_features.multi_targets( + gen_mtargets[0], umath_gen_headers + gen_mtargets[1], + dispatch: gen_mtargets[2], + baseline: CPU_BASELINE, + prefix: 'NPY_', + dependencies: [py_dep, np_core_dep], + c_args: c_args_common + max_opt, + cpp_args: cpp_args_common + max_opt, + include_directories: [ + 'include', + 'src/common', + 'src/multiarray', + 'src/npymath', + 'src/umath' + ] + ) + if not is_variable('multiarray_umath_mtargets') + multiarray_umath_mtargets = mtargets + else + multiarray_umath_mtargets.extend(mtargets) + endif endforeach # Build _multiarray_umath module @@ -730,12 +985,10 @@ if have_blas ] endif -src_multiarray = [ +src_multiarray = multiarray_gen_headers + [ 'src/multiarray/abstractdtypes.c', 'src/multiarray/alloc.c', - src_file.process('src/multiarray/argfunc.dispatch.c.src'), 'src/multiarray/arrayobject.c', - src_file.process('src/multiarray/arraytypes.h.src'), 'src/multiarray/array_coercion.c', 'src/multiarray/array_method.c', 'src/multiarray/array_assign_scalar.c', @@ -789,9 +1042,6 @@ src_multiarray = [ 'src/multiarray/typeinfo.c', 'src/multiarray/usertypes.c', 'src/multiarray/vdot.c', - src_file.process('src/common/npy_sort.h.src'), - 'src/npysort/simd_qsort.dispatch.cpp', - 'src/npysort/simd_qsort_16bit.dispatch.cpp', 'src/npysort/quicksort.cpp', 'src/npysort/mergesort.cpp', 'src/npysort/timsort.cpp', @@ -814,26 +1064,9 @@ src_multiarray = [ 'src/npymath/arm64_exports.c', ] -src_umath = [ +src_umath = umath_gen_headers + [ src_file.process('src/umath/funcs.inc.src'), - src_file.process('src/umath/loops.h.src'), - src_file.process('src/umath/loops_utils.h.src'), src_file.process('src/umath/loops.c.src'), - src_file.process('src/umath/loops_arithm_fp.dispatch.c.src'), - src_file.process('src/umath/loops_arithmetic.dispatch.c.src'), - src_file.process('src/umath/loops_comparison.dispatch.c.src'), - src_file.process('src/umath/loops_exponent_log.dispatch.c.src'), - src_file.process('src/umath/loops_hyperbolic.dispatch.c.src'), - src_file.process('src/umath/loops_logical.dispatch.c.src'), - src_file.process('src/umath/loops_minmax.dispatch.c.src'), - src_file.process('src/umath/loops_modulo.dispatch.c.src'), - src_file.process('src/umath/loops_trigonometric.dispatch.c.src'), - src_file.process('src/umath/loops_umath_fp.dispatch.c.src'), - src_file.process('src/umath/loops_unary.dispatch.c.src'), - src_file.process('src/umath/loops_unary_fp.dispatch.c.src'), - src_file.process('src/umath/loops_unary_fp_le.dispatch.c.src'), - src_file.process('src/umath/loops_unary_complex.dispatch.c.src'), - src_file.process('src/umath/loops_autovec.dispatch.c.src'), src_file.process('src/umath/matmul.c.src'), src_file.process('src/umath/matmul.h.src'), 'src/umath/ufunc_type_resolution.c', @@ -860,52 +1093,24 @@ src_umath = [ # may be able to avoid the accuracy regressions in SVML. svml_objects = [] if use_svml - svml_objects += [ - 'src/umath/svml/linux/avx512/svml_z0_acos_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_acos_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_acosh_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_acosh_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_asin_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_asin_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_asinh_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_asinh_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_atan2_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_atan2_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_atan_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_atan_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_atanh_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_atanh_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_cbrt_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_cbrt_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_cos_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_cos_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_cosh_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_cosh_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_exp2_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_exp2_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_exp_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_exp_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_expm1_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_expm1_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log10_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log10_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log1p_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log1p_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log2_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log2_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_log_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_pow_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_pow_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_sin_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_sin_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_sinh_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_sinh_s_la.s', - 'src/umath/svml/linux/avx512/svml_z0_tan_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_tan_s_la.s', - # 'src/umath/svml/linux/avx512/svml_z0_tanh_d_la.s', - 'src/umath/svml/linux/avx512/svml_z0_tanh_s_la.s', + foreach svml_func : [ + 'acos', 'acosh', 'asin', + 'asinh', 'atan2', + 'atan', 'atanh', + 'cbrt', 'cos', + 'cosh', 'exp2', + 'exp', 'expm1', + 'log10', 'log1p', + 'log2', 'log', + 'pow', 'sin', 'sinh', 'tan', + 'tanh' ] + foreach svml_sfx : ['d_la', 's_la', 'd_ha', 's_la'] + svml_objects += [ + 'src/umath/svml/linux/avx512/svml_z0_'+svml_func+'_'+svml_sfx+'.s' + ] + endforeach + endforeach endif py.extension_module('_multiarray_umath', @@ -931,26 +1136,60 @@ py.extension_module('_multiarray_umath', 'src/umath', ], dependencies: blas_dep, - link_with: npymath_lib, + link_with: [npymath_lib, multiarray_umath_mtargets.static_lib('_multiarray_umath_mtargets')], install: true, subdir: 'numpy/core', ) # Build SIMD module # ----------------- +_simd_dispatch = [] +_simd_baseline = [] +foreach target : get_option('test-simd') + target = target.strip().to_upper().split(',') + mfeatures = [] + foreach fet_name : target + if fet_name == 'BASELINE' + _simd_baseline = CPU_BASELINE + break + endif + if fet_name not in CPU_FEATURES + error('Expected a valid feature name, got('+fet_name+')') + endif + mfeatures += CPU_FEATURES[fet_name] + endforeach + _simd_dispatch += [mfeatures] +endforeach -py.extension_module('_simd', +_simd_mtargets = mod_features.multi_targets( + '_simd.dispatch.h', [ - 'src/common/npy_cpu_features.c', - 'src/_simd/_simd.c', src_file.process('src/_simd/_simd_inc.h.src'), src_file.process('src/_simd/_simd_data.inc.src'), src_file.process('src/_simd/_simd.dispatch.c.src'), ], + # Skip validating the order of `_simd_dispatch` because we execute all these + # features, not just the highest interest one. The sorting doesn't matter + # here, given the nature of this testing unit. + keep_sort: true, + dispatch: _simd_dispatch, + baseline: _simd_baseline, + prefix: 'NPY_', + dependencies: [py_dep, np_core_dep], + include_directories: ['src/_simd', 'src/npymath'], + c_args: c_args_common, + cpp_args: cpp_args_common, +) + +py.extension_module('_simd', + [ + 'src/common/npy_cpu_features.c', + 'src/_simd/_simd.c', + ], c_args: c_args_common, include_directories: ['src/_simd', 'src/npymath'], dependencies: np_core_dep, - link_with: npymath_lib, + link_with: [npymath_lib, _simd_mtargets.static_lib('_simd_mtargets')], install: true, subdir: 'numpy/core', ) diff --git a/contrib/python/numpy/py3/numpy/core/numeric.pyi b/contrib/python/numpy/py3/numpy/core/numeric.pyi index 98d3789a57..fc10bb88f5 100644 --- a/contrib/python/numpy/py3/numpy/core/numeric.pyi +++ b/contrib/python/numpy/py3/numpy/core/numeric.pyi @@ -8,7 +8,10 @@ from typing import ( SupportsIndex, NoReturn, ) -from typing_extensions import TypeGuard +if sys.version_info >= (3, 10): + from typing import TypeGuard +else: + from typing_extensions import TypeGuard from numpy import ( ComplexWarning as ComplexWarning, @@ -597,7 +600,7 @@ def isscalar(element: object) -> TypeGuard[ generic | bool | int | float | complex | str | bytes | memoryview ]: ... -def binary_repr(num: int, width: None | int = ...) -> str: ... +def binary_repr(num: SupportsIndex, width: None | int = ...) -> str: ... def base_repr( number: SupportsAbs[float], diff --git a/contrib/python/numpy/py3/numpy/core/setup.py b/contrib/python/numpy/py3/numpy/core/setup.py index c6cdd40259..a05b5da796 100644 --- a/contrib/python/numpy/py3/numpy/core/setup.py +++ b/contrib/python/numpy/py3/numpy/core/setup.py @@ -417,7 +417,6 @@ def configuration(parent_package='',top_path=None): exec_mod_from_location) from numpy.distutils.system_info import (get_info, blas_opt_info, lapack_opt_info) - from numpy.version import release as is_released config = Configuration('core', parent_package, top_path) local_dir = config.local_path diff --git a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.c b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.c index 52b66e7652..5a113fe578 100644 --- a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.c +++ b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.c @@ -85,9 +85,13 @@ PyMODINIT_FUNC PyInit__simd(void) goto err; \ } \ } - - NPY__CPU_DISPATCH_CALL(NPY_CPU_HAVE, ATTACH_MODULE, MAKE_MSVC_HAPPY) - NPY__CPU_DISPATCH_BASELINE_CALL(ATTACH_BASELINE_MODULE, MAKE_MSVC_HAPPY) + #ifdef NPY__CPU_MESON_BUILD + NPY_MTARGETS_CONF_DISPATCH(NPY_CPU_HAVE, ATTACH_MODULE, MAKE_MSVC_HAPPY) + NPY_MTARGETS_CONF_BASELINE(ATTACH_BASELINE_MODULE, MAKE_MSVC_HAPPY) + #else + NPY__CPU_DISPATCH_CALL(NPY_CPU_HAVE, ATTACH_MODULE, MAKE_MSVC_HAPPY) + NPY__CPU_DISPATCH_BASELINE_CALL(ATTACH_BASELINE_MODULE, MAKE_MSVC_HAPPY) + #endif return m; err: Py_DECREF(m); diff --git a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c index b930ac657a..2c303e82b9 100644 --- a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c +++ b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c @@ -21996,7 +21996,9 @@ NPY_CPU_DISPATCH_CURFX(simd_create_module)(void) { static struct PyModuleDef defs = { .m_base = PyModuleDef_HEAD_INIT, - #ifdef NPY__CPU_TARGET_CURRENT + #if defined(NPY_MTARGETS_CURRENT) // meson build + .m_name = "numpy.core._simd." NPY_TOSTRING(NPY_MTARGETS_CURRENT), + #elif defined(NPY__CPU_TARGET_CURRENT) .m_name = "numpy.core._simd." NPY_TOSTRING(NPY__CPU_TARGET_CURRENT), #else .m_name = "numpy.core._simd.baseline", @@ -22034,52 +22036,52 @@ NPY_CPU_DISPATCH_CURFX(simd_create_module)(void) if (PySIMDVectorType_Init(m)) { goto err; } - #line 963 + #line 965 if (PyModule_AddIntConstant(m, "nlanes_u8", npyv_nlanes_u8)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_s8", npyv_nlanes_s8)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_u16", npyv_nlanes_u16)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_s16", npyv_nlanes_s16)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_u32", npyv_nlanes_u32)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_s32", npyv_nlanes_s32)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_u64", npyv_nlanes_u64)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_s64", npyv_nlanes_s64)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_f32", npyv_nlanes_f32)) { goto err; } -#line 963 +#line 965 if (PyModule_AddIntConstant(m, "nlanes_f64", npyv_nlanes_f64)) { goto err; } diff --git a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c.src b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c.src index f532c9e022..51f5ddd54b 100644 --- a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c.src +++ b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd.dispatch.c.src @@ -919,7 +919,9 @@ NPY_CPU_DISPATCH_CURFX(simd_create_module)(void) { static struct PyModuleDef defs = { .m_base = PyModuleDef_HEAD_INIT, - #ifdef NPY__CPU_TARGET_CURRENT + #if defined(NPY_MTARGETS_CURRENT) // meson build + .m_name = "numpy.core._simd." NPY_TOSTRING(NPY_MTARGETS_CURRENT), + #elif defined(NPY__CPU_TARGET_CURRENT) .m_name = "numpy.core._simd." NPY_TOSTRING(NPY__CPU_TARGET_CURRENT), #else .m_name = "numpy.core._simd.baseline", diff --git a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h index c1a2e9aa72..fb05e55a5c 100644 --- a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h +++ b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h @@ -371,19 +371,19 @@ typedef struct // type name compatible with python style const char *pyname; // returns '1' if the type represent a unsigned integer - int is_unsigned:1; + unsigned int is_unsigned:1; // returns '1' if the type represent a signed integer - int is_signed:1; + unsigned int is_signed:1; // returns '1' if the type represent a single or double precision - int is_float:1; + unsigned int is_float:1; // returns '1' if the type represent a boolean - int is_bool:1; + unsigned int is_bool:1; // returns '1' if the type represent a sequence - int is_sequence:1; + unsigned int is_sequence:1; // returns '1' if the type represent a scalar - int is_scalar:1; + unsigned int is_scalar:1; // returns '1' if the type represent a vector - int is_vector:1; + unsigned int is_vector:1; // returns the len of multi-vector if the type represent x2 or x3 vector // otherwise returns 0, e.g. returns 2 if data type is simd_data_vu8x2 int is_vectorx; diff --git a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h.src b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h.src index 887545414b..a023848831 100644 --- a/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h.src +++ b/contrib/python/numpy/py3/numpy/core/src/_simd/_simd_inc.h.src @@ -105,19 +105,19 @@ typedef struct // type name compatible with python style const char *pyname; // returns '1' if the type represent a unsigned integer - int is_unsigned:1; + unsigned int is_unsigned:1; // returns '1' if the type represent a signed integer - int is_signed:1; + unsigned int is_signed:1; // returns '1' if the type represent a single or double precision - int is_float:1; + unsigned int is_float:1; // returns '1' if the type represent a boolean - int is_bool:1; + unsigned int is_bool:1; // returns '1' if the type represent a sequence - int is_sequence:1; + unsigned int is_sequence:1; // returns '1' if the type represent a scalar - int is_scalar:1; + unsigned int is_scalar:1; // returns '1' if the type represent a vector - int is_vector:1; + unsigned int is_vector:1; // returns the len of multi-vector if the type represent x2 or x3 vector // otherwise returns 0, e.g. returns 2 if data type is simd_data_vu8x2 int is_vectorx; diff --git a/contrib/python/numpy/py3/numpy/core/src/common/half.hpp b/contrib/python/numpy/py3/numpy/core/src/common/half.hpp index 4d16e3bcc1..ff9a547766 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/half.hpp +++ b/contrib/python/numpy/py3/numpy/core/src/common/half.hpp @@ -36,7 +36,7 @@ class Half final { #endif ) || ( std::is_same_v<T, double> && - #if defined(NPY_HAVE_AVX512FP16) || defined(NPY_HAVE_VSX3) + #if defined(NPY_HAVE_AVX512FP16) || (defined(NPY_HAVE_VSX3) && defined(NPY_HAVE_VSX3_HALF_DOUBLE)) true #else false @@ -47,7 +47,7 @@ class Half final { /// Default constructor. initialize nothing. Half() = default; - /// Constract from float + /// Construct from float /// If there are no hardware optimization available, rounding will always /// be set to ties to even. explicit Half(float f) @@ -73,11 +73,8 @@ class Half final { #if defined(NPY_HAVE_AVX512FP16) __m128d md = _mm_load_sd(&f); bits_ = static_cast<uint16_t>(_mm_cvtsi128_si32(_mm_castph_si128(_mm_cvtpd_ph(md)))); - #elif defined(NPY_HAVE_VSX3) && defined(NPY_HAVE_VSX_ASM) - __vector double vf64 = vec_splats(f); - __vector unsigned short vf16; - __asm__ __volatile__ ("xvcvdphp %x0,%x1" : "=wa" (vf16) : "wa" (vf64)); - bits_ = vec_extract(vf16, 0); + #elif defined(NPY_HAVE_VSX3) && defined(NPY_HAVE_VSX3_HALF_DOUBLE) + __asm__ __volatile__ ("xscvdphp %x0,%x1" : "=wa" (bits_) : "wa" (f)); #else bits_ = half_private::FromDoubleBits(BitCast<uint64_t>(f)); #endif @@ -96,7 +93,7 @@ class Half final { __vector float vf32; __asm__ __volatile__("xvcvhpsp %x0,%x1" : "=wa"(vf32) - : "wa"(vec_splats(bits_.u))); + : "wa"(vec_splats(bits_))); return vec_extract(vf32, 0); #else return BitCast<float>(half_private::ToFloatBits(bits_)); @@ -110,18 +107,18 @@ class Half final { double ret; _mm_store_sd(&ret, _mm_cvtph_pd(_mm_castsi128_ph(_mm_cvtsi32_si128(bits_)))); return ret; - #elif defined(NPY_HAVE_VSX3) && defined(NPY_HAVE_VSX_ASM) - __vector float vf64; - __asm__ __volatile__("xvcvhpdp %x0,%x1" - : "=wa"(vf32) - : "wa"(vec_splats(bits_))); - return vec_extract(vf64, 0); + #elif defined(NPY_HAVE_VSX3) && defined(NPY_HAVE_VSX3_HALF_DOUBLE) + double f64; + __asm__ __volatile__("xscvhpdp %x0,%x1" + : "=wa"(f64) + : "wa"(bits_)); + return f64; #else return BitCast<double>(half_private::ToDoubleBits(bits_)); #endif } - /// Returns a new Half constracted from the IEEE 754 binary16. + /// Returns a new Half constructed from the IEEE 754 binary16. static constexpr Half FromBits(uint16_t bits) { Half h{}; @@ -134,7 +131,7 @@ class Half final { return bits_; } - /// @name Comparison operators (orderd) + /// @name Comparison operators (ordered) /// @{ constexpr bool operator==(Half r) const { @@ -158,7 +155,7 @@ class Half final { } /// @} - /// @name Comparison operators (unorderd) + /// @name Comparison operators (unordered) /// @{ constexpr bool operator!=(Half r) const { diff --git a/contrib/python/numpy/py3/numpy/core/src/common/npy_cblas.h b/contrib/python/numpy/py3/numpy/core/src/common/npy_cblas.h index 751854b6eb..596a7c68ce 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/npy_cblas.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/npy_cblas.h @@ -25,6 +25,21 @@ enum CBLAS_SIDE {CblasLeft=141, CblasRight=142}; #define CBLAS_INDEX size_t /* this may vary between platforms */ +#ifdef ACCELERATE_NEW_LAPACK + #if __MAC_OS_X_VERSION_MAX_ALLOWED < 130300 + #ifdef HAVE_BLAS_ILP64 + #error "Accelerate ILP64 support is only available with macOS 13.3 SDK or later" + #endif + #else + #define NO_APPEND_FORTRAN + #ifdef HAVE_BLAS_ILP64 + #define BLAS_SYMBOL_SUFFIX $NEWLAPACK$ILP64 + #else + #define BLAS_SYMBOL_SUFFIX $NEWLAPACK + #endif + #endif +#endif + #ifdef NO_APPEND_FORTRAN #define BLAS_FORTRAN_SUFFIX #else @@ -42,8 +57,21 @@ enum CBLAS_SIDE {CblasLeft=141, CblasRight=142}; #define BLAS_FUNC_CONCAT(name,prefix,suffix,suffix2) prefix ## name ## suffix ## suffix2 #define BLAS_FUNC_EXPAND(name,prefix,suffix,suffix2) BLAS_FUNC_CONCAT(name,prefix,suffix,suffix2) -#define CBLAS_FUNC(name) BLAS_FUNC_EXPAND(name,BLAS_SYMBOL_PREFIX,,BLAS_SYMBOL_SUFFIX) +/* + * Use either the OpenBLAS scheme with the `64_` suffix behind the Fortran + * compiler symbol mangling, or the MKL scheme (and upcoming + * reference-lapack#666) which does it the other way around and uses `_64`. + */ +#ifdef OPENBLAS_ILP64_NAMING_SCHEME #define BLAS_FUNC(name) BLAS_FUNC_EXPAND(name,BLAS_SYMBOL_PREFIX,BLAS_FORTRAN_SUFFIX,BLAS_SYMBOL_SUFFIX) +#else +#define BLAS_FUNC(name) BLAS_FUNC_EXPAND(name,BLAS_SYMBOL_PREFIX,BLAS_SYMBOL_SUFFIX,BLAS_FORTRAN_SUFFIX) +#endif +/* + * Note that CBLAS doesn't include Fortran compiler symbol mangling, so ends up + * being the same in both schemes + */ +#define CBLAS_FUNC(name) BLAS_FUNC_EXPAND(name,BLAS_SYMBOL_PREFIX,,BLAS_SYMBOL_SUFFIX) #ifdef HAVE_BLAS_ILP64 #define CBLAS_INT npy_int64 diff --git a/contrib/python/numpy/py3/numpy/core/src/common/npy_config.h b/contrib/python/numpy/py3/numpy/core/src/common/npy_config.h index 715b17777a..e590366888 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/npy_config.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/npy_config.h @@ -160,8 +160,29 @@ #undef HAVE_CACOSHL #endif /* __GLIBC_PREREQ(2, 18) */ -#endif /* defined(__GLIBC_PREREQ) */ +#else /* defined(__GLIBC) */ +/* musl linux?, see issue #25092 */ +#undef HAVE_CASIN +#undef HAVE_CASINF +#undef HAVE_CASINL +#undef HAVE_CASINH +#undef HAVE_CASINHF +#undef HAVE_CASINHL +#undef HAVE_CATAN +#undef HAVE_CATANF +#undef HAVE_CATANL +#undef HAVE_CATANH +#undef HAVE_CATANHF +#undef HAVE_CATANHL +#undef HAVE_CACOS +#undef HAVE_CACOSF +#undef HAVE_CACOSL +#undef HAVE_CACOSH +#undef HAVE_CACOSHF +#undef HAVE_CACOSHL + +#endif /* defined(__GLIBC) */ #endif /* defined(HAVE_FEATURES_H) */ #endif /* NUMPY_CORE_SRC_COMMON_NPY_CONFIG_H_ */ diff --git a/contrib/python/numpy/py3/numpy/core/src/common/npy_cpu_dispatch.h b/contrib/python/numpy/py3/numpy/core/src/common/npy_cpu_dispatch.h index 4d5addec80..699f8536f6 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/npy_cpu_dispatch.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/npy_cpu_dispatch.h @@ -43,6 +43,7 @@ #endif #endif #endif // !NPY_DISABLE_OPTIMIZATION +#ifndef NPY__CPU_MESON_BUILD /** * Macro NPY_CPU_DISPATCH_CURFX(NAME) * @@ -261,5 +262,5 @@ ((TESTED_FEATURES) ? (NPY_CAT(NPY_CAT(LEFT, _), TARGET_NAME) __VA_ARGS__) : (void) 0), #define NPY_CPU_DISPATCH_CALL_ALL_BASE_CB_(LEFT, ...) \ ( LEFT __VA_ARGS__ ) - +#endif // NPY__CPU_MESON_BUILD #endif // NUMPY_CORE_SRC_COMMON_NPY_CPU_DISPATCH_H_ diff --git a/contrib/python/numpy/py3/numpy/core/src/common/numpyos.c b/contrib/python/numpy/py3/numpy/core/src/common/numpyos.c index 1463730534..c499dd4dd1 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/numpyos.c +++ b/contrib/python/numpy/py3/numpy/core/src/common/numpyos.c @@ -11,6 +11,9 @@ #include "npy_pycompat.h" +#if defined(HAVE_STRTOLD_L) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE +#endif #include <locale.h> #include <stdio.h> diff --git a/contrib/python/numpy/py3/numpy/core/src/common/simd/avx2/memory.h b/contrib/python/numpy/py3/numpy/core/src/common/simd/avx2/memory.h index 993d3ba0d0..f186365381 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/simd/avx2/memory.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/simd/avx2/memory.h @@ -196,7 +196,12 @@ NPY_FINLINE npyv_s32 npyv_load_till_s32(const npy_int32 *ptr, npy_uintp nlane, n __m256i vnlane = _mm256_set1_epi32(nlane > 8 ? 8 : (int)nlane); __m256i mask = _mm256_cmpgt_epi32(vnlane, steps); __m256i payload = _mm256_maskload_epi32((const int*)ptr, mask); - return _mm256_blendv_epi8(vfill, payload, mask); + __m256i ret = _mm256_blendv_epi8(vfill, payload, mask); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_load_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) @@ -205,7 +210,12 @@ NPY_FINLINE npyv_s32 npyv_load_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) const __m256i steps = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7); __m256i vnlane = _mm256_set1_epi32(nlane > 8 ? 8 : (int)nlane); __m256i mask = _mm256_cmpgt_epi32(vnlane, steps); - return _mm256_maskload_epi32((const int*)ptr, mask); + __m256i ret = _mm256_maskload_epi32((const int*)ptr, mask); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } //// 64 NPY_FINLINE npyv_s64 npyv_load_till_s64(const npy_int64 *ptr, npy_uintp nlane, npy_int64 fill) @@ -216,7 +226,12 @@ NPY_FINLINE npyv_s64 npyv_load_till_s64(const npy_int64 *ptr, npy_uintp nlane, n __m256i vnlane = npyv_setall_s64(nlane > 4 ? 4 : (int)nlane); __m256i mask = _mm256_cmpgt_epi64(vnlane, steps); __m256i payload = _mm256_maskload_epi64((const long long*)ptr, mask); - return _mm256_blendv_epi8(vfill, payload, mask); + __m256i ret = _mm256_blendv_epi8(vfill, payload, mask); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s64 npyv_load_tillz_s64(const npy_int64 *ptr, npy_uintp nlane) @@ -225,7 +240,12 @@ NPY_FINLINE npyv_s64 npyv_load_tillz_s64(const npy_int64 *ptr, npy_uintp nlane) const __m256i steps = npyv_set_s64(0, 1, 2, 3); __m256i vnlane = npyv_setall_s64(nlane > 4 ? 4 : (int)nlane); __m256i mask = _mm256_cmpgt_epi64(vnlane, steps); - return _mm256_maskload_epi64((const long long*)ptr, mask); + __m256i ret = _mm256_maskload_epi64((const long long*)ptr, mask); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } //// 64-bit nlane @@ -241,7 +261,12 @@ NPY_FINLINE npyv_s32 npyv_load2_till_s32(const npy_int32 *ptr, npy_uintp nlane, __m256i vnlane = npyv_setall_s64(nlane > 4 ? 4 : (int)nlane); __m256i mask = _mm256_cmpgt_epi64(vnlane, steps); __m256i payload = _mm256_maskload_epi64((const long long*)ptr, mask); - return _mm256_blendv_epi8(vfill, payload, mask); + __m256i ret = _mm256_blendv_epi8(vfill, payload, mask); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_load2_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) @@ -251,19 +276,29 @@ NPY_FINLINE npyv_s32 npyv_load2_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) NPY_FINLINE npyv_u64 npyv_load2_tillz_s64(const npy_int64 *ptr, npy_uintp nlane) { assert(nlane > 0); - npy_int64 m = -((npy_int64)(nlane > 1)); + npy_int64 m = -((npy_int64)(nlane > 1)); __m256i mask = npyv_set_s64(-1, -1, m, m); - return _mm256_maskload_epi64((const long long*)ptr, mask); + __m256i ret = _mm256_maskload_epi64((const long long*)ptr, mask); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_u64 npyv_load2_till_s64(const npy_int64 *ptr, npy_uintp nlane, npy_int64 fill_lo, npy_int64 fill_hi) { const __m256i vfill = npyv_set_s64(0, 0, fill_lo, fill_hi); - npy_int64 m = -((npy_int64)(nlane > 1)); - __m256i mask = npyv_set_s64(-1, -1, m, m); + npy_int64 m = -((npy_int64)(nlane > 1)); + __m256i mask = npyv_set_s64(-1, -1, m, m); __m256i payload = _mm256_maskload_epi64((const long long*)ptr, mask); - return _mm256_blendv_epi8(vfill, payload, mask); + __m256i ret =_mm256_blendv_epi8(vfill, payload, mask); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } /********************************* * Non-contiguous partial load @@ -277,9 +312,14 @@ npyv_loadn_till_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane, npy_ const __m256i vfill = _mm256_set1_epi32(fill); const __m256i steps = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7); const __m256i idx = _mm256_mullo_epi32(_mm256_set1_epi32((int)stride), steps); - __m256i vnlane = _mm256_set1_epi32(nlane > 8 ? 8 : (int)nlane); - __m256i mask = _mm256_cmpgt_epi32(vnlane, steps); - return _mm256_mask_i32gather_epi32(vfill, (const int*)ptr, idx, mask, 4); + __m256i vnlane = _mm256_set1_epi32(nlane > 8 ? 8 : (int)nlane); + __m256i mask = _mm256_cmpgt_epi32(vnlane, steps); + __m256i ret = _mm256_mask_i32gather_epi32(vfill, (const int*)ptr, idx, mask, 4); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 @@ -293,9 +333,14 @@ npyv_loadn_till_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane, npy_ const __m256i vfill = npyv_setall_s64(fill); const __m256i idx = npyv_set_s64(0, 1*stride, 2*stride, 3*stride); const __m256i steps = npyv_set_s64(0, 1, 2, 3); - __m256i vnlane = npyv_setall_s64(nlane > 4 ? 4 : (int)nlane); - __m256i mask = _mm256_cmpgt_epi64(vnlane, steps); - return _mm256_mask_i64gather_epi64(vfill, (const long long*)ptr, idx, mask, 8); + __m256i vnlane = npyv_setall_s64(nlane > 4 ? 4 : (int)nlane); + __m256i mask = _mm256_cmpgt_epi64(vnlane, steps); + __m256i ret = _mm256_mask_i64gather_epi64(vfill, (const long long*)ptr, idx, mask, 8); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s64 @@ -313,9 +358,14 @@ NPY_FINLINE npyv_s64 npyv_loadn2_till_s32(const npy_int32 *ptr, npy_intp stride, ); const __m256i idx = npyv_set_s64(0, 1*stride, 2*stride, 3*stride); const __m256i steps = npyv_set_s64(0, 1, 2, 3); - __m256i vnlane = npyv_setall_s64(nlane > 4 ? 4 : (int)nlane); - __m256i mask = _mm256_cmpgt_epi64(vnlane, steps); - return _mm256_mask_i64gather_epi64(vfill, (const long long*)ptr, idx, mask, 4); + __m256i vnlane = npyv_setall_s64(nlane > 4 ? 4 : (int)nlane); + __m256i mask = _mm256_cmpgt_epi64(vnlane, steps); + __m256i ret = _mm256_mask_i64gather_epi64(vfill, (const long long*)ptr, idx, mask, 4); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_loadn2_tillz_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane) @@ -323,7 +373,7 @@ NPY_FINLINE npyv_s32 npyv_loadn2_tillz_s32(const npy_int32 *ptr, npy_intp stride //// 128-bit load over 64-bit stride NPY_FINLINE npyv_s64 npyv_loadn2_till_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane, - npy_int64 fill_lo, npy_int64 fill_hi) + npy_int64 fill_lo, npy_int64 fill_hi) { assert(nlane > 0); __m256i a = npyv_loadl_s64(ptr); @@ -336,7 +386,12 @@ NPY_FINLINE npyv_s64 npyv_loadn2_till_s64(const npy_int64 *ptr, npy_intp stride, __m128i fill = _mm_set_epi64x(fill_hi, fill_lo); #endif __m128i b = nlane > 1 ? _mm_loadu_si128((const __m128i*)(ptr + stride)) : fill; - return _mm256_inserti128_si256(a, b, 1); + __m256i ret = _mm256_inserti128_si256(a, b, 1); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m256i workaround = ret; + ret = _mm256_or_si256(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s64 npyv_loadn2_tillz_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane) diff --git a/contrib/python/numpy/py3/numpy/core/src/common/simd/avx512/memory.h b/contrib/python/numpy/py3/numpy/core/src/common/simd/avx512/memory.h index fdf96a92c5..e981ef8f6d 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/simd/avx512/memory.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/simd/avx512/memory.h @@ -248,14 +248,24 @@ NPY_FINLINE npyv_s32 npyv_load_till_s32(const npy_int32 *ptr, npy_uintp nlane, n assert(nlane > 0); const __m512i vfill = _mm512_set1_epi32(fill); const __mmask16 mask = nlane > 15 ? -1 : (1 << nlane) - 1; - return _mm512_mask_loadu_epi32(vfill, mask, (const __m512i*)ptr); + __m512i ret = _mm512_mask_loadu_epi32(vfill, mask, (const __m512i*)ptr); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_load_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) { assert(nlane > 0); const __mmask16 mask = nlane > 15 ? -1 : (1 << nlane) - 1; - return _mm512_maskz_loadu_epi32(mask, (const __m512i*)ptr); + __m512i ret = _mm512_maskz_loadu_epi32(mask, (const __m512i*)ptr); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } //// 64 NPY_FINLINE npyv_s64 npyv_load_till_s64(const npy_int64 *ptr, npy_uintp nlane, npy_int64 fill) @@ -263,14 +273,24 @@ NPY_FINLINE npyv_s64 npyv_load_till_s64(const npy_int64 *ptr, npy_uintp nlane, n assert(nlane > 0); const __m512i vfill = npyv_setall_s64(fill); const __mmask8 mask = nlane > 7 ? -1 : (1 << nlane) - 1; - return _mm512_mask_loadu_epi64(vfill, mask, (const __m512i*)ptr); + __m512i ret = _mm512_mask_loadu_epi64(vfill, mask, (const __m512i*)ptr); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s64 npyv_load_tillz_s64(const npy_int64 *ptr, npy_uintp nlane) { assert(nlane > 0); const __mmask8 mask = nlane > 7 ? -1 : (1 << nlane) - 1; - return _mm512_maskz_loadu_epi64(mask, (const __m512i*)ptr); + __m512i ret = _mm512_maskz_loadu_epi64(mask, (const __m512i*)ptr); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } //// 64-bit nlane @@ -280,7 +300,12 @@ NPY_FINLINE npyv_s32 npyv_load2_till_s32(const npy_int32 *ptr, npy_uintp nlane, assert(nlane > 0); const __m512i vfill = _mm512_set4_epi32(fill_hi, fill_lo, fill_hi, fill_lo); const __mmask8 mask = nlane > 7 ? -1 : (1 << nlane) - 1; - return _mm512_mask_loadu_epi64(vfill, mask, (const __m512i*)ptr); + __m512i ret = _mm512_mask_loadu_epi64(vfill, mask, (const __m512i*)ptr); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_load2_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) @@ -293,14 +318,24 @@ NPY_FINLINE npyv_u64 npyv_load2_till_s64(const npy_int64 *ptr, npy_uintp nlane, assert(nlane > 0); const __m512i vfill = _mm512_set4_epi64(fill_hi, fill_lo, fill_hi, fill_lo); const __mmask8 mask = nlane > 3 ? -1 : (1 << (nlane*2)) - 1; - return _mm512_mask_loadu_epi64(vfill, mask, (const __m512i*)ptr); + __m512i ret = _mm512_mask_loadu_epi64(vfill, mask, (const __m512i*)ptr); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s64 npyv_load2_tillz_s64(const npy_int64 *ptr, npy_uintp nlane) { assert(nlane > 0); const __mmask8 mask = nlane > 3 ? -1 : (1 << (nlane*2)) - 1; - return _mm512_maskz_loadu_epi64(mask, (const __m512i*)ptr); + __m512i ret = _mm512_maskz_loadu_epi64(mask, (const __m512i*)ptr); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } /********************************* * Non-contiguous partial load @@ -317,7 +352,12 @@ npyv_loadn_till_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane, npy_ const __m512i idx = _mm512_mullo_epi32(steps, _mm512_set1_epi32((int)stride)); const __m512i vfill = _mm512_set1_epi32(fill); const __mmask16 mask = nlane > 15 ? -1 : (1 << nlane) - 1; - return _mm512_mask_i32gather_epi32(vfill, mask, idx, (const __m512i*)ptr, 4); + __m512i ret = _mm512_mask_i32gather_epi32(vfill, mask, idx, (const __m512i*)ptr, 4); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 @@ -334,7 +374,12 @@ npyv_loadn_till_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane, npy_ ); const __m512i vfill = npyv_setall_s64(fill); const __mmask8 mask = nlane > 15 ? -1 : (1 << nlane) - 1; - return _mm512_mask_i64gather_epi64(vfill, mask, idx, (const __m512i*)ptr, 8); + __m512i ret = _mm512_mask_i64gather_epi64(vfill, mask, idx, (const __m512i*)ptr, 8); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s64 @@ -352,7 +397,12 @@ NPY_FINLINE npyv_s64 npyv_loadn2_till_s32(const npy_int32 *ptr, npy_intp stride, ); const __m512i vfill = _mm512_set4_epi32(fill_hi, fill_lo, fill_hi, fill_lo); const __mmask8 mask = nlane > 7 ? -1 : (1 << nlane) - 1; - return _mm512_mask_i64gather_epi64(vfill, mask, idx, (const __m512i*)ptr, 4); + __m512i ret = _mm512_mask_i64gather_epi64(vfill, mask, idx, (const __m512i*)ptr, 4); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_loadn2_tillz_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane) @@ -369,7 +419,12 @@ NPY_FINLINE npyv_s64 npyv_loadn2_till_s64(const npy_int64 *ptr, npy_intp stride, ); const __mmask8 mask = nlane > 3 ? -1 : (1 << (nlane*2)) - 1; const __m512i vfill = _mm512_set4_epi64(fill_hi, fill_lo, fill_hi, fill_lo); - return _mm512_mask_i64gather_epi64(vfill, mask, idx, (const __m512i*)ptr, 8); + __m512i ret = _mm512_mask_i64gather_epi64(vfill, mask, idx, (const __m512i*)ptr, 8); +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m512i workaround = ret; + ret = _mm512_or_si512(workaround, ret); +#endif + return ret; } // fill zero to rest lanes NPY_FINLINE npyv_s64 npyv_loadn2_tillz_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane) diff --git a/contrib/python/numpy/py3/numpy/core/src/common/simd/neon/memory.h b/contrib/python/numpy/py3/numpy/core/src/common/simd/neon/memory.h index 6163440c39..2dc21e5a43 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/simd/neon/memory.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/simd/neon/memory.h @@ -187,19 +187,28 @@ NPY_FINLINE void npyv_storen2_f64(double *ptr, npy_intp stride, npyv_f64 a) NPY_FINLINE npyv_s32 npyv_load_till_s32(const npy_int32 *ptr, npy_uintp nlane, npy_int32 fill) { assert(nlane > 0); + npyv_s32 a; switch(nlane) { case 1: - return vld1q_lane_s32((const int32_t*)ptr, vdupq_n_s32(fill), 0); + a = vld1q_lane_s32((const int32_t*)ptr, vdupq_n_s32(fill), 0); + break; case 2: - return vcombine_s32(vld1_s32((const int32_t*)ptr), vdup_n_s32(fill)); + a = vcombine_s32(vld1_s32((const int32_t*)ptr), vdup_n_s32(fill)); + break; case 3: - return vcombine_s32( + a = vcombine_s32( vld1_s32((const int32_t*)ptr), vld1_lane_s32((const int32_t*)ptr + 2, vdup_n_s32(fill), 0) ); + break; default: return npyv_load_s32(ptr); } +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = a; + a = vorrq_s32(workaround, a); +#endif + return a; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_load_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) @@ -209,7 +218,12 @@ NPY_FINLINE npyv_s64 npyv_load_till_s64(const npy_int64 *ptr, npy_uintp nlane, n { assert(nlane > 0); if (nlane == 1) { - return vcombine_s64(vld1_s64((const int64_t*)ptr), vdup_n_s64(fill)); + npyv_s64 a = vcombine_s64(vld1_s64((const int64_t*)ptr), vdup_n_s64(fill)); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s64 workaround = a; + a = vorrq_s64(workaround, a); + #endif + return a; } return npyv_load_s64(ptr); } @@ -224,7 +238,12 @@ NPY_FINLINE npyv_s32 npyv_load2_till_s32(const npy_int32 *ptr, npy_uintp nlane, assert(nlane > 0); if (nlane == 1) { const int32_t NPY_DECL_ALIGNED(16) fill[2] = {fill_lo, fill_hi}; - return vcombine_s32(vld1_s32((const int32_t*)ptr), vld1_s32(fill)); + npyv_s32 a = vcombine_s32(vld1_s32((const int32_t*)ptr), vld1_s32(fill)); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = a; + a = vorrq_s32(workaround, a); + #endif + return a; } return npyv_load_s32(ptr); } @@ -256,10 +275,15 @@ npyv_loadn_till_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane, npy_ vfill = vld1q_lane_s32((const int32_t*)ptr + stride, vfill, 1); case 1: vfill = vld1q_lane_s32((const int32_t*)ptr, vfill, 0); - return vfill; + break; default: return npyv_loadn_s32(ptr, stride); } +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = vfill; + vfill = vorrq_s32(workaround, vfill); +#endif + return vfill; } NPY_FINLINE npyv_s32 npyv_loadn_tillz_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane) @@ -270,7 +294,7 @@ npyv_loadn_till_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane, npy_ { assert(nlane > 0); if (nlane == 1) { - return vcombine_s64(vld1_s64((const int64_t*)ptr), vdup_n_s64(fill)); + return npyv_load_till_s64(ptr, 1, fill); } return npyv_loadn_s64(ptr, stride); } @@ -285,7 +309,12 @@ NPY_FINLINE npyv_s32 npyv_loadn2_till_s32(const npy_int32 *ptr, npy_intp stride, assert(nlane > 0); if (nlane == 1) { const int32_t NPY_DECL_ALIGNED(16) fill[2] = {fill_lo, fill_hi}; - return vcombine_s32(vld1_s32((const int32_t*)ptr), vld1_s32(fill)); + npyv_s32 a = vcombine_s32(vld1_s32((const int32_t*)ptr), vld1_s32(fill)); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = a; + a = vorrq_s32(workaround, a); + #endif + return a; } return npyv_loadn2_s32(ptr, stride); } @@ -293,7 +322,12 @@ NPY_FINLINE npyv_s32 npyv_loadn2_tillz_s32(const npy_int32 *ptr, npy_intp stride { assert(nlane > 0); if (nlane == 1) { - return vcombine_s32(vld1_s32((const int32_t*)ptr), vdup_n_s32(0)); + npyv_s32 a = vcombine_s32(vld1_s32((const int32_t*)ptr), vdup_n_s32(0)); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = a; + a = vorrq_s32(workaround, a); + #endif + return a; } return npyv_loadn2_s32(ptr, stride); } diff --git a/contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h b/contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h index 8c9b14251a..a5b1fa0c55 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/simd/simd.h @@ -18,18 +18,23 @@ #ifdef __cplusplus extern "C" { #endif - -// lane type by intrin suffix -typedef npy_uint8 npyv_lanetype_u8; -typedef npy_int8 npyv_lanetype_s8; -typedef npy_uint16 npyv_lanetype_u16; -typedef npy_int16 npyv_lanetype_s16; -typedef npy_uint32 npyv_lanetype_u32; -typedef npy_int32 npyv_lanetype_s32; -typedef npy_uint64 npyv_lanetype_u64; -typedef npy_int64 npyv_lanetype_s64; -typedef float npyv_lanetype_f32; -typedef double npyv_lanetype_f64; +/* + * clang commit a agrresive optimization behavoueir when flag `-ftrapping-math` + * isn't fully supported that's present at -O1 or greater. When partially loading a + * vector register for a operations that requires to fill up the remaining lanes + * with certain value for example divide operation needs to fill the remaining value + * with non-zero integer to avoid fp exception divide-by-zero. + * clang optimizer notices that the entire register is not needed for the store + * and optimizes out the fill of non-zero integer to the remaining + * elements. As workaround we mark the returned register with `volatile` + * followed by symmetric operand operation e.g. `or` + * to convince the compiler that the entire vector is needed. + */ +#if defined(__clang__) && !defined(NPY_HAVE_CLANG_FPSTRICT) + #define NPY_SIMD_GUARD_PARTIAL_LOAD 1 +#else + #define NPY_SIMD_GUARD_PARTIAL_LOAD 0 +#endif #if defined(_MSC_VER) && defined(_M_IX86) /* @@ -50,6 +55,19 @@ typedef double npyv_lanetype_f64; #undef _mm256_set_epi64x #undef _mm_set_epi64x #endif + +// lane type by intrin suffix +typedef npy_uint8 npyv_lanetype_u8; +typedef npy_int8 npyv_lanetype_s8; +typedef npy_uint16 npyv_lanetype_u16; +typedef npy_int16 npyv_lanetype_s16; +typedef npy_uint32 npyv_lanetype_u32; +typedef npy_int32 npyv_lanetype_s32; +typedef npy_uint64 npyv_lanetype_u64; +typedef npy_int64 npyv_lanetype_s64; +typedef float npyv_lanetype_f32; +typedef double npyv_lanetype_f64; + #if defined(NPY_HAVE_AVX512F) && !defined(NPY_SIMD_FORCE_256) && !defined(NPY_SIMD_FORCE_128) #include "avx512/avx512.h" #elif defined(NPY_HAVE_AVX2) && !defined(NPY_SIMD_FORCE_128) diff --git a/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/arithmetic.h b/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/arithmetic.h index 72a87eac17..357b136d25 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/arithmetic.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/arithmetic.h @@ -321,7 +321,7 @@ NPY_FINLINE npyv_s64 npyv_divc_s64(npyv_s64 a, const npyv_s64x3 divisor) NPY_FINLINE npyv_f32 npyv_muladdsub_f32(npyv_f32 a, npyv_f32 b, npyv_f32 c) { npyv_f32 m = npyv_mul_f32(a, b); - #if NPY_HAVE_SSE3 + #ifdef NPY_HAVE_SSE3 return _mm_addsub_ps(m, c); #else const npyv_f32 msign = npyv_set_f32(-0.0f, 0.0f, -0.0f, 0.0f); @@ -331,7 +331,7 @@ NPY_FINLINE npyv_s64 npyv_divc_s64(npyv_s64 a, const npyv_s64x3 divisor) NPY_FINLINE npyv_f64 npyv_muladdsub_f64(npyv_f64 a, npyv_f64 b, npyv_f64 c) { npyv_f64 m = npyv_mul_f64(a, b); - #if NPY_HAVE_SSE3 + #ifdef NPY_HAVE_SSE3 return _mm_addsub_pd(m, c); #else const npyv_f64 msign = npyv_set_f64(-0.0, 0.0); diff --git a/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/memory.h b/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/memory.h index 4c8e86a6f9..90c01ffefe 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/memory.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/simd/sse/memory.h @@ -178,62 +178,53 @@ NPY_FINLINE void npyv_storen2_f64(double *ptr, npy_intp stride, npyv_f64 a) /********************************* * Partial Load *********************************/ -#if defined(__clang__) && __clang_major__ > 7 - /** - * Clang >=8 perform aggressive optimization that tends to - * zero the bits of upper half part of vectors even - * when we try to fill it up with certain scalars, - * which my lead to zero division errors. - */ - #define NPYV__CLANG_ZEROUPPER -#endif //// 32 NPY_FINLINE npyv_s32 npyv_load_till_s32(const npy_int32 *ptr, npy_uintp nlane, npy_int32 fill) { assert(nlane > 0); -#ifdef NPYV__CLANG_ZEROUPPER - if (nlane > 3) { - return npyv_load_s32(ptr); - } - npy_int32 NPY_DECL_ALIGNED(16) data[4] = {fill, fill, fill, fill}; - for (npy_uint64 i = 0; i < nlane; ++i) { - data[i] = ptr[i]; - } - return npyv_loada_s32(data); -#else #ifndef NPY_HAVE_SSE41 const short *wptr = (const short*)ptr; #endif const __m128i vfill = npyv_setall_s32(fill); __m128i a; switch(nlane) { - case 2: - return _mm_castpd_si128( - _mm_loadl_pd(_mm_castsi128_pd(vfill), (double*)ptr) - ); + case 2: + a = _mm_castpd_si128( + _mm_loadl_pd(_mm_castsi128_pd(vfill), (double*)ptr) + ); + break; #ifdef NPY_HAVE_SSE41 case 1: - return _mm_insert_epi32(vfill, ptr[0], 0); + a = _mm_insert_epi32(vfill, ptr[0], 0); + break; case 3: a = _mm_loadl_epi64((const __m128i*)ptr); a = _mm_insert_epi32(a, ptr[2], 2); a = _mm_insert_epi32(a, fill, 3); - return a; + break; #else case 1: a = _mm_insert_epi16(vfill, wptr[0], 0); - return _mm_insert_epi16(a, wptr[1], 1); + a = _mm_insert_epi16(a, wptr[1], 1); + break; case 3: a = _mm_loadl_epi64((const __m128i*)ptr); a = _mm_unpacklo_epi64(a, vfill); a = _mm_insert_epi16(a, wptr[4], 4); a = _mm_insert_epi16(a, wptr[5], 5); - return a; + break; #endif // NPY_HAVE_SSE41 default: return npyv_load_s32(ptr); - } -#endif + } + #if NPY_SIMD_GUARD_PARTIAL_LOAD + // We use a variable marked 'volatile' to convince the compiler that + // the entire vector is needed. + volatile __m128i workaround = a; + // avoid optimizing it out + a = _mm_or_si128(workaround, a); + #endif + return a; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_load_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) @@ -260,22 +251,17 @@ NPY_FINLINE npyv_s32 npyv_load_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) NPY_FINLINE npyv_s64 npyv_load_till_s64(const npy_int64 *ptr, npy_uintp nlane, npy_int64 fill) { assert(nlane > 0); -#ifdef NPYV__CLANG_ZEROUPPER - if (nlane <= 2) { - npy_int64 NPY_DECL_ALIGNED(16) data[2] = {fill, fill}; - for (npy_uint64 i = 0; i < nlane; ++i) { - data[i] = ptr[i]; - } - return npyv_loada_s64(data); - } -#else if (nlane == 1) { const __m128i vfill = npyv_setall_s64(fill); - return _mm_castpd_si128( + npyv_s64 a = _mm_castpd_si128( _mm_loadl_pd(_mm_castsi128_pd(vfill), (double*)ptr) ); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m128i workaround = a; + a = _mm_or_si128(workaround, a); + #endif + return a; } -#endif return npyv_load_s64(ptr); } // fill zero to rest lanes @@ -295,9 +281,14 @@ NPY_FINLINE npyv_s32 npyv_load2_till_s32(const npy_int32 *ptr, npy_uintp nlane, assert(nlane > 0); if (nlane == 1) { const __m128i vfill = npyv_set_s32(fill_lo, fill_hi, fill_lo, fill_hi); - return _mm_castpd_si128( + __m128i a = _mm_castpd_si128( _mm_loadl_pd(_mm_castsi128_pd(vfill), (double*)ptr) ); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m128i workaround = a; + a = _mm_or_si128(workaround, a); + #endif + return a; } return npyv_load_s32(ptr); } @@ -321,16 +312,6 @@ NPY_FINLINE npyv_s32 npyv_loadn_till_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane, npy_int32 fill) { assert(nlane > 0); -#ifdef NPYV__CLANG_ZEROUPPER - if (nlane > 3) { - return npyv_loadn_s32(ptr, stride); - } - npy_int32 NPY_DECL_ALIGNED(16) data[4] = {fill, fill, fill, fill}; - for (npy_uint64 i = 0; i < nlane; ++i) { - data[i] = ptr[stride*i]; - } - return npyv_loada_s32(data); -#else __m128i vfill = npyv_setall_s32(fill); #ifndef NPY_HAVE_SSE41 const short *wptr = (const short*)ptr; @@ -360,8 +341,11 @@ npyv_loadn_till_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane, npy_ default: return npyv_loadn_s32(ptr, stride); } // switch - return vfill; +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m128i workaround = vfill; + vfill = _mm_or_si128(workaround, vfill); #endif + return vfill; } // fill zero to rest lanes NPY_FINLINE npyv_s32 @@ -402,22 +386,9 @@ NPY_FINLINE npyv_s64 npyv_loadn_till_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane, npy_int64 fill) { assert(nlane > 0); -#ifdef NPYV__CLANG_ZEROUPPER - if (nlane <= 2) { - npy_int64 NPY_DECL_ALIGNED(16) data[2] = {fill, fill}; - for (npy_uint64 i = 0; i < nlane; ++i) { - data[i] = ptr[i*stride]; - } - return npyv_loada_s64(data); - } -#else if (nlane == 1) { - const __m128i vfill = npyv_setall_s64(fill); - return _mm_castpd_si128( - _mm_loadl_pd(_mm_castsi128_pd(vfill), (double*)ptr) - ); + return npyv_load_till_s64(ptr, 1, fill); } -#endif return npyv_loadn_s64(ptr, stride); } // fill zero to rest lanes @@ -437,9 +408,14 @@ NPY_FINLINE npyv_s32 npyv_loadn2_till_s32(const npy_int32 *ptr, npy_intp stride, assert(nlane > 0); if (nlane == 1) { const __m128i vfill = npyv_set_s32(0, 0, fill_lo, fill_hi); - return _mm_castpd_si128( + __m128i a = _mm_castpd_si128( _mm_loadl_pd(_mm_castsi128_pd(vfill), (double*)ptr) ); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile __m128i workaround = a; + a = _mm_or_si128(workaround, a); + #endif + return a; } return npyv_loadn2_s32(ptr, stride); } diff --git a/contrib/python/numpy/py3/numpy/core/src/common/simd/vec/memory.h b/contrib/python/numpy/py3/numpy/core/src/common/simd/vec/memory.h index 4545e53e90..dbcdc16da3 100644 --- a/contrib/python/numpy/py3/numpy/core/src/common/simd/vec/memory.h +++ b/contrib/python/numpy/py3/numpy/core/src/common/simd/vec/memory.h @@ -210,24 +210,33 @@ NPY_FINLINE npyv_s32 npyv_load_till_s32(const npy_int32 *ptr, npy_uintp nlane, n const npyv_u32 vlane = npyv_setall_u32(blane); const npyv_b32 mask = vec_cmpgt(vlane, steps); npyv_s32 a = vec_load_len(ptr, blane*4-1); - return vec_sel(vfill, a, mask); + a = vec_sel(vfill, a, mask); #else + npyv_s32 a; switch(nlane) { case 1: - return vec_insert(ptr[0], vfill, 0); + a = vec_insert(ptr[0], vfill, 0); + break; case 2: - return (npyv_s32)vec_insert( + a = (npyv_s32)vec_insert( *npyv__ptr2u64(ptr), (npyv_u64)vfill, 0 ); + break; case 3: vfill = vec_insert(ptr[2], vfill, 2); - return (npyv_s32)vec_insert( + a = (npyv_s32)vec_insert( *npyv__ptr2u64(ptr), (npyv_u64)vfill, 0 ); + break; default: return npyv_load_s32(ptr); } #endif +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = a; + a = vec_or(workaround, a); +#endif + return a; } // fill zero to rest lanes NPY_FINLINE npyv_s32 npyv_load_tillz_s32(const npy_int32 *ptr, npy_uintp nlane) @@ -244,7 +253,12 @@ NPY_FINLINE npyv_s64 npyv_load_till_s64(const npy_int64 *ptr, npy_uintp nlane, n { assert(nlane > 0); if (nlane == 1) { - return npyv_set_s64(ptr[0], fill); + npyv_s64 r = npyv_set_s64(ptr[0], fill); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s64 workaround = r; + r = vec_or(workaround, r); + #endif + return r; } return npyv_load_s64(ptr); } @@ -264,7 +278,12 @@ NPY_FINLINE npyv_s32 npyv_load2_till_s32(const npy_int32 *ptr, npy_uintp nlane, { assert(nlane > 0); if (nlane == 1) { - return npyv_set_s32(ptr[0], ptr[1], fill_lo, fill_hi); + npyv_s32 r = npyv_set_s32(ptr[0], ptr[1], fill_lo, fill_hi); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = r; + r = vec_or(workaround, r); + #endif + return r; } return npyv_load_s32(ptr); } @@ -299,6 +318,10 @@ npyv_loadn_till_s32(const npy_int32 *ptr, npy_intp stride, npy_uintp nlane, npy_ default: return npyv_loadn_s32(ptr, stride); } // switch +#if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = vfill; + vfill = vec_or(workaround, vfill); +#endif return vfill; } // fill zero to rest lanes @@ -311,7 +334,7 @@ npyv_loadn_till_s64(const npy_int64 *ptr, npy_intp stride, npy_uintp nlane, npy_ { assert(nlane > 0); if (nlane == 1) { - return npyv_set_s64(*ptr, fill); + return npyv_load_till_s64(ptr, nlane, fill); } return npyv_loadn_s64(ptr, stride); } @@ -325,7 +348,12 @@ NPY_FINLINE npyv_s32 npyv_loadn2_till_s32(const npy_int32 *ptr, npy_intp stride, { assert(nlane > 0); if (nlane == 1) { - return npyv_set_s32(ptr[0], ptr[1], fill_lo, fill_hi); + npyv_s32 r = npyv_set_s32(ptr[0], ptr[1], fill_lo, fill_hi); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = r; + r = vec_or(workaround, r); + #endif + return r; } return npyv_loadn2_s32(ptr, stride); } @@ -333,7 +361,12 @@ NPY_FINLINE npyv_s32 npyv_loadn2_tillz_s32(const npy_int32 *ptr, npy_intp stride { assert(nlane > 0); if (nlane == 1) { - return (npyv_s32)npyv_set_s64(*(npy_int64*)ptr, 0); + npyv_s32 r = (npyv_s32)npyv_set_s64(*(npy_int64*)ptr, 0); + #if NPY_SIMD_GUARD_PARTIAL_LOAD + volatile npyv_s32 workaround = r; + r = vec_or(workaround, r); + #endif + return r; } return npyv_loadn2_s32(ptr, stride); } diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c b/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c index 8a934416a0..44569b6181 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c @@ -2072,7 +2072,7 @@ get_struct_alignments(PyObject *NPY_UNUSED(self), PyObject *args) { } #line 2029 - alignment = PyLong_FromLong(_ALIGN(struct TestStruct1)); + alignment = PyLong_FromLong(NPY_ALIGNOF(struct TestStruct1)); size = PyLong_FromLong(sizeof(struct TestStruct1)); val = PyTuple_Pack(2, alignment, size); Py_DECREF(alignment); @@ -2084,7 +2084,7 @@ get_struct_alignments(PyObject *NPY_UNUSED(self), PyObject *args) { PyTuple_SET_ITEM(ret, 1-1, val); #line 2029 - alignment = PyLong_FromLong(_ALIGN(struct TestStruct2)); + alignment = PyLong_FromLong(NPY_ALIGNOF(struct TestStruct2)); size = PyLong_FromLong(sizeof(struct TestStruct2)); val = PyTuple_Pack(2, alignment, size); Py_DECREF(alignment); @@ -2096,7 +2096,7 @@ get_struct_alignments(PyObject *NPY_UNUSED(self), PyObject *args) { PyTuple_SET_ITEM(ret, 2-1, val); #line 2029 - alignment = PyLong_FromLong(_ALIGN(struct TestStruct3)); + alignment = PyLong_FromLong(NPY_ALIGNOF(struct TestStruct3)); size = PyLong_FromLong(sizeof(struct TestStruct3)); val = PyTuple_Pack(2, alignment, size); Py_DECREF(alignment); diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c.src b/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c.src index 482596f976..cd2aa20f85 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c.src +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/_multiarray_tests.c.src @@ -2026,7 +2026,7 @@ get_struct_alignments(PyObject *NPY_UNUSED(self), PyObject *args) { /**begin repeat * #N = 1,2,3# */ - alignment = PyLong_FromLong(_ALIGN(struct TestStruct@N@)); + alignment = PyLong_FromLong(NPY_ALIGNOF(struct TestStruct@N@)); size = PyLong_FromLong(sizeof(struct TestStruct@N@)); val = PyTuple_Pack(2, alignment, size); Py_DECREF(alignment); diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c b/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c index e306054175..58e8b3778b 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c @@ -1018,7 +1018,7 @@ BOOL_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_bool))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_bool))); *((npy_bool *)ov)=temp; } else { @@ -1087,7 +1087,7 @@ BYTE_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_byte))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_byte))); *((npy_byte *)ov)=temp; } else { @@ -1156,7 +1156,7 @@ UBYTE_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_ubyte))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_ubyte))); *((npy_ubyte *)ov)=temp; } else { @@ -1225,7 +1225,7 @@ SHORT_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_short))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_short))); *((npy_short *)ov)=temp; } else { @@ -1294,7 +1294,7 @@ USHORT_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_ushort))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_ushort))); *((npy_ushort *)ov)=temp; } else { @@ -1363,7 +1363,7 @@ INT_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_int))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_int))); *((npy_int *)ov)=temp; } else { @@ -1432,7 +1432,7 @@ LONG_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_long))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_long))); *((npy_long *)ov)=temp; } else { @@ -1501,7 +1501,7 @@ UINT_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_uint))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_uint))); *((npy_uint *)ov)=temp; } else { @@ -1570,7 +1570,7 @@ ULONG_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_ulong))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_ulong))); *((npy_ulong *)ov)=temp; } else { @@ -1639,7 +1639,7 @@ LONGLONG_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_longlong))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_longlong))); *((npy_longlong *)ov)=temp; } else { @@ -1708,7 +1708,7 @@ ULONGLONG_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_ulonglong))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_ulonglong))); *((npy_ulonglong *)ov)=temp; } else { @@ -1777,7 +1777,7 @@ HALF_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_half))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_half))); *((npy_half *)ov)=temp; } else { @@ -1846,7 +1846,7 @@ FLOAT_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_float))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_float))); *((npy_float *)ov)=temp; } else { @@ -1915,7 +1915,7 @@ DOUBLE_setitem(PyObject *op, void *ov, void *vap) return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(npy_double))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(npy_double))); *((npy_double *)ov)=temp; } else { @@ -2507,7 +2507,7 @@ STRING_setitem(PyObject *op, void *ov, void *vap) /* OBJECT */ -#define __ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0) +#define NPY__ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0) static PyObject * OBJECT_getitem(void *ip, void *NPY_UNUSED(ap)) @@ -20531,10 +20531,10 @@ OBJECT_copyswapn(PyObject **dst, npy_intp dstride, PyObject **src, { npy_intp i; if (src != NULL) { - if (__ALIGNED(dst, sizeof(PyObject **)) - && __ALIGNED(src, sizeof(PyObject **)) - && __ALIGNED(dstride, sizeof(PyObject **)) - && __ALIGNED(sstride, sizeof(PyObject **))) { + if (NPY__ALIGNED(dst, sizeof(PyObject **)) + && NPY__ALIGNED(src, sizeof(PyObject **)) + && NPY__ALIGNED(dstride, sizeof(PyObject **)) + && NPY__ALIGNED(sstride, sizeof(PyObject **))) { dstride /= sizeof(PyObject **); sstride /= sizeof(PyObject **); for (i = 0; i < n; i++) { @@ -20571,8 +20571,8 @@ OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap), { if (src != NULL) { - if (__ALIGNED(dst,sizeof(PyObject **)) && - __ALIGNED(src,sizeof(PyObject **))) { + if (NPY__ALIGNED(dst,sizeof(PyObject **)) && + NPY__ALIGNED(src,sizeof(PyObject **))) { Py_XINCREF(*src); Py_XDECREF(*dst); *dst = *src; @@ -21446,7 +21446,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap) } dummy_fields.descr = new; - if ((new->alignment > 1) && !__ALIGNED(ip + offset, + if ((new->alignment > 1) && !NPY__ALIGNED(ip + offset, new->alignment)) { PyArray_CLEARFLAGS(dummy_arr, NPY_ARRAY_ALIGNED); } @@ -21471,7 +21471,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap) return nonz; } -#undef __ALIGNED +#undef NPY__ALIGNED /* @@ -27405,7 +27405,7 @@ static PyArray_Descr VOID_Descr = { /* elsize */ 0, /* alignment */ - _ALIGN(char), + NPY_ALIGNOF(char), /* subarray */ NULL, /* fields */ @@ -27509,7 +27509,7 @@ static PyArray_Descr STRING_Descr = { /* elsize */ 0, /* alignment */ - _ALIGN(char), + NPY_ALIGNOF(char), /* subarray */ NULL, /* fields */ @@ -27613,7 +27613,7 @@ static PyArray_Descr UNICODE_Descr = { /* elsize */ 0, /* alignment */ - _ALIGN(npy_ucs4), + NPY_ALIGNOF(npy_ucs4), /* subarray */ NULL, /* fields */ @@ -27727,7 +27727,7 @@ NPY_NO_EXPORT PyArray_Descr BOOL_Descr = { /* elsize */ sizeof(npy_bool), /* alignment */ - _ALIGN(npy_bool), + NPY_ALIGNOF(npy_bool), /* subarray */ NULL, /* fields */ @@ -27840,7 +27840,7 @@ NPY_NO_EXPORT PyArray_Descr BYTE_Descr = { /* elsize */ sizeof(npy_byte), /* alignment */ - _ALIGN(npy_byte), + NPY_ALIGNOF(npy_byte), /* subarray */ NULL, /* fields */ @@ -27953,7 +27953,7 @@ NPY_NO_EXPORT PyArray_Descr UBYTE_Descr = { /* elsize */ sizeof(npy_ubyte), /* alignment */ - _ALIGN(npy_ubyte), + NPY_ALIGNOF(npy_ubyte), /* subarray */ NULL, /* fields */ @@ -28066,7 +28066,7 @@ NPY_NO_EXPORT PyArray_Descr SHORT_Descr = { /* elsize */ sizeof(npy_short), /* alignment */ - _ALIGN(npy_short), + NPY_ALIGNOF(npy_short), /* subarray */ NULL, /* fields */ @@ -28179,7 +28179,7 @@ NPY_NO_EXPORT PyArray_Descr USHORT_Descr = { /* elsize */ sizeof(npy_ushort), /* alignment */ - _ALIGN(npy_ushort), + NPY_ALIGNOF(npy_ushort), /* subarray */ NULL, /* fields */ @@ -28292,7 +28292,7 @@ NPY_NO_EXPORT PyArray_Descr INT_Descr = { /* elsize */ sizeof(npy_int), /* alignment */ - _ALIGN(npy_int), + NPY_ALIGNOF(npy_int), /* subarray */ NULL, /* fields */ @@ -28405,7 +28405,7 @@ NPY_NO_EXPORT PyArray_Descr UINT_Descr = { /* elsize */ sizeof(npy_uint), /* alignment */ - _ALIGN(npy_uint), + NPY_ALIGNOF(npy_uint), /* subarray */ NULL, /* fields */ @@ -28518,7 +28518,7 @@ NPY_NO_EXPORT PyArray_Descr LONG_Descr = { /* elsize */ sizeof(npy_long), /* alignment */ - _ALIGN(npy_long), + NPY_ALIGNOF(npy_long), /* subarray */ NULL, /* fields */ @@ -28631,7 +28631,7 @@ NPY_NO_EXPORT PyArray_Descr ULONG_Descr = { /* elsize */ sizeof(npy_ulong), /* alignment */ - _ALIGN(npy_ulong), + NPY_ALIGNOF(npy_ulong), /* subarray */ NULL, /* fields */ @@ -28744,7 +28744,7 @@ NPY_NO_EXPORT PyArray_Descr LONGLONG_Descr = { /* elsize */ sizeof(npy_longlong), /* alignment */ - _ALIGN(npy_longlong), + NPY_ALIGNOF(npy_longlong), /* subarray */ NULL, /* fields */ @@ -28857,7 +28857,7 @@ NPY_NO_EXPORT PyArray_Descr ULONGLONG_Descr = { /* elsize */ sizeof(npy_ulonglong), /* alignment */ - _ALIGN(npy_ulonglong), + NPY_ALIGNOF(npy_ulonglong), /* subarray */ NULL, /* fields */ @@ -28970,7 +28970,7 @@ NPY_NO_EXPORT PyArray_Descr HALF_Descr = { /* elsize */ sizeof(npy_half), /* alignment */ - _ALIGN(npy_half), + NPY_ALIGNOF(npy_half), /* subarray */ NULL, /* fields */ @@ -29083,7 +29083,7 @@ NPY_NO_EXPORT PyArray_Descr FLOAT_Descr = { /* elsize */ sizeof(npy_float), /* alignment */ - _ALIGN(npy_float), + NPY_ALIGNOF(npy_float), /* subarray */ NULL, /* fields */ @@ -29196,7 +29196,7 @@ NPY_NO_EXPORT PyArray_Descr DOUBLE_Descr = { /* elsize */ sizeof(npy_double), /* alignment */ - _ALIGN(npy_double), + NPY_ALIGNOF(npy_double), /* subarray */ NULL, /* fields */ @@ -29309,7 +29309,7 @@ NPY_NO_EXPORT PyArray_Descr LONGDOUBLE_Descr = { /* elsize */ sizeof(npy_longdouble), /* alignment */ - _ALIGN(npy_longdouble), + NPY_ALIGNOF(npy_longdouble), /* subarray */ NULL, /* fields */ @@ -29422,7 +29422,7 @@ NPY_NO_EXPORT PyArray_Descr CFLOAT_Descr = { /* elsize */ sizeof(npy_cfloat), /* alignment */ - _ALIGN(npy_cfloat), + NPY_ALIGNOF(npy_cfloat), /* subarray */ NULL, /* fields */ @@ -29535,7 +29535,7 @@ NPY_NO_EXPORT PyArray_Descr CDOUBLE_Descr = { /* elsize */ sizeof(npy_cdouble), /* alignment */ - _ALIGN(npy_cdouble), + NPY_ALIGNOF(npy_cdouble), /* subarray */ NULL, /* fields */ @@ -29648,7 +29648,7 @@ NPY_NO_EXPORT PyArray_Descr CLONGDOUBLE_Descr = { /* elsize */ sizeof(npy_clongdouble), /* alignment */ - _ALIGN(npy_clongdouble), + NPY_ALIGNOF(npy_clongdouble), /* subarray */ NULL, /* fields */ @@ -29761,7 +29761,7 @@ NPY_NO_EXPORT PyArray_Descr OBJECT_Descr = { /* elsize */ sizeof(PyObject *), /* alignment */ - _ALIGN(PyObject *), + NPY_ALIGNOF(PyObject *), /* subarray */ NULL, /* fields */ @@ -29874,7 +29874,7 @@ NPY_NO_EXPORT PyArray_Descr DATETIME_Descr = { /* elsize */ sizeof(npy_datetime), /* alignment */ - _ALIGN(npy_datetime), + NPY_ALIGNOF(npy_datetime), /* subarray */ NULL, /* fields */ @@ -29987,7 +29987,7 @@ NPY_NO_EXPORT PyArray_Descr TIMEDELTA_Descr = { /* elsize */ sizeof(npy_timedelta), /* alignment */ - _ALIGN(npy_timedelta), + NPY_ALIGNOF(npy_timedelta), /* subarray */ NULL, /* fields */ @@ -32922,7 +32922,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_BOOLLTR, NPY_BOOL, NPY_BITSOF_BOOL, _ALIGN(npy_bool), + NPY_BOOLLTR, NPY_BOOL, NPY_BITSOF_BOOL, NPY_ALIGNOF(npy_bool), Py_BuildValue("i", 1), Py_BuildValue("i", 0), &PyBoolArrType_Type @@ -32943,7 +32943,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_BYTELTR, NPY_BYTE, NPY_BITSOF_BYTE, _ALIGN(npy_byte), + NPY_BYTELTR, NPY_BYTE, NPY_BITSOF_BYTE, NPY_ALIGNOF(npy_byte), Py_BuildValue("i", NPY_MAX_BYTE), Py_BuildValue("i", NPY_MIN_BYTE), &PyByteArrType_Type @@ -32964,7 +32964,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_UBYTELTR, NPY_UBYTE, NPY_BITSOF_BYTE, _ALIGN(npy_ubyte), + NPY_UBYTELTR, NPY_UBYTE, NPY_BITSOF_BYTE, NPY_ALIGNOF(npy_ubyte), Py_BuildValue("i", NPY_MAX_UBYTE), Py_BuildValue("i", 0), &PyUByteArrType_Type @@ -32985,7 +32985,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_SHORTLTR, NPY_SHORT, NPY_BITSOF_SHORT, _ALIGN(npy_short), + NPY_SHORTLTR, NPY_SHORT, NPY_BITSOF_SHORT, NPY_ALIGNOF(npy_short), Py_BuildValue("i", NPY_MAX_SHORT), Py_BuildValue("i", NPY_MIN_SHORT), &PyShortArrType_Type @@ -33006,7 +33006,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_USHORTLTR, NPY_USHORT, NPY_BITSOF_SHORT, _ALIGN(npy_ushort), + NPY_USHORTLTR, NPY_USHORT, NPY_BITSOF_SHORT, NPY_ALIGNOF(npy_ushort), Py_BuildValue("i", NPY_MAX_USHORT), Py_BuildValue("i", 0), &PyUShortArrType_Type @@ -33027,7 +33027,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_INTLTR, NPY_INT, NPY_BITSOF_INT, _ALIGN(npy_int), + NPY_INTLTR, NPY_INT, NPY_BITSOF_INT, NPY_ALIGNOF(npy_int), Py_BuildValue("i", NPY_MAX_INT), Py_BuildValue("i", NPY_MIN_INT), &PyIntArrType_Type @@ -33048,7 +33048,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_UINTLTR, NPY_UINT, NPY_BITSOF_INT, _ALIGN(npy_uint), + NPY_UINTLTR, NPY_UINT, NPY_BITSOF_INT, NPY_ALIGNOF(npy_uint), Py_BuildValue("N", PyLong_FromUnsignedLong(NPY_MAX_UINT)), Py_BuildValue("i", 0), &PyUIntArrType_Type @@ -33069,7 +33069,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_INTPLTR, NPY_INTP, NPY_BITSOF_INTP, _ALIGN(npy_intp), + NPY_INTPLTR, NPY_INTP, NPY_BITSOF_INTP, NPY_ALIGNOF(npy_intp), Py_BuildValue("N", PyLong_FromLongLong((npy_longlong) NPY_MAX_INTP)), Py_BuildValue("N", PyLong_FromLongLong((npy_longlong) NPY_MIN_INTP)), &PyIntpArrType_Type @@ -33090,7 +33090,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_UINTPLTR, NPY_UINTP, NPY_BITSOF_INTP, _ALIGN(npy_uintp), + NPY_UINTPLTR, NPY_UINTP, NPY_BITSOF_INTP, NPY_ALIGNOF(npy_uintp), Py_BuildValue("N", PyLong_FromUnsignedLongLong((npy_ulonglong) NPY_MAX_UINTP)), Py_BuildValue("i", 0), &PyUIntpArrType_Type @@ -33111,7 +33111,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_LONGLTR, NPY_LONG, NPY_BITSOF_LONG, _ALIGN(npy_long), + NPY_LONGLTR, NPY_LONG, NPY_BITSOF_LONG, NPY_ALIGNOF(npy_long), Py_BuildValue("l", NPY_MAX_LONG), Py_BuildValue("l", NPY_MIN_LONG), &PyLongArrType_Type @@ -33132,7 +33132,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_ULONGLTR, NPY_ULONG, NPY_BITSOF_LONG, _ALIGN(npy_ulong), + NPY_ULONGLTR, NPY_ULONG, NPY_BITSOF_LONG, NPY_ALIGNOF(npy_ulong), Py_BuildValue("N", PyLong_FromUnsignedLong((npy_ulong) NPY_MAX_ULONG)), Py_BuildValue("i", 0), &PyULongArrType_Type @@ -33153,7 +33153,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_LONGLONGLTR, NPY_LONGLONG, NPY_BITSOF_LONGLONG, _ALIGN(npy_longlong), + NPY_LONGLONGLTR, NPY_LONGLONG, NPY_BITSOF_LONGLONG, NPY_ALIGNOF(npy_longlong), Py_BuildValue("N", PyLong_FromLongLong((npy_longlong) NPY_MAX_LONGLONG)), Py_BuildValue("N", PyLong_FromLongLong((npy_longlong) NPY_MIN_LONGLONG)), &PyLongLongArrType_Type @@ -33174,7 +33174,7 @@ set_typeinfo(PyObject *dict) #line 4816 s = PyArray_typeinforanged( - NPY_ULONGLONGLTR, NPY_ULONGLONG, NPY_BITSOF_LONGLONG, _ALIGN(npy_ulonglong), + NPY_ULONGLONGLTR, NPY_ULONGLONG, NPY_BITSOF_LONGLONG, NPY_ALIGNOF(npy_ulonglong), Py_BuildValue("N", PyLong_FromUnsignedLongLong((npy_ulonglong) NPY_MAX_ULONGLONG)), Py_BuildValue("i", 0), &PyULongLongArrType_Type @@ -33197,7 +33197,7 @@ set_typeinfo(PyObject *dict) #line 4847 s = PyArray_typeinfo( NPY_HALFLTR, NPY_HALF, NPY_BITSOF_HALF, - _ALIGN(npy_half), &PyHalfArrType_Type + NPY_ALIGNOF(npy_half), &PyHalfArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -33214,7 +33214,7 @@ set_typeinfo(PyObject *dict) #line 4847 s = PyArray_typeinfo( NPY_FLOATLTR, NPY_FLOAT, NPY_BITSOF_FLOAT, - _ALIGN(npy_float), &PyFloatArrType_Type + NPY_ALIGNOF(npy_float), &PyFloatArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -33231,7 +33231,7 @@ set_typeinfo(PyObject *dict) #line 4847 s = PyArray_typeinfo( NPY_DOUBLELTR, NPY_DOUBLE, NPY_BITSOF_DOUBLE, - _ALIGN(npy_double), &PyDoubleArrType_Type + NPY_ALIGNOF(npy_double), &PyDoubleArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -33248,7 +33248,7 @@ set_typeinfo(PyObject *dict) #line 4847 s = PyArray_typeinfo( NPY_LONGDOUBLELTR, NPY_LONGDOUBLE, NPY_BITSOF_LONGDOUBLE, - _ALIGN(npy_longdouble), &PyLongDoubleArrType_Type + NPY_ALIGNOF(npy_longdouble), &PyLongDoubleArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -33265,7 +33265,7 @@ set_typeinfo(PyObject *dict) #line 4847 s = PyArray_typeinfo( NPY_CFLOATLTR, NPY_CFLOAT, NPY_BITSOF_CFLOAT, - _ALIGN(npy_cfloat), &PyCFloatArrType_Type + NPY_ALIGNOF(npy_cfloat), &PyCFloatArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -33282,7 +33282,7 @@ set_typeinfo(PyObject *dict) #line 4847 s = PyArray_typeinfo( NPY_CDOUBLELTR, NPY_CDOUBLE, NPY_BITSOF_CDOUBLE, - _ALIGN(npy_cdouble), &PyCDoubleArrType_Type + NPY_ALIGNOF(npy_cdouble), &PyCDoubleArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -33299,7 +33299,7 @@ set_typeinfo(PyObject *dict) #line 4847 s = PyArray_typeinfo( NPY_CLONGDOUBLELTR, NPY_CLONGDOUBLE, NPY_BITSOF_CLONGDOUBLE, - _ALIGN(npy_clongdouble), &PyCLongDoubleArrType_Type + NPY_ALIGNOF(npy_clongdouble), &PyCLongDoubleArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -33316,7 +33316,7 @@ set_typeinfo(PyObject *dict) s = PyArray_typeinfo( NPY_OBJECTLTR, NPY_OBJECT, sizeof(PyObject *) * CHAR_BIT, - _ALIGN(PyObject *), + NPY_ALIGNOF(PyObject *), &PyObjectArrType_Type ); if (s == NULL) { @@ -33330,7 +33330,7 @@ set_typeinfo(PyObject *dict) return -1; } s = PyArray_typeinfo( - NPY_STRINGLTR, NPY_STRING, 0, _ALIGN(char), + NPY_STRINGLTR, NPY_STRING, 0, NPY_ALIGNOF(char), &PyStringArrType_Type ); if (s == NULL) { @@ -33344,7 +33344,7 @@ set_typeinfo(PyObject *dict) return -1; } s = PyArray_typeinfo( - NPY_UNICODELTR, NPY_UNICODE, 0, _ALIGN(npy_ucs4), + NPY_UNICODELTR, NPY_UNICODE, 0, NPY_ALIGNOF(npy_ucs4), &PyUnicodeArrType_Type ); if (s == NULL) { @@ -33358,7 +33358,7 @@ set_typeinfo(PyObject *dict) return -1; } s = PyArray_typeinfo( - NPY_VOIDLTR, NPY_VOID, 0, _ALIGN(char), + NPY_VOIDLTR, NPY_VOID, 0, NPY_ALIGNOF(char), &PyVoidArrType_Type ); if (s == NULL) { @@ -33373,7 +33373,7 @@ set_typeinfo(PyObject *dict) } s = PyArray_typeinforanged( NPY_DATETIMELTR, NPY_DATETIME, NPY_BITSOF_DATETIME, - _ALIGN(npy_datetime), + NPY_ALIGNOF(npy_datetime), MyPyLong_FromInt64(NPY_MAX_DATETIME), MyPyLong_FromInt64(NPY_MIN_DATETIME), &PyDatetimeArrType_Type @@ -33390,7 +33390,7 @@ set_typeinfo(PyObject *dict) } s = PyArray_typeinforanged( NPY_TIMEDELTALTR, NPY_TIMEDELTA, NPY_BITSOF_TIMEDELTA, - _ALIGN(npy_timedelta), + NPY_ALIGNOF(npy_timedelta), MyPyLong_FromInt64(NPY_MAX_TIMEDELTA), MyPyLong_FromInt64(NPY_MIN_TIMEDELTA), &PyTimedeltaArrType_Type diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c.src b/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c.src index b84625c776..bc3f743727 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c.src +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/arraytypes.c.src @@ -392,7 +392,7 @@ NPY_NO_EXPORT int return -1; } if (ap == NULL || PyArray_ISBEHAVED(ap)) { - assert(npy_is_aligned(ov, _ALIGN(@type@))); + assert(npy_is_aligned(ov, NPY_ALIGNOF(@type@))); *((@type@ *)ov)=temp; } else { @@ -809,7 +809,7 @@ STRING_setitem(PyObject *op, void *ov, void *vap) /* OBJECT */ -#define __ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0) +#define NPY__ALIGNED(obj, sz) ((((size_t) obj) % (sz))==0) static PyObject * OBJECT_getitem(void *ip, void *NPY_UNUSED(ap)) @@ -2426,10 +2426,10 @@ OBJECT_copyswapn(PyObject **dst, npy_intp dstride, PyObject **src, { npy_intp i; if (src != NULL) { - if (__ALIGNED(dst, sizeof(PyObject **)) - && __ALIGNED(src, sizeof(PyObject **)) - && __ALIGNED(dstride, sizeof(PyObject **)) - && __ALIGNED(sstride, sizeof(PyObject **))) { + if (NPY__ALIGNED(dst, sizeof(PyObject **)) + && NPY__ALIGNED(src, sizeof(PyObject **)) + && NPY__ALIGNED(dstride, sizeof(PyObject **)) + && NPY__ALIGNED(sstride, sizeof(PyObject **))) { dstride /= sizeof(PyObject **); sstride /= sizeof(PyObject **); for (i = 0; i < n; i++) { @@ -2466,8 +2466,8 @@ OBJECT_copyswap(PyObject **dst, PyObject **src, int NPY_UNUSED(swap), { if (src != NULL) { - if (__ALIGNED(dst,sizeof(PyObject **)) && - __ALIGNED(src,sizeof(PyObject **))) { + if (NPY__ALIGNED(dst,sizeof(PyObject **)) && + NPY__ALIGNED(src,sizeof(PyObject **))) { Py_XINCREF(*src); Py_XDECREF(*dst); *dst = *src; @@ -2927,7 +2927,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap) } dummy_fields.descr = new; - if ((new->alignment > 1) && !__ALIGNED(ip + offset, + if ((new->alignment > 1) && !NPY__ALIGNED(ip + offset, new->alignment)) { PyArray_CLEARFLAGS(dummy_arr, NPY_ARRAY_ALIGNED); } @@ -2952,7 +2952,7 @@ VOID_nonzero (char *ip, PyArrayObject *ap) return nonz; } -#undef __ALIGNED +#undef NPY__ALIGNED /* @@ -4326,7 +4326,7 @@ static PyArray_Descr @from@_Descr = { /* elsize */ 0, /* alignment */ - _ALIGN(@align@), + NPY_ALIGNOF(@align@), /* subarray */ NULL, /* fields */ @@ -4476,7 +4476,7 @@ NPY_NO_EXPORT PyArray_Descr @from@_Descr = { /* elsize */ sizeof(@fromtype@), /* alignment */ - _ALIGN(@fromtype@), + NPY_ALIGNOF(@fromtype@), /* subarray */ NULL, /* fields */ @@ -4815,7 +4815,7 @@ set_typeinfo(PyObject *dict) */ s = PyArray_typeinforanged( - NPY_@name@LTR, NPY_@name@, NPY_BITSOF_@uname@, _ALIGN(@type@), + NPY_@name@LTR, NPY_@name@, NPY_BITSOF_@uname@, NPY_ALIGNOF(@type@), Py_BuildValue("@cx@", @max@), Py_BuildValue("@cn@", @min@), &Py@Name@ArrType_Type @@ -4846,7 +4846,7 @@ set_typeinfo(PyObject *dict) */ s = PyArray_typeinfo( NPY_@name@LTR, NPY_@name@, NPY_BITSOF_@name@, - _ALIGN(@type@), &Py@Name@ArrType_Type + NPY_ALIGNOF(@type@), &Py@Name@ArrType_Type ); if (s == NULL) { Py_DECREF(infodict); @@ -4863,7 +4863,7 @@ set_typeinfo(PyObject *dict) s = PyArray_typeinfo( NPY_OBJECTLTR, NPY_OBJECT, sizeof(PyObject *) * CHAR_BIT, - _ALIGN(PyObject *), + NPY_ALIGNOF(PyObject *), &PyObjectArrType_Type ); if (s == NULL) { @@ -4877,7 +4877,7 @@ set_typeinfo(PyObject *dict) return -1; } s = PyArray_typeinfo( - NPY_STRINGLTR, NPY_STRING, 0, _ALIGN(char), + NPY_STRINGLTR, NPY_STRING, 0, NPY_ALIGNOF(char), &PyStringArrType_Type ); if (s == NULL) { @@ -4891,7 +4891,7 @@ set_typeinfo(PyObject *dict) return -1; } s = PyArray_typeinfo( - NPY_UNICODELTR, NPY_UNICODE, 0, _ALIGN(npy_ucs4), + NPY_UNICODELTR, NPY_UNICODE, 0, NPY_ALIGNOF(npy_ucs4), &PyUnicodeArrType_Type ); if (s == NULL) { @@ -4905,7 +4905,7 @@ set_typeinfo(PyObject *dict) return -1; } s = PyArray_typeinfo( - NPY_VOIDLTR, NPY_VOID, 0, _ALIGN(char), + NPY_VOIDLTR, NPY_VOID, 0, NPY_ALIGNOF(char), &PyVoidArrType_Type ); if (s == NULL) { @@ -4920,7 +4920,7 @@ set_typeinfo(PyObject *dict) } s = PyArray_typeinforanged( NPY_DATETIMELTR, NPY_DATETIME, NPY_BITSOF_DATETIME, - _ALIGN(npy_datetime), + NPY_ALIGNOF(npy_datetime), MyPyLong_FromInt64(NPY_MAX_DATETIME), MyPyLong_FromInt64(NPY_MIN_DATETIME), &PyDatetimeArrType_Type @@ -4937,7 +4937,7 @@ set_typeinfo(PyObject *dict) } s = PyArray_typeinforanged( NPY_TIMEDELTALTR, NPY_TIMEDELTA, NPY_BITSOF_TIMEDELTA, - _ALIGN(npy_timedelta), + NPY_ALIGNOF(npy_timedelta), MyPyLong_FromInt64(NPY_MAX_TIMEDELTA), MyPyLong_FromInt64(NPY_MIN_TIMEDELTA), &PyTimedeltaArrType_Type diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/common.h b/contrib/python/numpy/py3/numpy/core/src/multiarray/common.h index cb9fadc4e9..b9d2b69e30 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/common.h +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/common.h @@ -175,7 +175,7 @@ check_and_adjust_axis(int *axis, int ndim) } /* used for some alignment checks */ -/* +/* * GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 * <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. * clang versions < 8.0.0 have the same bug. @@ -184,11 +184,11 @@ check_and_adjust_axis(int *axis, int ndim) || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ && !defined __clang__) \ || (defined __clang__ && __clang_major__ < 8)) -# define _ALIGN(type) offsetof(struct {char c; type v;}, v) +# define NPY_ALIGNOF(type) offsetof(struct {char c; type v;}, v) #else -# define _ALIGN(type) _Alignof(type) +# define NPY_ALIGNOF(type) _Alignof(type) #endif -#define _UINT_ALIGN(type) npy_uint_alignment(sizeof(type)) +#define NPY_ALIGNOF_UINT(type) npy_uint_alignment(sizeof(type)) /* * Disable harmless compiler warning "4116: unnamed type definition in * parentheses" which is caused by the _ALIGN macro. @@ -223,20 +223,20 @@ npy_uint_alignment(int itemsize) case 1: return 1; case 2: - alignment = _ALIGN(npy_uint16); + alignment = NPY_ALIGNOF(npy_uint16); break; case 4: - alignment = _ALIGN(npy_uint32); + alignment = NPY_ALIGNOF(npy_uint32); break; case 8: - alignment = _ALIGN(npy_uint64); + alignment = NPY_ALIGNOF(npy_uint64); break; case 16: /* * 16 byte types are copied using 2 uint64 assignments. * See the strided copy function in lowlevel_strided_loops.c. */ - alignment = _ALIGN(npy_uint64); + alignment = NPY_ALIGNOF(npy_uint64); break; default: break; diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/compiled_base.c b/contrib/python/numpy/py3/numpy/core/src/multiarray/compiled_base.c index d2395c5bf4..f2e7d3f345 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/compiled_base.c +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/compiled_base.c @@ -1412,7 +1412,18 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *const *args, Py_ssize_t static char *msg = "already has a different docstring"; /* Don't add docstrings */ +#if PY_VERSION_HEX > 0x030b0000 + static long optimize = -1000; + if (optimize < 0) { + PyObject *flags = PySys_GetObject("flags"); /* borrowed object */ + PyObject *level = PyObject_GetAttrString(flags, "optimize"); + optimize = PyLong_AsLong(level); + Py_DECREF(level); + } + if (optimize > 1) { +#else if (Py_OptimizeFlag > 1) { +#endif Py_RETURN_NONE; } diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/descriptor.c b/contrib/python/numpy/py3/numpy/core/src/multiarray/descriptor.c index 68d398d648..f8712d4d3b 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/descriptor.c +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/descriptor.c @@ -1478,6 +1478,11 @@ PyArray_DTypeOrDescrConverterRequired(PyObject *obj, npy_dtype_info *dt_info) dt_info->descr = NULL; if (PyObject_TypeCheck(obj, &PyArrayDTypeMeta_Type)) { + if (obj == (PyObject *)&PyArrayDescr_Type) { + PyErr_SetString(PyExc_TypeError, + "Cannot convert np.dtype into a dtype."); + return NPY_FAIL; + } Py_INCREF(obj); dt_info->dtype = (PyArray_DTypeMeta *)obj; dt_info->descr = NULL; diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/item_selection.c b/contrib/python/numpy/py3/numpy/core/src/multiarray/item_selection.c index 625c649335..e63edf9d06 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/item_selection.c +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/item_selection.c @@ -968,6 +968,7 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out, PyArrayObject **mps, *ap; PyArrayMultiIterObject *multi = NULL; npy_intp mi; + NPY_cast_info cast_info = {.func = NULL}; ap = NULL; /* @@ -993,9 +994,10 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out, if (multi == NULL) { goto fail; } + dtype = PyArray_DESCR(mps[0]); + /* Set-up return array */ if (out == NULL) { - dtype = PyArray_DESCR(mps[0]); Py_INCREF(dtype); obj = (PyArrayObject *)PyArray_NewFromDescr(Py_TYPE(ap), dtype, @@ -1032,7 +1034,6 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out, */ flags |= NPY_ARRAY_ENSURECOPY; } - dtype = PyArray_DESCR(mps[0]); Py_INCREF(dtype); obj = (PyArrayObject *)PyArray_FromArray(out, dtype, flags); } @@ -1040,8 +1041,21 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out, if (obj == NULL) { goto fail; } - elsize = PyArray_DESCR(obj)->elsize; + elsize = dtype->elsize; ret_data = PyArray_DATA(obj); + npy_intp transfer_strides[2] = {elsize, elsize}; + npy_intp one = 1; + NPY_ARRAYMETHOD_FLAGS transfer_flags = 0; + if (PyDataType_REFCHK(dtype)) { + int is_aligned = IsUintAligned(obj); + PyArray_GetDTypeTransferFunction( + is_aligned, + dtype->elsize, + dtype->elsize, + dtype, + dtype, 0, &cast_info, + &transfer_flags); + } while (PyArray_MultiIter_NOTDONE(multi)) { mi = *((npy_intp *)PyArray_MultiIter_DATA(multi, n)); @@ -1074,12 +1088,22 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out, break; } } - memmove(ret_data, PyArray_MultiIter_DATA(multi, mi), elsize); + if (cast_info.func == NULL) { + /* We ensure memory doesn't overlap, so can use memcpy */ + memcpy(ret_data, PyArray_MultiIter_DATA(multi, mi), elsize); + } + else { + char *args[2] = {PyArray_MultiIter_DATA(multi, mi), ret_data}; + if (cast_info.func(&cast_info.context, args, &one, + transfer_strides, cast_info.auxdata) < 0) { + goto fail; + } + } ret_data += elsize; PyArray_MultiIter_NEXT(multi); } - PyArray_INCREF(obj); + NPY_cast_info_xfree(&cast_info); Py_DECREF(multi); for (i = 0; i < n; i++) { Py_XDECREF(mps[i]); @@ -1095,6 +1119,7 @@ PyArray_Choose(PyArrayObject *ip, PyObject *op, PyArrayObject *out, return (PyObject *)obj; fail: + NPY_cast_info_xfree(&cast_info); Py_XDECREF(multi); for (i = 0; i < n; i++) { Py_XDECREF(mps[i]); diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c b/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c index 309ef1b89c..4dd3622ee1 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c @@ -128,8 +128,8 @@ _strided_to_strided_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _strided_to_strided_size1\n");*/ while (N > 0) { @@ -214,8 +214,8 @@ _strided_to_strided_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -291,8 +291,8 @@ _aligned_strided_to_strided_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_strided_to_strided_size1\n");*/ while (N > 0) { @@ -377,8 +377,8 @@ _aligned_strided_to_strided_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -454,8 +454,8 @@ _swap_strided_to_strided_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_strided_to_strided_size1\n");*/ while (N > 0) { @@ -540,8 +540,8 @@ _swap_strided_to_strided_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -617,8 +617,8 @@ _aligned_swap_strided_to_strided_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_strided_to_strided_size1\n");*/ while (N > 0) { @@ -703,8 +703,8 @@ _aligned_swap_strided_to_strided_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -780,8 +780,8 @@ _swap_pair_strided_to_strided_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_pair_strided_to_strided_size1\n");*/ while (N > 0) { @@ -866,8 +866,8 @@ _swap_pair_strided_to_strided_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -943,8 +943,8 @@ _aligned_swap_pair_strided_to_strided_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_pair_strided_to_strided_size1\n");*/ while (N > 0) { @@ -1029,8 +1029,8 @@ _aligned_swap_pair_strided_to_strided_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -1108,8 +1108,8 @@ _strided_to_contig_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _strided_to_contig_size1\n");*/ while (N > 0) { @@ -1194,8 +1194,8 @@ _strided_to_contig_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -1271,8 +1271,8 @@ _aligned_strided_to_contig_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_strided_to_contig_size1\n");*/ while (N > 0) { @@ -1357,8 +1357,8 @@ _aligned_strided_to_contig_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -1434,8 +1434,8 @@ _swap_strided_to_contig_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_strided_to_contig_size1\n");*/ while (N > 0) { @@ -1520,8 +1520,8 @@ _swap_strided_to_contig_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -1597,8 +1597,8 @@ _aligned_swap_strided_to_contig_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_strided_to_contig_size1\n");*/ while (N > 0) { @@ -1683,8 +1683,8 @@ _aligned_swap_strided_to_contig_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -1760,8 +1760,8 @@ _swap_pair_strided_to_contig_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_pair_strided_to_contig_size1\n");*/ while (N > 0) { @@ -1846,8 +1846,8 @@ _swap_pair_strided_to_contig_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -1923,8 +1923,8 @@ _aligned_swap_pair_strided_to_contig_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_pair_strided_to_contig_size1\n");*/ while (N > 0) { @@ -2009,8 +2009,8 @@ _aligned_swap_pair_strided_to_contig_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -2088,8 +2088,8 @@ _contig_to_strided_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _contig_to_strided_size1\n");*/ while (N > 0) { @@ -2174,8 +2174,8 @@ _contig_to_strided_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -2251,8 +2251,8 @@ _aligned_contig_to_strided_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_contig_to_strided_size1\n");*/ while (N > 0) { @@ -2337,8 +2337,8 @@ _aligned_contig_to_strided_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -2414,8 +2414,8 @@ _swap_contig_to_strided_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_contig_to_strided_size1\n");*/ while (N > 0) { @@ -2500,8 +2500,8 @@ _swap_contig_to_strided_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -2577,8 +2577,8 @@ _aligned_swap_contig_to_strided_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_contig_to_strided_size1\n");*/ while (N > 0) { @@ -2663,8 +2663,8 @@ _aligned_swap_contig_to_strided_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -2740,8 +2740,8 @@ _swap_pair_contig_to_strided_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_pair_contig_to_strided_size1\n");*/ while (N > 0) { @@ -2826,8 +2826,8 @@ _swap_pair_contig_to_strided_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -2903,8 +2903,8 @@ _aligned_swap_pair_contig_to_strided_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_pair_contig_to_strided_size1\n");*/ while (N > 0) { @@ -2989,8 +2989,8 @@ _aligned_swap_pair_contig_to_strided_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 0 memset(dst, *src, N); @@ -3068,8 +3068,8 @@ _contig_to_contig_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _contig_to_contig_size1\n");*/ while (N > 0) { @@ -3154,8 +3154,8 @@ _contig_to_contig_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -3231,8 +3231,8 @@ _aligned_contig_to_contig_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_contig_to_contig_size1\n");*/ while (N > 0) { @@ -3317,8 +3317,8 @@ _aligned_contig_to_contig_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -3394,8 +3394,8 @@ _swap_contig_to_contig_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_contig_to_contig_size1\n");*/ while (N > 0) { @@ -3480,8 +3480,8 @@ _swap_contig_to_contig_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -3557,8 +3557,8 @@ _aligned_swap_contig_to_contig_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_contig_to_contig_size1\n");*/ while (N > 0) { @@ -3643,8 +3643,8 @@ _aligned_swap_contig_to_contig_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -3720,8 +3720,8 @@ _swap_pair_contig_to_contig_size1( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _swap_pair_contig_to_contig_size1\n");*/ while (N > 0) { @@ -3806,8 +3806,8 @@ _swap_pair_contig_to_contig_size1_srcstride0( } #if 0 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -3883,8 +3883,8 @@ _aligned_swap_pair_contig_to_contig_size1( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif /*printf("fn _aligned_swap_pair_contig_to_contig_size1\n");*/ while (N > 0) { @@ -3969,8 +3969,8 @@ _aligned_swap_pair_contig_to_contig_size1_srcstride0( } #if 1 && 1 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint8))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint8))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint8))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint8))); #endif #if 1 == 1 && 1 memset(dst, *src, N); @@ -4050,8 +4050,8 @@ _strided_to_strided_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _strided_to_strided_size2\n");*/ while (N > 0) { @@ -4136,8 +4136,8 @@ _strided_to_strided_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -4213,8 +4213,8 @@ _aligned_strided_to_strided_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_strided_to_strided_size2\n");*/ while (N > 0) { @@ -4299,8 +4299,8 @@ _aligned_strided_to_strided_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -4376,8 +4376,8 @@ _swap_strided_to_strided_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_strided_to_strided_size2\n");*/ while (N > 0) { @@ -4462,8 +4462,8 @@ _swap_strided_to_strided_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -4539,8 +4539,8 @@ _aligned_swap_strided_to_strided_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_strided_to_strided_size2\n");*/ while (N > 0) { @@ -4625,8 +4625,8 @@ _aligned_swap_strided_to_strided_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -4702,8 +4702,8 @@ _swap_pair_strided_to_strided_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_pair_strided_to_strided_size2\n");*/ while (N > 0) { @@ -4788,8 +4788,8 @@ _swap_pair_strided_to_strided_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -4865,8 +4865,8 @@ _aligned_swap_pair_strided_to_strided_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_pair_strided_to_strided_size2\n");*/ while (N > 0) { @@ -4951,8 +4951,8 @@ _aligned_swap_pair_strided_to_strided_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -5030,8 +5030,8 @@ _strided_to_contig_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _strided_to_contig_size2\n");*/ while (N > 0) { @@ -5116,8 +5116,8 @@ _strided_to_contig_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -5193,8 +5193,8 @@ _aligned_strided_to_contig_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_strided_to_contig_size2\n");*/ while (N > 0) { @@ -5279,8 +5279,8 @@ _aligned_strided_to_contig_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -5356,8 +5356,8 @@ _swap_strided_to_contig_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_strided_to_contig_size2\n");*/ while (N > 0) { @@ -5442,8 +5442,8 @@ _swap_strided_to_contig_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -5519,8 +5519,8 @@ _aligned_swap_strided_to_contig_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_strided_to_contig_size2\n");*/ while (N > 0) { @@ -5605,8 +5605,8 @@ _aligned_swap_strided_to_contig_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -5682,8 +5682,8 @@ _swap_pair_strided_to_contig_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_pair_strided_to_contig_size2\n");*/ while (N > 0) { @@ -5768,8 +5768,8 @@ _swap_pair_strided_to_contig_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -5845,8 +5845,8 @@ _aligned_swap_pair_strided_to_contig_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_pair_strided_to_contig_size2\n");*/ while (N > 0) { @@ -5931,8 +5931,8 @@ _aligned_swap_pair_strided_to_contig_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -6010,8 +6010,8 @@ _contig_to_strided_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _contig_to_strided_size2\n");*/ while (N > 0) { @@ -6096,8 +6096,8 @@ _contig_to_strided_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -6173,8 +6173,8 @@ _aligned_contig_to_strided_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_contig_to_strided_size2\n");*/ while (N > 0) { @@ -6259,8 +6259,8 @@ _aligned_contig_to_strided_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -6336,8 +6336,8 @@ _swap_contig_to_strided_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_contig_to_strided_size2\n");*/ while (N > 0) { @@ -6422,8 +6422,8 @@ _swap_contig_to_strided_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -6499,8 +6499,8 @@ _aligned_swap_contig_to_strided_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_contig_to_strided_size2\n");*/ while (N > 0) { @@ -6585,8 +6585,8 @@ _aligned_swap_contig_to_strided_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -6662,8 +6662,8 @@ _swap_pair_contig_to_strided_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_pair_contig_to_strided_size2\n");*/ while (N > 0) { @@ -6748,8 +6748,8 @@ _swap_pair_contig_to_strided_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -6825,8 +6825,8 @@ _aligned_swap_pair_contig_to_strided_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_pair_contig_to_strided_size2\n");*/ while (N > 0) { @@ -6911,8 +6911,8 @@ _aligned_swap_pair_contig_to_strided_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 0 memset(dst, *src, N); @@ -6990,8 +6990,8 @@ _contig_to_contig_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _contig_to_contig_size2\n");*/ while (N > 0) { @@ -7076,8 +7076,8 @@ _contig_to_contig_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -7153,8 +7153,8 @@ _aligned_contig_to_contig_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_contig_to_contig_size2\n");*/ while (N > 0) { @@ -7239,8 +7239,8 @@ _aligned_contig_to_contig_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -7316,8 +7316,8 @@ _swap_contig_to_contig_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_contig_to_contig_size2\n");*/ while (N > 0) { @@ -7402,8 +7402,8 @@ _swap_contig_to_contig_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -7479,8 +7479,8 @@ _aligned_swap_contig_to_contig_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_contig_to_contig_size2\n");*/ while (N > 0) { @@ -7565,8 +7565,8 @@ _aligned_swap_contig_to_contig_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -7642,8 +7642,8 @@ _swap_pair_contig_to_contig_size2( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _swap_pair_contig_to_contig_size2\n");*/ while (N > 0) { @@ -7728,8 +7728,8 @@ _swap_pair_contig_to_contig_size2_srcstride0( } #if 0 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -7805,8 +7805,8 @@ _aligned_swap_pair_contig_to_contig_size2( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif /*printf("fn _aligned_swap_pair_contig_to_contig_size2\n");*/ while (N > 0) { @@ -7891,8 +7891,8 @@ _aligned_swap_pair_contig_to_contig_size2_srcstride0( } #if 1 && 2 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint16))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint16))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint16))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint16))); #endif #if 2 == 1 && 1 memset(dst, *src, N); @@ -7972,8 +7972,8 @@ _strided_to_strided_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _strided_to_strided_size4\n");*/ while (N > 0) { @@ -8058,8 +8058,8 @@ _strided_to_strided_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -8135,8 +8135,8 @@ _aligned_strided_to_strided_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_strided_to_strided_size4\n");*/ while (N > 0) { @@ -8221,8 +8221,8 @@ _aligned_strided_to_strided_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -8298,8 +8298,8 @@ _swap_strided_to_strided_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_strided_to_strided_size4\n");*/ while (N > 0) { @@ -8384,8 +8384,8 @@ _swap_strided_to_strided_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -8461,8 +8461,8 @@ _aligned_swap_strided_to_strided_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_strided_to_strided_size4\n");*/ while (N > 0) { @@ -8547,8 +8547,8 @@ _aligned_swap_strided_to_strided_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -8624,8 +8624,8 @@ _swap_pair_strided_to_strided_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_pair_strided_to_strided_size4\n");*/ while (N > 0) { @@ -8710,8 +8710,8 @@ _swap_pair_strided_to_strided_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -8787,8 +8787,8 @@ _aligned_swap_pair_strided_to_strided_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_pair_strided_to_strided_size4\n");*/ while (N > 0) { @@ -8873,8 +8873,8 @@ _aligned_swap_pair_strided_to_strided_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -8952,8 +8952,8 @@ _strided_to_contig_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _strided_to_contig_size4\n");*/ while (N > 0) { @@ -9038,8 +9038,8 @@ _strided_to_contig_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -9115,8 +9115,8 @@ _aligned_strided_to_contig_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_strided_to_contig_size4\n");*/ while (N > 0) { @@ -9201,8 +9201,8 @@ _aligned_strided_to_contig_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -9278,8 +9278,8 @@ _swap_strided_to_contig_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_strided_to_contig_size4\n");*/ while (N > 0) { @@ -9364,8 +9364,8 @@ _swap_strided_to_contig_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -9441,8 +9441,8 @@ _aligned_swap_strided_to_contig_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_strided_to_contig_size4\n");*/ while (N > 0) { @@ -9527,8 +9527,8 @@ _aligned_swap_strided_to_contig_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -9604,8 +9604,8 @@ _swap_pair_strided_to_contig_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_pair_strided_to_contig_size4\n");*/ while (N > 0) { @@ -9690,8 +9690,8 @@ _swap_pair_strided_to_contig_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -9767,8 +9767,8 @@ _aligned_swap_pair_strided_to_contig_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_pair_strided_to_contig_size4\n");*/ while (N > 0) { @@ -9853,8 +9853,8 @@ _aligned_swap_pair_strided_to_contig_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -9932,8 +9932,8 @@ _contig_to_strided_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _contig_to_strided_size4\n");*/ while (N > 0) { @@ -10018,8 +10018,8 @@ _contig_to_strided_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -10095,8 +10095,8 @@ _aligned_contig_to_strided_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_contig_to_strided_size4\n");*/ while (N > 0) { @@ -10181,8 +10181,8 @@ _aligned_contig_to_strided_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -10258,8 +10258,8 @@ _swap_contig_to_strided_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_contig_to_strided_size4\n");*/ while (N > 0) { @@ -10344,8 +10344,8 @@ _swap_contig_to_strided_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -10421,8 +10421,8 @@ _aligned_swap_contig_to_strided_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_contig_to_strided_size4\n");*/ while (N > 0) { @@ -10507,8 +10507,8 @@ _aligned_swap_contig_to_strided_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -10584,8 +10584,8 @@ _swap_pair_contig_to_strided_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_pair_contig_to_strided_size4\n");*/ while (N > 0) { @@ -10670,8 +10670,8 @@ _swap_pair_contig_to_strided_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -10747,8 +10747,8 @@ _aligned_swap_pair_contig_to_strided_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_pair_contig_to_strided_size4\n");*/ while (N > 0) { @@ -10833,8 +10833,8 @@ _aligned_swap_pair_contig_to_strided_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 0 memset(dst, *src, N); @@ -10912,8 +10912,8 @@ _contig_to_contig_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _contig_to_contig_size4\n");*/ while (N > 0) { @@ -10998,8 +10998,8 @@ _contig_to_contig_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -11075,8 +11075,8 @@ _aligned_contig_to_contig_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_contig_to_contig_size4\n");*/ while (N > 0) { @@ -11161,8 +11161,8 @@ _aligned_contig_to_contig_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -11238,8 +11238,8 @@ _swap_contig_to_contig_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_contig_to_contig_size4\n");*/ while (N > 0) { @@ -11324,8 +11324,8 @@ _swap_contig_to_contig_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -11401,8 +11401,8 @@ _aligned_swap_contig_to_contig_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_contig_to_contig_size4\n");*/ while (N > 0) { @@ -11487,8 +11487,8 @@ _aligned_swap_contig_to_contig_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -11564,8 +11564,8 @@ _swap_pair_contig_to_contig_size4( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _swap_pair_contig_to_contig_size4\n");*/ while (N > 0) { @@ -11650,8 +11650,8 @@ _swap_pair_contig_to_contig_size4_srcstride0( } #if 0 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -11727,8 +11727,8 @@ _aligned_swap_pair_contig_to_contig_size4( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif /*printf("fn _aligned_swap_pair_contig_to_contig_size4\n");*/ while (N > 0) { @@ -11813,8 +11813,8 @@ _aligned_swap_pair_contig_to_contig_size4_srcstride0( } #if 1 && 4 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint32))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint32))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint32))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint32))); #endif #if 4 == 1 && 1 memset(dst, *src, N); @@ -11894,8 +11894,8 @@ _strided_to_strided_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _strided_to_strided_size8\n");*/ while (N > 0) { @@ -11980,8 +11980,8 @@ _strided_to_strided_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -12057,8 +12057,8 @@ _aligned_strided_to_strided_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_strided_to_strided_size8\n");*/ while (N > 0) { @@ -12143,8 +12143,8 @@ _aligned_strided_to_strided_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -12220,8 +12220,8 @@ _swap_strided_to_strided_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_strided_to_strided_size8\n");*/ while (N > 0) { @@ -12306,8 +12306,8 @@ _swap_strided_to_strided_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -12383,8 +12383,8 @@ _aligned_swap_strided_to_strided_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_strided_to_strided_size8\n");*/ while (N > 0) { @@ -12469,8 +12469,8 @@ _aligned_swap_strided_to_strided_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -12546,8 +12546,8 @@ _swap_pair_strided_to_strided_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_strided_to_strided_size8\n");*/ while (N > 0) { @@ -12632,8 +12632,8 @@ _swap_pair_strided_to_strided_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -12709,8 +12709,8 @@ _aligned_swap_pair_strided_to_strided_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_strided_to_strided_size8\n");*/ while (N > 0) { @@ -12795,8 +12795,8 @@ _aligned_swap_pair_strided_to_strided_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -12874,8 +12874,8 @@ _strided_to_contig_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _strided_to_contig_size8\n");*/ while (N > 0) { @@ -12960,8 +12960,8 @@ _strided_to_contig_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -13037,8 +13037,8 @@ _aligned_strided_to_contig_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_strided_to_contig_size8\n");*/ while (N > 0) { @@ -13123,8 +13123,8 @@ _aligned_strided_to_contig_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -13200,8 +13200,8 @@ _swap_strided_to_contig_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_strided_to_contig_size8\n");*/ while (N > 0) { @@ -13286,8 +13286,8 @@ _swap_strided_to_contig_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -13363,8 +13363,8 @@ _aligned_swap_strided_to_contig_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_strided_to_contig_size8\n");*/ while (N > 0) { @@ -13449,8 +13449,8 @@ _aligned_swap_strided_to_contig_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -13526,8 +13526,8 @@ _swap_pair_strided_to_contig_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_strided_to_contig_size8\n");*/ while (N > 0) { @@ -13612,8 +13612,8 @@ _swap_pair_strided_to_contig_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -13689,8 +13689,8 @@ _aligned_swap_pair_strided_to_contig_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_strided_to_contig_size8\n");*/ while (N > 0) { @@ -13775,8 +13775,8 @@ _aligned_swap_pair_strided_to_contig_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -13854,8 +13854,8 @@ _contig_to_strided_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _contig_to_strided_size8\n");*/ while (N > 0) { @@ -13940,8 +13940,8 @@ _contig_to_strided_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -14017,8 +14017,8 @@ _aligned_contig_to_strided_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_contig_to_strided_size8\n");*/ while (N > 0) { @@ -14103,8 +14103,8 @@ _aligned_contig_to_strided_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -14180,8 +14180,8 @@ _swap_contig_to_strided_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_contig_to_strided_size8\n");*/ while (N > 0) { @@ -14266,8 +14266,8 @@ _swap_contig_to_strided_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -14343,8 +14343,8 @@ _aligned_swap_contig_to_strided_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_contig_to_strided_size8\n");*/ while (N > 0) { @@ -14429,8 +14429,8 @@ _aligned_swap_contig_to_strided_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -14506,8 +14506,8 @@ _swap_pair_contig_to_strided_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_contig_to_strided_size8\n");*/ while (N > 0) { @@ -14592,8 +14592,8 @@ _swap_pair_contig_to_strided_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -14669,8 +14669,8 @@ _aligned_swap_pair_contig_to_strided_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_contig_to_strided_size8\n");*/ while (N > 0) { @@ -14755,8 +14755,8 @@ _aligned_swap_pair_contig_to_strided_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 0 memset(dst, *src, N); @@ -14834,8 +14834,8 @@ _contig_to_contig_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _contig_to_contig_size8\n");*/ while (N > 0) { @@ -14920,8 +14920,8 @@ _contig_to_contig_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -14997,8 +14997,8 @@ _aligned_contig_to_contig_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_contig_to_contig_size8\n");*/ while (N > 0) { @@ -15083,8 +15083,8 @@ _aligned_contig_to_contig_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -15160,8 +15160,8 @@ _swap_contig_to_contig_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_contig_to_contig_size8\n");*/ while (N > 0) { @@ -15246,8 +15246,8 @@ _swap_contig_to_contig_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -15323,8 +15323,8 @@ _aligned_swap_contig_to_contig_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_contig_to_contig_size8\n");*/ while (N > 0) { @@ -15409,8 +15409,8 @@ _aligned_swap_contig_to_contig_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -15486,8 +15486,8 @@ _swap_pair_contig_to_contig_size8( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_contig_to_contig_size8\n");*/ while (N > 0) { @@ -15572,8 +15572,8 @@ _swap_pair_contig_to_contig_size8_srcstride0( } #if 0 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -15649,8 +15649,8 @@ _aligned_swap_pair_contig_to_contig_size8( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_contig_to_contig_size8\n");*/ while (N > 0) { @@ -15735,8 +15735,8 @@ _aligned_swap_pair_contig_to_contig_size8_srcstride0( } #if 1 && 8 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 8 == 1 && 1 memset(dst, *src, N); @@ -15816,8 +15816,8 @@ _strided_to_strided_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _strided_to_strided_size16\n");*/ while (N > 0) { @@ -15902,8 +15902,8 @@ _strided_to_strided_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -15979,8 +15979,8 @@ _aligned_strided_to_strided_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_strided_to_strided_size16\n");*/ while (N > 0) { @@ -16065,8 +16065,8 @@ _aligned_strided_to_strided_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -16142,8 +16142,8 @@ _swap_strided_to_strided_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_strided_to_strided_size16\n");*/ while (N > 0) { @@ -16228,8 +16228,8 @@ _swap_strided_to_strided_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -16305,8 +16305,8 @@ _aligned_swap_strided_to_strided_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_strided_to_strided_size16\n");*/ while (N > 0) { @@ -16391,8 +16391,8 @@ _aligned_swap_strided_to_strided_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -16468,8 +16468,8 @@ _swap_pair_strided_to_strided_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_strided_to_strided_size16\n");*/ while (N > 0) { @@ -16554,8 +16554,8 @@ _swap_pair_strided_to_strided_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -16631,8 +16631,8 @@ _aligned_swap_pair_strided_to_strided_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_strided_to_strided_size16\n");*/ while (N > 0) { @@ -16717,8 +16717,8 @@ _aligned_swap_pair_strided_to_strided_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -16796,8 +16796,8 @@ _strided_to_contig_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _strided_to_contig_size16\n");*/ while (N > 0) { @@ -16882,8 +16882,8 @@ _strided_to_contig_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -16959,8 +16959,8 @@ _aligned_strided_to_contig_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_strided_to_contig_size16\n");*/ while (N > 0) { @@ -17045,8 +17045,8 @@ _aligned_strided_to_contig_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -17122,8 +17122,8 @@ _swap_strided_to_contig_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_strided_to_contig_size16\n");*/ while (N > 0) { @@ -17208,8 +17208,8 @@ _swap_strided_to_contig_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -17285,8 +17285,8 @@ _aligned_swap_strided_to_contig_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_strided_to_contig_size16\n");*/ while (N > 0) { @@ -17371,8 +17371,8 @@ _aligned_swap_strided_to_contig_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -17448,8 +17448,8 @@ _swap_pair_strided_to_contig_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_strided_to_contig_size16\n");*/ while (N > 0) { @@ -17534,8 +17534,8 @@ _swap_pair_strided_to_contig_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -17611,8 +17611,8 @@ _aligned_swap_pair_strided_to_contig_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_strided_to_contig_size16\n");*/ while (N > 0) { @@ -17697,8 +17697,8 @@ _aligned_swap_pair_strided_to_contig_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -17776,8 +17776,8 @@ _contig_to_strided_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _contig_to_strided_size16\n");*/ while (N > 0) { @@ -17862,8 +17862,8 @@ _contig_to_strided_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -17939,8 +17939,8 @@ _aligned_contig_to_strided_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_contig_to_strided_size16\n");*/ while (N > 0) { @@ -18025,8 +18025,8 @@ _aligned_contig_to_strided_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -18102,8 +18102,8 @@ _swap_contig_to_strided_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_contig_to_strided_size16\n");*/ while (N > 0) { @@ -18188,8 +18188,8 @@ _swap_contig_to_strided_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -18265,8 +18265,8 @@ _aligned_swap_contig_to_strided_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_contig_to_strided_size16\n");*/ while (N > 0) { @@ -18351,8 +18351,8 @@ _aligned_swap_contig_to_strided_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -18428,8 +18428,8 @@ _swap_pair_contig_to_strided_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_contig_to_strided_size16\n");*/ while (N > 0) { @@ -18514,8 +18514,8 @@ _swap_pair_contig_to_strided_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -18591,8 +18591,8 @@ _aligned_swap_pair_contig_to_strided_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_contig_to_strided_size16\n");*/ while (N > 0) { @@ -18677,8 +18677,8 @@ _aligned_swap_pair_contig_to_strided_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 0 memset(dst, *src, N); @@ -18756,8 +18756,8 @@ _contig_to_contig_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _contig_to_contig_size16\n");*/ while (N > 0) { @@ -18842,8 +18842,8 @@ _contig_to_contig_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -18919,8 +18919,8 @@ _aligned_contig_to_contig_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_contig_to_contig_size16\n");*/ while (N > 0) { @@ -19005,8 +19005,8 @@ _aligned_contig_to_contig_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -19082,8 +19082,8 @@ _swap_contig_to_contig_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_contig_to_contig_size16\n");*/ while (N > 0) { @@ -19168,8 +19168,8 @@ _swap_contig_to_contig_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -19245,8 +19245,8 @@ _aligned_swap_contig_to_contig_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_contig_to_contig_size16\n");*/ while (N > 0) { @@ -19331,8 +19331,8 @@ _aligned_swap_contig_to_contig_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -19408,8 +19408,8 @@ _swap_pair_contig_to_contig_size16( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _swap_pair_contig_to_contig_size16\n");*/ while (N > 0) { @@ -19494,8 +19494,8 @@ _swap_pair_contig_to_contig_size16_srcstride0( } #if 0 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -19571,8 +19571,8 @@ _aligned_swap_pair_contig_to_contig_size16( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif /*printf("fn _aligned_swap_pair_contig_to_contig_size16\n");*/ while (N > 0) { @@ -19657,8 +19657,8 @@ _aligned_swap_pair_contig_to_contig_size16_srcstride0( } #if 1 && 16 != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(npy_uint64))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(npy_uint64))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(npy_uint64))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(npy_uint64))); #endif #if 16 == 1 && 1 memset(dst, *src, N); @@ -20853,8 +20853,8 @@ _aligned_cast_bool_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_bool\n");*/ @@ -21023,8 +21023,8 @@ _cast_bool_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_bool\n");*/ @@ -21193,8 +21193,8 @@ _aligned_contig_cast_bool_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_bool\n");*/ @@ -21363,8 +21363,8 @@ _contig_cast_bool_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_bool\n");*/ @@ -21537,8 +21537,8 @@ _aligned_cast_bool_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_ubyte\n");*/ @@ -21707,8 +21707,8 @@ _cast_bool_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_ubyte\n");*/ @@ -21877,8 +21877,8 @@ _aligned_contig_cast_bool_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_ubyte\n");*/ @@ -22047,8 +22047,8 @@ _contig_cast_bool_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_ubyte\n");*/ @@ -22221,8 +22221,8 @@ _aligned_cast_bool_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_ushort\n");*/ @@ -22391,8 +22391,8 @@ _cast_bool_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_ushort\n");*/ @@ -22561,8 +22561,8 @@ _aligned_contig_cast_bool_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_ushort\n");*/ @@ -22731,8 +22731,8 @@ _contig_cast_bool_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_ushort\n");*/ @@ -22905,8 +22905,8 @@ _aligned_cast_bool_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_uint\n");*/ @@ -23075,8 +23075,8 @@ _cast_bool_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_uint\n");*/ @@ -23245,8 +23245,8 @@ _aligned_contig_cast_bool_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_uint\n");*/ @@ -23415,8 +23415,8 @@ _contig_cast_bool_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_uint\n");*/ @@ -23589,8 +23589,8 @@ _aligned_cast_bool_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_ulong\n");*/ @@ -23759,8 +23759,8 @@ _cast_bool_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_ulong\n");*/ @@ -23929,8 +23929,8 @@ _aligned_contig_cast_bool_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_ulong\n");*/ @@ -24099,8 +24099,8 @@ _contig_cast_bool_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_ulong\n");*/ @@ -24273,8 +24273,8 @@ _aligned_cast_bool_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_ulonglong\n");*/ @@ -24443,8 +24443,8 @@ _cast_bool_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_ulonglong\n");*/ @@ -24613,8 +24613,8 @@ _aligned_contig_cast_bool_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_ulonglong\n");*/ @@ -24783,8 +24783,8 @@ _contig_cast_bool_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_ulonglong\n");*/ @@ -24957,8 +24957,8 @@ _aligned_cast_bool_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_byte\n");*/ @@ -25127,8 +25127,8 @@ _cast_bool_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_byte\n");*/ @@ -25297,8 +25297,8 @@ _aligned_contig_cast_bool_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_byte\n");*/ @@ -25467,8 +25467,8 @@ _contig_cast_bool_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_byte\n");*/ @@ -25641,8 +25641,8 @@ _aligned_cast_bool_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_short\n");*/ @@ -25811,8 +25811,8 @@ _cast_bool_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_short\n");*/ @@ -25981,8 +25981,8 @@ _aligned_contig_cast_bool_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_short\n");*/ @@ -26151,8 +26151,8 @@ _contig_cast_bool_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_short\n");*/ @@ -26325,8 +26325,8 @@ _aligned_cast_bool_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_int\n");*/ @@ -26495,8 +26495,8 @@ _cast_bool_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_int\n");*/ @@ -26665,8 +26665,8 @@ _aligned_contig_cast_bool_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_int\n");*/ @@ -26835,8 +26835,8 @@ _contig_cast_bool_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_int\n");*/ @@ -27009,8 +27009,8 @@ _aligned_cast_bool_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_long\n");*/ @@ -27179,8 +27179,8 @@ _cast_bool_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_long\n");*/ @@ -27349,8 +27349,8 @@ _aligned_contig_cast_bool_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_long\n");*/ @@ -27519,8 +27519,8 @@ _contig_cast_bool_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_long\n");*/ @@ -27693,8 +27693,8 @@ _aligned_cast_bool_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_longlong\n");*/ @@ -27863,8 +27863,8 @@ _cast_bool_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_longlong\n");*/ @@ -28033,8 +28033,8 @@ _aligned_contig_cast_bool_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_longlong\n");*/ @@ -28203,8 +28203,8 @@ _contig_cast_bool_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_longlong\n");*/ @@ -28377,8 +28377,8 @@ _aligned_cast_bool_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_half\n");*/ @@ -28547,8 +28547,8 @@ _cast_bool_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_half\n");*/ @@ -28717,8 +28717,8 @@ _aligned_contig_cast_bool_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_half\n");*/ @@ -28887,8 +28887,8 @@ _contig_cast_bool_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_half\n");*/ @@ -29061,8 +29061,8 @@ _aligned_cast_bool_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_float\n");*/ @@ -29231,8 +29231,8 @@ _cast_bool_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_float\n");*/ @@ -29401,8 +29401,8 @@ _aligned_contig_cast_bool_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_float\n");*/ @@ -29571,8 +29571,8 @@ _contig_cast_bool_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_float\n");*/ @@ -29745,8 +29745,8 @@ _aligned_cast_bool_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_double\n");*/ @@ -29915,8 +29915,8 @@ _cast_bool_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_double\n");*/ @@ -30085,8 +30085,8 @@ _aligned_contig_cast_bool_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_double\n");*/ @@ -30255,8 +30255,8 @@ _contig_cast_bool_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_double\n");*/ @@ -30429,8 +30429,8 @@ _aligned_cast_bool_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_longdouble\n");*/ @@ -30599,8 +30599,8 @@ _cast_bool_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_longdouble\n");*/ @@ -30769,8 +30769,8 @@ _aligned_contig_cast_bool_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_longdouble\n");*/ @@ -30939,8 +30939,8 @@ _contig_cast_bool_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_longdouble\n");*/ @@ -31113,8 +31113,8 @@ _aligned_cast_bool_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_cfloat\n");*/ @@ -31283,8 +31283,8 @@ _cast_bool_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_cfloat\n");*/ @@ -31453,8 +31453,8 @@ _aligned_contig_cast_bool_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_cfloat\n");*/ @@ -31623,8 +31623,8 @@ _contig_cast_bool_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_cfloat\n");*/ @@ -31797,8 +31797,8 @@ _aligned_cast_bool_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_cdouble\n");*/ @@ -31967,8 +31967,8 @@ _cast_bool_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_cdouble\n");*/ @@ -32137,8 +32137,8 @@ _aligned_contig_cast_bool_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_cdouble\n");*/ @@ -32307,8 +32307,8 @@ _contig_cast_bool_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_cdouble\n");*/ @@ -32481,8 +32481,8 @@ _aligned_cast_bool_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_bool_to_clongdouble\n");*/ @@ -32651,8 +32651,8 @@ _cast_bool_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_bool_to_clongdouble\n");*/ @@ -32821,8 +32821,8 @@ _aligned_contig_cast_bool_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_bool_to_clongdouble\n");*/ @@ -32991,8 +32991,8 @@ _contig_cast_bool_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_bool_to_clongdouble\n");*/ @@ -33169,8 +33169,8 @@ _aligned_cast_ubyte_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_bool\n");*/ @@ -33339,8 +33339,8 @@ _cast_ubyte_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_bool\n");*/ @@ -33509,8 +33509,8 @@ _aligned_contig_cast_ubyte_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_bool\n");*/ @@ -33679,8 +33679,8 @@ _contig_cast_ubyte_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_bool\n");*/ @@ -33853,8 +33853,8 @@ _aligned_cast_ubyte_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_ubyte\n");*/ @@ -34023,8 +34023,8 @@ _cast_ubyte_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_ubyte\n");*/ @@ -34193,8 +34193,8 @@ _aligned_contig_cast_ubyte_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_ubyte\n");*/ @@ -34363,8 +34363,8 @@ _contig_cast_ubyte_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_ubyte\n");*/ @@ -34537,8 +34537,8 @@ _aligned_cast_ubyte_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_ushort\n");*/ @@ -34707,8 +34707,8 @@ _cast_ubyte_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_ushort\n");*/ @@ -34877,8 +34877,8 @@ _aligned_contig_cast_ubyte_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_ushort\n");*/ @@ -35047,8 +35047,8 @@ _contig_cast_ubyte_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_ushort\n");*/ @@ -35221,8 +35221,8 @@ _aligned_cast_ubyte_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_uint\n");*/ @@ -35391,8 +35391,8 @@ _cast_ubyte_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_uint\n");*/ @@ -35561,8 +35561,8 @@ _aligned_contig_cast_ubyte_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_uint\n");*/ @@ -35731,8 +35731,8 @@ _contig_cast_ubyte_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_uint\n");*/ @@ -35905,8 +35905,8 @@ _aligned_cast_ubyte_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_ulong\n");*/ @@ -36075,8 +36075,8 @@ _cast_ubyte_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_ulong\n");*/ @@ -36245,8 +36245,8 @@ _aligned_contig_cast_ubyte_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_ulong\n");*/ @@ -36415,8 +36415,8 @@ _contig_cast_ubyte_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_ulong\n");*/ @@ -36589,8 +36589,8 @@ _aligned_cast_ubyte_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_ulonglong\n");*/ @@ -36759,8 +36759,8 @@ _cast_ubyte_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_ulonglong\n");*/ @@ -36929,8 +36929,8 @@ _aligned_contig_cast_ubyte_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_ulonglong\n");*/ @@ -37099,8 +37099,8 @@ _contig_cast_ubyte_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_ulonglong\n");*/ @@ -37273,8 +37273,8 @@ _aligned_cast_ubyte_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_byte\n");*/ @@ -37443,8 +37443,8 @@ _cast_ubyte_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_byte\n");*/ @@ -37613,8 +37613,8 @@ _aligned_contig_cast_ubyte_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_byte\n");*/ @@ -37783,8 +37783,8 @@ _contig_cast_ubyte_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_byte\n");*/ @@ -37957,8 +37957,8 @@ _aligned_cast_ubyte_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_short\n");*/ @@ -38127,8 +38127,8 @@ _cast_ubyte_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_short\n");*/ @@ -38297,8 +38297,8 @@ _aligned_contig_cast_ubyte_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_short\n");*/ @@ -38467,8 +38467,8 @@ _contig_cast_ubyte_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_short\n");*/ @@ -38641,8 +38641,8 @@ _aligned_cast_ubyte_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_int\n");*/ @@ -38811,8 +38811,8 @@ _cast_ubyte_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_int\n");*/ @@ -38981,8 +38981,8 @@ _aligned_contig_cast_ubyte_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_int\n");*/ @@ -39151,8 +39151,8 @@ _contig_cast_ubyte_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_int\n");*/ @@ -39325,8 +39325,8 @@ _aligned_cast_ubyte_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_long\n");*/ @@ -39495,8 +39495,8 @@ _cast_ubyte_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_long\n");*/ @@ -39665,8 +39665,8 @@ _aligned_contig_cast_ubyte_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_long\n");*/ @@ -39835,8 +39835,8 @@ _contig_cast_ubyte_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_long\n");*/ @@ -40009,8 +40009,8 @@ _aligned_cast_ubyte_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_longlong\n");*/ @@ -40179,8 +40179,8 @@ _cast_ubyte_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_longlong\n");*/ @@ -40349,8 +40349,8 @@ _aligned_contig_cast_ubyte_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_longlong\n");*/ @@ -40519,8 +40519,8 @@ _contig_cast_ubyte_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_longlong\n");*/ @@ -40693,8 +40693,8 @@ _aligned_cast_ubyte_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_half\n");*/ @@ -40863,8 +40863,8 @@ _cast_ubyte_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_half\n");*/ @@ -41033,8 +41033,8 @@ _aligned_contig_cast_ubyte_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_half\n");*/ @@ -41203,8 +41203,8 @@ _contig_cast_ubyte_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_half\n");*/ @@ -41377,8 +41377,8 @@ _aligned_cast_ubyte_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_float\n");*/ @@ -41547,8 +41547,8 @@ _cast_ubyte_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_float\n");*/ @@ -41717,8 +41717,8 @@ _aligned_contig_cast_ubyte_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_float\n");*/ @@ -41887,8 +41887,8 @@ _contig_cast_ubyte_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_float\n");*/ @@ -42061,8 +42061,8 @@ _aligned_cast_ubyte_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_double\n");*/ @@ -42231,8 +42231,8 @@ _cast_ubyte_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_double\n");*/ @@ -42401,8 +42401,8 @@ _aligned_contig_cast_ubyte_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_double\n");*/ @@ -42571,8 +42571,8 @@ _contig_cast_ubyte_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_double\n");*/ @@ -42745,8 +42745,8 @@ _aligned_cast_ubyte_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_longdouble\n");*/ @@ -42915,8 +42915,8 @@ _cast_ubyte_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_longdouble\n");*/ @@ -43085,8 +43085,8 @@ _aligned_contig_cast_ubyte_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_longdouble\n");*/ @@ -43255,8 +43255,8 @@ _contig_cast_ubyte_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_longdouble\n");*/ @@ -43429,8 +43429,8 @@ _aligned_cast_ubyte_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_cfloat\n");*/ @@ -43599,8 +43599,8 @@ _cast_ubyte_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_cfloat\n");*/ @@ -43769,8 +43769,8 @@ _aligned_contig_cast_ubyte_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_cfloat\n");*/ @@ -43939,8 +43939,8 @@ _contig_cast_ubyte_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_cfloat\n");*/ @@ -44113,8 +44113,8 @@ _aligned_cast_ubyte_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_cdouble\n");*/ @@ -44283,8 +44283,8 @@ _cast_ubyte_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_cdouble\n");*/ @@ -44453,8 +44453,8 @@ _aligned_contig_cast_ubyte_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_cdouble\n");*/ @@ -44623,8 +44623,8 @@ _contig_cast_ubyte_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_cdouble\n");*/ @@ -44797,8 +44797,8 @@ _aligned_cast_ubyte_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ubyte_to_clongdouble\n");*/ @@ -44967,8 +44967,8 @@ _cast_ubyte_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ubyte_to_clongdouble\n");*/ @@ -45137,8 +45137,8 @@ _aligned_contig_cast_ubyte_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ubyte_to_clongdouble\n");*/ @@ -45307,8 +45307,8 @@ _contig_cast_ubyte_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ubyte_to_clongdouble\n");*/ @@ -45485,8 +45485,8 @@ _aligned_cast_ushort_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_bool\n");*/ @@ -45655,8 +45655,8 @@ _cast_ushort_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_bool\n");*/ @@ -45825,8 +45825,8 @@ _aligned_contig_cast_ushort_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_bool\n");*/ @@ -45995,8 +45995,8 @@ _contig_cast_ushort_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_bool\n");*/ @@ -46169,8 +46169,8 @@ _aligned_cast_ushort_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_ubyte\n");*/ @@ -46339,8 +46339,8 @@ _cast_ushort_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_ubyte\n");*/ @@ -46509,8 +46509,8 @@ _aligned_contig_cast_ushort_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_ubyte\n");*/ @@ -46679,8 +46679,8 @@ _contig_cast_ushort_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_ubyte\n");*/ @@ -46853,8 +46853,8 @@ _aligned_cast_ushort_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_ushort\n");*/ @@ -47023,8 +47023,8 @@ _cast_ushort_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_ushort\n");*/ @@ -47193,8 +47193,8 @@ _aligned_contig_cast_ushort_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_ushort\n");*/ @@ -47363,8 +47363,8 @@ _contig_cast_ushort_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_ushort\n");*/ @@ -47537,8 +47537,8 @@ _aligned_cast_ushort_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_uint\n");*/ @@ -47707,8 +47707,8 @@ _cast_ushort_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_uint\n");*/ @@ -47877,8 +47877,8 @@ _aligned_contig_cast_ushort_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_uint\n");*/ @@ -48047,8 +48047,8 @@ _contig_cast_ushort_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_uint\n");*/ @@ -48221,8 +48221,8 @@ _aligned_cast_ushort_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_ulong\n");*/ @@ -48391,8 +48391,8 @@ _cast_ushort_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_ulong\n");*/ @@ -48561,8 +48561,8 @@ _aligned_contig_cast_ushort_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_ulong\n");*/ @@ -48731,8 +48731,8 @@ _contig_cast_ushort_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_ulong\n");*/ @@ -48905,8 +48905,8 @@ _aligned_cast_ushort_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_ulonglong\n");*/ @@ -49075,8 +49075,8 @@ _cast_ushort_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_ulonglong\n");*/ @@ -49245,8 +49245,8 @@ _aligned_contig_cast_ushort_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_ulonglong\n");*/ @@ -49415,8 +49415,8 @@ _contig_cast_ushort_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_ulonglong\n");*/ @@ -49589,8 +49589,8 @@ _aligned_cast_ushort_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_byte\n");*/ @@ -49759,8 +49759,8 @@ _cast_ushort_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_byte\n");*/ @@ -49929,8 +49929,8 @@ _aligned_contig_cast_ushort_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_byte\n");*/ @@ -50099,8 +50099,8 @@ _contig_cast_ushort_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_byte\n");*/ @@ -50273,8 +50273,8 @@ _aligned_cast_ushort_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_short\n");*/ @@ -50443,8 +50443,8 @@ _cast_ushort_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_short\n");*/ @@ -50613,8 +50613,8 @@ _aligned_contig_cast_ushort_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_short\n");*/ @@ -50783,8 +50783,8 @@ _contig_cast_ushort_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_short\n");*/ @@ -50957,8 +50957,8 @@ _aligned_cast_ushort_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_int\n");*/ @@ -51127,8 +51127,8 @@ _cast_ushort_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_int\n");*/ @@ -51297,8 +51297,8 @@ _aligned_contig_cast_ushort_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_int\n");*/ @@ -51467,8 +51467,8 @@ _contig_cast_ushort_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_int\n");*/ @@ -51641,8 +51641,8 @@ _aligned_cast_ushort_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_long\n");*/ @@ -51811,8 +51811,8 @@ _cast_ushort_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_long\n");*/ @@ -51981,8 +51981,8 @@ _aligned_contig_cast_ushort_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_long\n");*/ @@ -52151,8 +52151,8 @@ _contig_cast_ushort_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_long\n");*/ @@ -52325,8 +52325,8 @@ _aligned_cast_ushort_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_longlong\n");*/ @@ -52495,8 +52495,8 @@ _cast_ushort_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_longlong\n");*/ @@ -52665,8 +52665,8 @@ _aligned_contig_cast_ushort_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_longlong\n");*/ @@ -52835,8 +52835,8 @@ _contig_cast_ushort_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_longlong\n");*/ @@ -53009,8 +53009,8 @@ _aligned_cast_ushort_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_half\n");*/ @@ -53179,8 +53179,8 @@ _cast_ushort_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_half\n");*/ @@ -53349,8 +53349,8 @@ _aligned_contig_cast_ushort_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_half\n");*/ @@ -53519,8 +53519,8 @@ _contig_cast_ushort_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_half\n");*/ @@ -53693,8 +53693,8 @@ _aligned_cast_ushort_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_float\n");*/ @@ -53863,8 +53863,8 @@ _cast_ushort_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_float\n");*/ @@ -54033,8 +54033,8 @@ _aligned_contig_cast_ushort_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_float\n");*/ @@ -54203,8 +54203,8 @@ _contig_cast_ushort_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_float\n");*/ @@ -54377,8 +54377,8 @@ _aligned_cast_ushort_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_double\n");*/ @@ -54547,8 +54547,8 @@ _cast_ushort_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_double\n");*/ @@ -54717,8 +54717,8 @@ _aligned_contig_cast_ushort_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_double\n");*/ @@ -54887,8 +54887,8 @@ _contig_cast_ushort_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_double\n");*/ @@ -55061,8 +55061,8 @@ _aligned_cast_ushort_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_longdouble\n");*/ @@ -55231,8 +55231,8 @@ _cast_ushort_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_longdouble\n");*/ @@ -55401,8 +55401,8 @@ _aligned_contig_cast_ushort_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_longdouble\n");*/ @@ -55571,8 +55571,8 @@ _contig_cast_ushort_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_longdouble\n");*/ @@ -55745,8 +55745,8 @@ _aligned_cast_ushort_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_cfloat\n");*/ @@ -55915,8 +55915,8 @@ _cast_ushort_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_cfloat\n");*/ @@ -56085,8 +56085,8 @@ _aligned_contig_cast_ushort_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_cfloat\n");*/ @@ -56255,8 +56255,8 @@ _contig_cast_ushort_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_cfloat\n");*/ @@ -56429,8 +56429,8 @@ _aligned_cast_ushort_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_cdouble\n");*/ @@ -56599,8 +56599,8 @@ _cast_ushort_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_cdouble\n");*/ @@ -56769,8 +56769,8 @@ _aligned_contig_cast_ushort_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_cdouble\n");*/ @@ -56939,8 +56939,8 @@ _contig_cast_ushort_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_cdouble\n");*/ @@ -57113,8 +57113,8 @@ _aligned_cast_ushort_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ushort_to_clongdouble\n");*/ @@ -57283,8 +57283,8 @@ _cast_ushort_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ushort_to_clongdouble\n");*/ @@ -57453,8 +57453,8 @@ _aligned_contig_cast_ushort_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ushort_to_clongdouble\n");*/ @@ -57623,8 +57623,8 @@ _contig_cast_ushort_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ushort_to_clongdouble\n");*/ @@ -57801,8 +57801,8 @@ _aligned_cast_uint_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_bool\n");*/ @@ -57971,8 +57971,8 @@ _cast_uint_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_bool\n");*/ @@ -58141,8 +58141,8 @@ _aligned_contig_cast_uint_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_bool\n");*/ @@ -58311,8 +58311,8 @@ _contig_cast_uint_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_bool\n");*/ @@ -58485,8 +58485,8 @@ _aligned_cast_uint_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_ubyte\n");*/ @@ -58655,8 +58655,8 @@ _cast_uint_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_ubyte\n");*/ @@ -58825,8 +58825,8 @@ _aligned_contig_cast_uint_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_ubyte\n");*/ @@ -58995,8 +58995,8 @@ _contig_cast_uint_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_ubyte\n");*/ @@ -59169,8 +59169,8 @@ _aligned_cast_uint_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_ushort\n");*/ @@ -59339,8 +59339,8 @@ _cast_uint_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_ushort\n");*/ @@ -59509,8 +59509,8 @@ _aligned_contig_cast_uint_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_ushort\n");*/ @@ -59679,8 +59679,8 @@ _contig_cast_uint_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_ushort\n");*/ @@ -59853,8 +59853,8 @@ _aligned_cast_uint_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_uint\n");*/ @@ -60023,8 +60023,8 @@ _cast_uint_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_uint\n");*/ @@ -60193,8 +60193,8 @@ _aligned_contig_cast_uint_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_uint\n");*/ @@ -60363,8 +60363,8 @@ _contig_cast_uint_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_uint\n");*/ @@ -60537,8 +60537,8 @@ _aligned_cast_uint_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_ulong\n");*/ @@ -60707,8 +60707,8 @@ _cast_uint_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_ulong\n");*/ @@ -60877,8 +60877,8 @@ _aligned_contig_cast_uint_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_ulong\n");*/ @@ -61047,8 +61047,8 @@ _contig_cast_uint_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_ulong\n");*/ @@ -61221,8 +61221,8 @@ _aligned_cast_uint_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_ulonglong\n");*/ @@ -61391,8 +61391,8 @@ _cast_uint_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_ulonglong\n");*/ @@ -61561,8 +61561,8 @@ _aligned_contig_cast_uint_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_ulonglong\n");*/ @@ -61731,8 +61731,8 @@ _contig_cast_uint_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_ulonglong\n");*/ @@ -61905,8 +61905,8 @@ _aligned_cast_uint_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_byte\n");*/ @@ -62075,8 +62075,8 @@ _cast_uint_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_byte\n");*/ @@ -62245,8 +62245,8 @@ _aligned_contig_cast_uint_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_byte\n");*/ @@ -62415,8 +62415,8 @@ _contig_cast_uint_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_byte\n");*/ @@ -62589,8 +62589,8 @@ _aligned_cast_uint_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_short\n");*/ @@ -62759,8 +62759,8 @@ _cast_uint_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_short\n");*/ @@ -62929,8 +62929,8 @@ _aligned_contig_cast_uint_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_short\n");*/ @@ -63099,8 +63099,8 @@ _contig_cast_uint_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_short\n");*/ @@ -63273,8 +63273,8 @@ _aligned_cast_uint_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_int\n");*/ @@ -63443,8 +63443,8 @@ _cast_uint_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_int\n");*/ @@ -63613,8 +63613,8 @@ _aligned_contig_cast_uint_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_int\n");*/ @@ -63783,8 +63783,8 @@ _contig_cast_uint_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_int\n");*/ @@ -63957,8 +63957,8 @@ _aligned_cast_uint_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_long\n");*/ @@ -64127,8 +64127,8 @@ _cast_uint_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_long\n");*/ @@ -64297,8 +64297,8 @@ _aligned_contig_cast_uint_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_long\n");*/ @@ -64467,8 +64467,8 @@ _contig_cast_uint_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_long\n");*/ @@ -64641,8 +64641,8 @@ _aligned_cast_uint_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_longlong\n");*/ @@ -64811,8 +64811,8 @@ _cast_uint_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_longlong\n");*/ @@ -64981,8 +64981,8 @@ _aligned_contig_cast_uint_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_longlong\n");*/ @@ -65151,8 +65151,8 @@ _contig_cast_uint_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_longlong\n");*/ @@ -65325,8 +65325,8 @@ _aligned_cast_uint_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_half\n");*/ @@ -65495,8 +65495,8 @@ _cast_uint_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_half\n");*/ @@ -65665,8 +65665,8 @@ _aligned_contig_cast_uint_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_half\n");*/ @@ -65835,8 +65835,8 @@ _contig_cast_uint_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_half\n");*/ @@ -66009,8 +66009,8 @@ _aligned_cast_uint_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_float\n");*/ @@ -66179,8 +66179,8 @@ _cast_uint_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_float\n");*/ @@ -66349,8 +66349,8 @@ _aligned_contig_cast_uint_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_float\n");*/ @@ -66519,8 +66519,8 @@ _contig_cast_uint_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_float\n");*/ @@ -66693,8 +66693,8 @@ _aligned_cast_uint_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_double\n");*/ @@ -66863,8 +66863,8 @@ _cast_uint_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_double\n");*/ @@ -67033,8 +67033,8 @@ _aligned_contig_cast_uint_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_double\n");*/ @@ -67203,8 +67203,8 @@ _contig_cast_uint_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_double\n");*/ @@ -67377,8 +67377,8 @@ _aligned_cast_uint_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_longdouble\n");*/ @@ -67547,8 +67547,8 @@ _cast_uint_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_longdouble\n");*/ @@ -67717,8 +67717,8 @@ _aligned_contig_cast_uint_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_longdouble\n");*/ @@ -67887,8 +67887,8 @@ _contig_cast_uint_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_longdouble\n");*/ @@ -68061,8 +68061,8 @@ _aligned_cast_uint_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_cfloat\n");*/ @@ -68231,8 +68231,8 @@ _cast_uint_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_cfloat\n");*/ @@ -68401,8 +68401,8 @@ _aligned_contig_cast_uint_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_cfloat\n");*/ @@ -68571,8 +68571,8 @@ _contig_cast_uint_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_cfloat\n");*/ @@ -68745,8 +68745,8 @@ _aligned_cast_uint_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_cdouble\n");*/ @@ -68915,8 +68915,8 @@ _cast_uint_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_cdouble\n");*/ @@ -69085,8 +69085,8 @@ _aligned_contig_cast_uint_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_cdouble\n");*/ @@ -69255,8 +69255,8 @@ _contig_cast_uint_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_cdouble\n");*/ @@ -69429,8 +69429,8 @@ _aligned_cast_uint_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_uint_to_clongdouble\n");*/ @@ -69599,8 +69599,8 @@ _cast_uint_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_uint_to_clongdouble\n");*/ @@ -69769,8 +69769,8 @@ _aligned_contig_cast_uint_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_uint_to_clongdouble\n");*/ @@ -69939,8 +69939,8 @@ _contig_cast_uint_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_uint_to_clongdouble\n");*/ @@ -70117,8 +70117,8 @@ _aligned_cast_ulong_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_bool\n");*/ @@ -70287,8 +70287,8 @@ _cast_ulong_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_bool\n");*/ @@ -70457,8 +70457,8 @@ _aligned_contig_cast_ulong_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_bool\n");*/ @@ -70627,8 +70627,8 @@ _contig_cast_ulong_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_bool\n");*/ @@ -70801,8 +70801,8 @@ _aligned_cast_ulong_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_ubyte\n");*/ @@ -70971,8 +70971,8 @@ _cast_ulong_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_ubyte\n");*/ @@ -71141,8 +71141,8 @@ _aligned_contig_cast_ulong_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_ubyte\n");*/ @@ -71311,8 +71311,8 @@ _contig_cast_ulong_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_ubyte\n");*/ @@ -71485,8 +71485,8 @@ _aligned_cast_ulong_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_ushort\n");*/ @@ -71655,8 +71655,8 @@ _cast_ulong_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_ushort\n");*/ @@ -71825,8 +71825,8 @@ _aligned_contig_cast_ulong_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_ushort\n");*/ @@ -71995,8 +71995,8 @@ _contig_cast_ulong_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_ushort\n");*/ @@ -72169,8 +72169,8 @@ _aligned_cast_ulong_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_uint\n");*/ @@ -72339,8 +72339,8 @@ _cast_ulong_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_uint\n");*/ @@ -72509,8 +72509,8 @@ _aligned_contig_cast_ulong_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_uint\n");*/ @@ -72679,8 +72679,8 @@ _contig_cast_ulong_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_uint\n");*/ @@ -72853,8 +72853,8 @@ _aligned_cast_ulong_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_ulong\n");*/ @@ -73023,8 +73023,8 @@ _cast_ulong_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_ulong\n");*/ @@ -73193,8 +73193,8 @@ _aligned_contig_cast_ulong_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_ulong\n");*/ @@ -73363,8 +73363,8 @@ _contig_cast_ulong_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_ulong\n");*/ @@ -73537,8 +73537,8 @@ _aligned_cast_ulong_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_ulonglong\n");*/ @@ -73707,8 +73707,8 @@ _cast_ulong_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_ulonglong\n");*/ @@ -73877,8 +73877,8 @@ _aligned_contig_cast_ulong_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_ulonglong\n");*/ @@ -74047,8 +74047,8 @@ _contig_cast_ulong_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_ulonglong\n");*/ @@ -74221,8 +74221,8 @@ _aligned_cast_ulong_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_byte\n");*/ @@ -74391,8 +74391,8 @@ _cast_ulong_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_byte\n");*/ @@ -74561,8 +74561,8 @@ _aligned_contig_cast_ulong_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_byte\n");*/ @@ -74731,8 +74731,8 @@ _contig_cast_ulong_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_byte\n");*/ @@ -74905,8 +74905,8 @@ _aligned_cast_ulong_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_short\n");*/ @@ -75075,8 +75075,8 @@ _cast_ulong_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_short\n");*/ @@ -75245,8 +75245,8 @@ _aligned_contig_cast_ulong_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_short\n");*/ @@ -75415,8 +75415,8 @@ _contig_cast_ulong_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_short\n");*/ @@ -75589,8 +75589,8 @@ _aligned_cast_ulong_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_int\n");*/ @@ -75759,8 +75759,8 @@ _cast_ulong_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_int\n");*/ @@ -75929,8 +75929,8 @@ _aligned_contig_cast_ulong_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_int\n");*/ @@ -76099,8 +76099,8 @@ _contig_cast_ulong_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_int\n");*/ @@ -76273,8 +76273,8 @@ _aligned_cast_ulong_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_long\n");*/ @@ -76443,8 +76443,8 @@ _cast_ulong_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_long\n");*/ @@ -76613,8 +76613,8 @@ _aligned_contig_cast_ulong_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_long\n");*/ @@ -76783,8 +76783,8 @@ _contig_cast_ulong_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_long\n");*/ @@ -76957,8 +76957,8 @@ _aligned_cast_ulong_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_longlong\n");*/ @@ -77127,8 +77127,8 @@ _cast_ulong_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_longlong\n");*/ @@ -77297,8 +77297,8 @@ _aligned_contig_cast_ulong_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_longlong\n");*/ @@ -77467,8 +77467,8 @@ _contig_cast_ulong_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_longlong\n");*/ @@ -77641,8 +77641,8 @@ _aligned_cast_ulong_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_half\n");*/ @@ -77811,8 +77811,8 @@ _cast_ulong_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_half\n");*/ @@ -77981,8 +77981,8 @@ _aligned_contig_cast_ulong_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_half\n");*/ @@ -78151,8 +78151,8 @@ _contig_cast_ulong_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_half\n");*/ @@ -78325,8 +78325,8 @@ _aligned_cast_ulong_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_float\n");*/ @@ -78495,8 +78495,8 @@ _cast_ulong_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_float\n");*/ @@ -78665,8 +78665,8 @@ _aligned_contig_cast_ulong_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_float\n");*/ @@ -78835,8 +78835,8 @@ _contig_cast_ulong_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_float\n");*/ @@ -79009,8 +79009,8 @@ _aligned_cast_ulong_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_double\n");*/ @@ -79179,8 +79179,8 @@ _cast_ulong_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_double\n");*/ @@ -79349,8 +79349,8 @@ _aligned_contig_cast_ulong_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_double\n");*/ @@ -79519,8 +79519,8 @@ _contig_cast_ulong_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_double\n");*/ @@ -79693,8 +79693,8 @@ _aligned_cast_ulong_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_longdouble\n");*/ @@ -79863,8 +79863,8 @@ _cast_ulong_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_longdouble\n");*/ @@ -80033,8 +80033,8 @@ _aligned_contig_cast_ulong_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_longdouble\n");*/ @@ -80203,8 +80203,8 @@ _contig_cast_ulong_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_longdouble\n");*/ @@ -80377,8 +80377,8 @@ _aligned_cast_ulong_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_cfloat\n");*/ @@ -80547,8 +80547,8 @@ _cast_ulong_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_cfloat\n");*/ @@ -80717,8 +80717,8 @@ _aligned_contig_cast_ulong_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_cfloat\n");*/ @@ -80887,8 +80887,8 @@ _contig_cast_ulong_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_cfloat\n");*/ @@ -81061,8 +81061,8 @@ _aligned_cast_ulong_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_cdouble\n");*/ @@ -81231,8 +81231,8 @@ _cast_ulong_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_cdouble\n");*/ @@ -81401,8 +81401,8 @@ _aligned_contig_cast_ulong_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_cdouble\n");*/ @@ -81571,8 +81571,8 @@ _contig_cast_ulong_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_cdouble\n");*/ @@ -81745,8 +81745,8 @@ _aligned_cast_ulong_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulong_to_clongdouble\n");*/ @@ -81915,8 +81915,8 @@ _cast_ulong_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulong_to_clongdouble\n");*/ @@ -82085,8 +82085,8 @@ _aligned_contig_cast_ulong_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulong_to_clongdouble\n");*/ @@ -82255,8 +82255,8 @@ _contig_cast_ulong_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulong_to_clongdouble\n");*/ @@ -82433,8 +82433,8 @@ _aligned_cast_ulonglong_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_bool\n");*/ @@ -82603,8 +82603,8 @@ _cast_ulonglong_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_bool\n");*/ @@ -82773,8 +82773,8 @@ _aligned_contig_cast_ulonglong_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_bool\n");*/ @@ -82943,8 +82943,8 @@ _contig_cast_ulonglong_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_bool\n");*/ @@ -83117,8 +83117,8 @@ _aligned_cast_ulonglong_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_ubyte\n");*/ @@ -83287,8 +83287,8 @@ _cast_ulonglong_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_ubyte\n");*/ @@ -83457,8 +83457,8 @@ _aligned_contig_cast_ulonglong_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_ubyte\n");*/ @@ -83627,8 +83627,8 @@ _contig_cast_ulonglong_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_ubyte\n");*/ @@ -83801,8 +83801,8 @@ _aligned_cast_ulonglong_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_ushort\n");*/ @@ -83971,8 +83971,8 @@ _cast_ulonglong_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_ushort\n");*/ @@ -84141,8 +84141,8 @@ _aligned_contig_cast_ulonglong_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_ushort\n");*/ @@ -84311,8 +84311,8 @@ _contig_cast_ulonglong_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_ushort\n");*/ @@ -84485,8 +84485,8 @@ _aligned_cast_ulonglong_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_uint\n");*/ @@ -84655,8 +84655,8 @@ _cast_ulonglong_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_uint\n");*/ @@ -84825,8 +84825,8 @@ _aligned_contig_cast_ulonglong_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_uint\n");*/ @@ -84995,8 +84995,8 @@ _contig_cast_ulonglong_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_uint\n");*/ @@ -85169,8 +85169,8 @@ _aligned_cast_ulonglong_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_ulong\n");*/ @@ -85339,8 +85339,8 @@ _cast_ulonglong_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_ulong\n");*/ @@ -85509,8 +85509,8 @@ _aligned_contig_cast_ulonglong_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_ulong\n");*/ @@ -85679,8 +85679,8 @@ _contig_cast_ulonglong_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_ulong\n");*/ @@ -85853,8 +85853,8 @@ _aligned_cast_ulonglong_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_ulonglong\n");*/ @@ -86023,8 +86023,8 @@ _cast_ulonglong_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_ulonglong\n");*/ @@ -86193,8 +86193,8 @@ _aligned_contig_cast_ulonglong_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_ulonglong\n");*/ @@ -86363,8 +86363,8 @@ _contig_cast_ulonglong_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_ulonglong\n");*/ @@ -86537,8 +86537,8 @@ _aligned_cast_ulonglong_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_byte\n");*/ @@ -86707,8 +86707,8 @@ _cast_ulonglong_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_byte\n");*/ @@ -86877,8 +86877,8 @@ _aligned_contig_cast_ulonglong_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_byte\n");*/ @@ -87047,8 +87047,8 @@ _contig_cast_ulonglong_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_byte\n");*/ @@ -87221,8 +87221,8 @@ _aligned_cast_ulonglong_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_short\n");*/ @@ -87391,8 +87391,8 @@ _cast_ulonglong_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_short\n");*/ @@ -87561,8 +87561,8 @@ _aligned_contig_cast_ulonglong_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_short\n");*/ @@ -87731,8 +87731,8 @@ _contig_cast_ulonglong_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_short\n");*/ @@ -87905,8 +87905,8 @@ _aligned_cast_ulonglong_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_int\n");*/ @@ -88075,8 +88075,8 @@ _cast_ulonglong_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_int\n");*/ @@ -88245,8 +88245,8 @@ _aligned_contig_cast_ulonglong_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_int\n");*/ @@ -88415,8 +88415,8 @@ _contig_cast_ulonglong_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_int\n");*/ @@ -88589,8 +88589,8 @@ _aligned_cast_ulonglong_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_long\n");*/ @@ -88759,8 +88759,8 @@ _cast_ulonglong_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_long\n");*/ @@ -88929,8 +88929,8 @@ _aligned_contig_cast_ulonglong_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_long\n");*/ @@ -89099,8 +89099,8 @@ _contig_cast_ulonglong_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_long\n");*/ @@ -89273,8 +89273,8 @@ _aligned_cast_ulonglong_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_longlong\n");*/ @@ -89443,8 +89443,8 @@ _cast_ulonglong_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_longlong\n");*/ @@ -89613,8 +89613,8 @@ _aligned_contig_cast_ulonglong_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_longlong\n");*/ @@ -89783,8 +89783,8 @@ _contig_cast_ulonglong_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_longlong\n");*/ @@ -89957,8 +89957,8 @@ _aligned_cast_ulonglong_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_half\n");*/ @@ -90127,8 +90127,8 @@ _cast_ulonglong_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_half\n");*/ @@ -90297,8 +90297,8 @@ _aligned_contig_cast_ulonglong_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_half\n");*/ @@ -90467,8 +90467,8 @@ _contig_cast_ulonglong_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_half\n");*/ @@ -90641,8 +90641,8 @@ _aligned_cast_ulonglong_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_float\n");*/ @@ -90811,8 +90811,8 @@ _cast_ulonglong_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_float\n");*/ @@ -90981,8 +90981,8 @@ _aligned_contig_cast_ulonglong_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_float\n");*/ @@ -91151,8 +91151,8 @@ _contig_cast_ulonglong_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_float\n");*/ @@ -91325,8 +91325,8 @@ _aligned_cast_ulonglong_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_double\n");*/ @@ -91495,8 +91495,8 @@ _cast_ulonglong_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_double\n");*/ @@ -91665,8 +91665,8 @@ _aligned_contig_cast_ulonglong_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_double\n");*/ @@ -91835,8 +91835,8 @@ _contig_cast_ulonglong_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_double\n");*/ @@ -92009,8 +92009,8 @@ _aligned_cast_ulonglong_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_longdouble\n");*/ @@ -92179,8 +92179,8 @@ _cast_ulonglong_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_longdouble\n");*/ @@ -92349,8 +92349,8 @@ _aligned_contig_cast_ulonglong_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_longdouble\n");*/ @@ -92519,8 +92519,8 @@ _contig_cast_ulonglong_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_longdouble\n");*/ @@ -92693,8 +92693,8 @@ _aligned_cast_ulonglong_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_cfloat\n");*/ @@ -92863,8 +92863,8 @@ _cast_ulonglong_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_cfloat\n");*/ @@ -93033,8 +93033,8 @@ _aligned_contig_cast_ulonglong_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_cfloat\n");*/ @@ -93203,8 +93203,8 @@ _contig_cast_ulonglong_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_cfloat\n");*/ @@ -93377,8 +93377,8 @@ _aligned_cast_ulonglong_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_cdouble\n");*/ @@ -93547,8 +93547,8 @@ _cast_ulonglong_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_cdouble\n");*/ @@ -93717,8 +93717,8 @@ _aligned_contig_cast_ulonglong_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_cdouble\n");*/ @@ -93887,8 +93887,8 @@ _contig_cast_ulonglong_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_cdouble\n");*/ @@ -94061,8 +94061,8 @@ _aligned_cast_ulonglong_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_ulonglong_to_clongdouble\n");*/ @@ -94231,8 +94231,8 @@ _cast_ulonglong_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_ulonglong_to_clongdouble\n");*/ @@ -94401,8 +94401,8 @@ _aligned_contig_cast_ulonglong_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_ulonglong_to_clongdouble\n");*/ @@ -94571,8 +94571,8 @@ _contig_cast_ulonglong_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_ulonglong_to_clongdouble\n");*/ @@ -94749,8 +94749,8 @@ _aligned_cast_byte_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_bool\n");*/ @@ -94919,8 +94919,8 @@ _cast_byte_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_bool\n");*/ @@ -95089,8 +95089,8 @@ _aligned_contig_cast_byte_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_bool\n");*/ @@ -95259,8 +95259,8 @@ _contig_cast_byte_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_bool\n");*/ @@ -95433,8 +95433,8 @@ _aligned_cast_byte_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_ubyte\n");*/ @@ -95603,8 +95603,8 @@ _cast_byte_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_ubyte\n");*/ @@ -95773,8 +95773,8 @@ _aligned_contig_cast_byte_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_ubyte\n");*/ @@ -95943,8 +95943,8 @@ _contig_cast_byte_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_ubyte\n");*/ @@ -96117,8 +96117,8 @@ _aligned_cast_byte_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_ushort\n");*/ @@ -96287,8 +96287,8 @@ _cast_byte_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_ushort\n");*/ @@ -96457,8 +96457,8 @@ _aligned_contig_cast_byte_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_ushort\n");*/ @@ -96627,8 +96627,8 @@ _contig_cast_byte_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_ushort\n");*/ @@ -96801,8 +96801,8 @@ _aligned_cast_byte_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_uint\n");*/ @@ -96971,8 +96971,8 @@ _cast_byte_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_uint\n");*/ @@ -97141,8 +97141,8 @@ _aligned_contig_cast_byte_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_uint\n");*/ @@ -97311,8 +97311,8 @@ _contig_cast_byte_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_uint\n");*/ @@ -97485,8 +97485,8 @@ _aligned_cast_byte_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_ulong\n");*/ @@ -97655,8 +97655,8 @@ _cast_byte_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_ulong\n");*/ @@ -97825,8 +97825,8 @@ _aligned_contig_cast_byte_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_ulong\n");*/ @@ -97995,8 +97995,8 @@ _contig_cast_byte_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_ulong\n");*/ @@ -98169,8 +98169,8 @@ _aligned_cast_byte_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_ulonglong\n");*/ @@ -98339,8 +98339,8 @@ _cast_byte_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_ulonglong\n");*/ @@ -98509,8 +98509,8 @@ _aligned_contig_cast_byte_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_ulonglong\n");*/ @@ -98679,8 +98679,8 @@ _contig_cast_byte_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_ulonglong\n");*/ @@ -98853,8 +98853,8 @@ _aligned_cast_byte_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_byte\n");*/ @@ -99023,8 +99023,8 @@ _cast_byte_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_byte\n");*/ @@ -99193,8 +99193,8 @@ _aligned_contig_cast_byte_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_byte\n");*/ @@ -99363,8 +99363,8 @@ _contig_cast_byte_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_byte\n");*/ @@ -99537,8 +99537,8 @@ _aligned_cast_byte_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_short\n");*/ @@ -99707,8 +99707,8 @@ _cast_byte_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_short\n");*/ @@ -99877,8 +99877,8 @@ _aligned_contig_cast_byte_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_short\n");*/ @@ -100047,8 +100047,8 @@ _contig_cast_byte_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_short\n");*/ @@ -100221,8 +100221,8 @@ _aligned_cast_byte_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_int\n");*/ @@ -100391,8 +100391,8 @@ _cast_byte_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_int\n");*/ @@ -100561,8 +100561,8 @@ _aligned_contig_cast_byte_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_int\n");*/ @@ -100731,8 +100731,8 @@ _contig_cast_byte_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_int\n");*/ @@ -100905,8 +100905,8 @@ _aligned_cast_byte_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_long\n");*/ @@ -101075,8 +101075,8 @@ _cast_byte_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_long\n");*/ @@ -101245,8 +101245,8 @@ _aligned_contig_cast_byte_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_long\n");*/ @@ -101415,8 +101415,8 @@ _contig_cast_byte_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_long\n");*/ @@ -101589,8 +101589,8 @@ _aligned_cast_byte_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_longlong\n");*/ @@ -101759,8 +101759,8 @@ _cast_byte_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_longlong\n");*/ @@ -101929,8 +101929,8 @@ _aligned_contig_cast_byte_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_longlong\n");*/ @@ -102099,8 +102099,8 @@ _contig_cast_byte_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_longlong\n");*/ @@ -102273,8 +102273,8 @@ _aligned_cast_byte_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_half\n");*/ @@ -102443,8 +102443,8 @@ _cast_byte_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_half\n");*/ @@ -102613,8 +102613,8 @@ _aligned_contig_cast_byte_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_half\n");*/ @@ -102783,8 +102783,8 @@ _contig_cast_byte_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_half\n");*/ @@ -102957,8 +102957,8 @@ _aligned_cast_byte_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_float\n");*/ @@ -103127,8 +103127,8 @@ _cast_byte_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_float\n");*/ @@ -103297,8 +103297,8 @@ _aligned_contig_cast_byte_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_float\n");*/ @@ -103467,8 +103467,8 @@ _contig_cast_byte_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_float\n");*/ @@ -103641,8 +103641,8 @@ _aligned_cast_byte_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_double\n");*/ @@ -103811,8 +103811,8 @@ _cast_byte_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_double\n");*/ @@ -103981,8 +103981,8 @@ _aligned_contig_cast_byte_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_double\n");*/ @@ -104151,8 +104151,8 @@ _contig_cast_byte_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_double\n");*/ @@ -104325,8 +104325,8 @@ _aligned_cast_byte_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_longdouble\n");*/ @@ -104495,8 +104495,8 @@ _cast_byte_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_longdouble\n");*/ @@ -104665,8 +104665,8 @@ _aligned_contig_cast_byte_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_longdouble\n");*/ @@ -104835,8 +104835,8 @@ _contig_cast_byte_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_longdouble\n");*/ @@ -105009,8 +105009,8 @@ _aligned_cast_byte_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_cfloat\n");*/ @@ -105179,8 +105179,8 @@ _cast_byte_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_cfloat\n");*/ @@ -105349,8 +105349,8 @@ _aligned_contig_cast_byte_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_cfloat\n");*/ @@ -105519,8 +105519,8 @@ _contig_cast_byte_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_cfloat\n");*/ @@ -105693,8 +105693,8 @@ _aligned_cast_byte_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_cdouble\n");*/ @@ -105863,8 +105863,8 @@ _cast_byte_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_cdouble\n");*/ @@ -106033,8 +106033,8 @@ _aligned_contig_cast_byte_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_cdouble\n");*/ @@ -106203,8 +106203,8 @@ _contig_cast_byte_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_cdouble\n");*/ @@ -106377,8 +106377,8 @@ _aligned_cast_byte_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_byte_to_clongdouble\n");*/ @@ -106547,8 +106547,8 @@ _cast_byte_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_byte_to_clongdouble\n");*/ @@ -106717,8 +106717,8 @@ _aligned_contig_cast_byte_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_byte_to_clongdouble\n");*/ @@ -106887,8 +106887,8 @@ _contig_cast_byte_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_byte_to_clongdouble\n");*/ @@ -107065,8 +107065,8 @@ _aligned_cast_short_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_bool\n");*/ @@ -107235,8 +107235,8 @@ _cast_short_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_bool\n");*/ @@ -107405,8 +107405,8 @@ _aligned_contig_cast_short_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_bool\n");*/ @@ -107575,8 +107575,8 @@ _contig_cast_short_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_bool\n");*/ @@ -107749,8 +107749,8 @@ _aligned_cast_short_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_ubyte\n");*/ @@ -107919,8 +107919,8 @@ _cast_short_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_ubyte\n");*/ @@ -108089,8 +108089,8 @@ _aligned_contig_cast_short_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_ubyte\n");*/ @@ -108259,8 +108259,8 @@ _contig_cast_short_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_ubyte\n");*/ @@ -108433,8 +108433,8 @@ _aligned_cast_short_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_ushort\n");*/ @@ -108603,8 +108603,8 @@ _cast_short_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_ushort\n");*/ @@ -108773,8 +108773,8 @@ _aligned_contig_cast_short_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_ushort\n");*/ @@ -108943,8 +108943,8 @@ _contig_cast_short_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_ushort\n");*/ @@ -109117,8 +109117,8 @@ _aligned_cast_short_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_uint\n");*/ @@ -109287,8 +109287,8 @@ _cast_short_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_uint\n");*/ @@ -109457,8 +109457,8 @@ _aligned_contig_cast_short_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_uint\n");*/ @@ -109627,8 +109627,8 @@ _contig_cast_short_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_uint\n");*/ @@ -109801,8 +109801,8 @@ _aligned_cast_short_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_ulong\n");*/ @@ -109971,8 +109971,8 @@ _cast_short_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_ulong\n");*/ @@ -110141,8 +110141,8 @@ _aligned_contig_cast_short_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_ulong\n");*/ @@ -110311,8 +110311,8 @@ _contig_cast_short_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_ulong\n");*/ @@ -110485,8 +110485,8 @@ _aligned_cast_short_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_ulonglong\n");*/ @@ -110655,8 +110655,8 @@ _cast_short_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_ulonglong\n");*/ @@ -110825,8 +110825,8 @@ _aligned_contig_cast_short_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_ulonglong\n");*/ @@ -110995,8 +110995,8 @@ _contig_cast_short_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_ulonglong\n");*/ @@ -111169,8 +111169,8 @@ _aligned_cast_short_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_byte\n");*/ @@ -111339,8 +111339,8 @@ _cast_short_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_byte\n");*/ @@ -111509,8 +111509,8 @@ _aligned_contig_cast_short_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_byte\n");*/ @@ -111679,8 +111679,8 @@ _contig_cast_short_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_byte\n");*/ @@ -111853,8 +111853,8 @@ _aligned_cast_short_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_short\n");*/ @@ -112023,8 +112023,8 @@ _cast_short_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_short\n");*/ @@ -112193,8 +112193,8 @@ _aligned_contig_cast_short_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_short\n");*/ @@ -112363,8 +112363,8 @@ _contig_cast_short_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_short\n");*/ @@ -112537,8 +112537,8 @@ _aligned_cast_short_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_int\n");*/ @@ -112707,8 +112707,8 @@ _cast_short_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_int\n");*/ @@ -112877,8 +112877,8 @@ _aligned_contig_cast_short_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_int\n");*/ @@ -113047,8 +113047,8 @@ _contig_cast_short_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_int\n");*/ @@ -113221,8 +113221,8 @@ _aligned_cast_short_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_long\n");*/ @@ -113391,8 +113391,8 @@ _cast_short_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_long\n");*/ @@ -113561,8 +113561,8 @@ _aligned_contig_cast_short_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_long\n");*/ @@ -113731,8 +113731,8 @@ _contig_cast_short_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_long\n");*/ @@ -113905,8 +113905,8 @@ _aligned_cast_short_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_longlong\n");*/ @@ -114075,8 +114075,8 @@ _cast_short_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_longlong\n");*/ @@ -114245,8 +114245,8 @@ _aligned_contig_cast_short_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_longlong\n");*/ @@ -114415,8 +114415,8 @@ _contig_cast_short_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_longlong\n");*/ @@ -114589,8 +114589,8 @@ _aligned_cast_short_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_half\n");*/ @@ -114759,8 +114759,8 @@ _cast_short_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_half\n");*/ @@ -114929,8 +114929,8 @@ _aligned_contig_cast_short_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_half\n");*/ @@ -115099,8 +115099,8 @@ _contig_cast_short_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_half\n");*/ @@ -115273,8 +115273,8 @@ _aligned_cast_short_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_float\n");*/ @@ -115443,8 +115443,8 @@ _cast_short_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_float\n");*/ @@ -115613,8 +115613,8 @@ _aligned_contig_cast_short_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_float\n");*/ @@ -115783,8 +115783,8 @@ _contig_cast_short_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_float\n");*/ @@ -115957,8 +115957,8 @@ _aligned_cast_short_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_double\n");*/ @@ -116127,8 +116127,8 @@ _cast_short_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_double\n");*/ @@ -116297,8 +116297,8 @@ _aligned_contig_cast_short_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_double\n");*/ @@ -116467,8 +116467,8 @@ _contig_cast_short_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_double\n");*/ @@ -116641,8 +116641,8 @@ _aligned_cast_short_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_longdouble\n");*/ @@ -116811,8 +116811,8 @@ _cast_short_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_longdouble\n");*/ @@ -116981,8 +116981,8 @@ _aligned_contig_cast_short_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_longdouble\n");*/ @@ -117151,8 +117151,8 @@ _contig_cast_short_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_longdouble\n");*/ @@ -117325,8 +117325,8 @@ _aligned_cast_short_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_cfloat\n");*/ @@ -117495,8 +117495,8 @@ _cast_short_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_cfloat\n");*/ @@ -117665,8 +117665,8 @@ _aligned_contig_cast_short_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_cfloat\n");*/ @@ -117835,8 +117835,8 @@ _contig_cast_short_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_cfloat\n");*/ @@ -118009,8 +118009,8 @@ _aligned_cast_short_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_cdouble\n");*/ @@ -118179,8 +118179,8 @@ _cast_short_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_cdouble\n");*/ @@ -118349,8 +118349,8 @@ _aligned_contig_cast_short_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_cdouble\n");*/ @@ -118519,8 +118519,8 @@ _contig_cast_short_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_cdouble\n");*/ @@ -118693,8 +118693,8 @@ _aligned_cast_short_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_short_to_clongdouble\n");*/ @@ -118863,8 +118863,8 @@ _cast_short_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_short_to_clongdouble\n");*/ @@ -119033,8 +119033,8 @@ _aligned_contig_cast_short_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_short_to_clongdouble\n");*/ @@ -119203,8 +119203,8 @@ _contig_cast_short_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_short_to_clongdouble\n");*/ @@ -119381,8 +119381,8 @@ _aligned_cast_int_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_bool\n");*/ @@ -119551,8 +119551,8 @@ _cast_int_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_bool\n");*/ @@ -119721,8 +119721,8 @@ _aligned_contig_cast_int_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_bool\n");*/ @@ -119891,8 +119891,8 @@ _contig_cast_int_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_bool\n");*/ @@ -120065,8 +120065,8 @@ _aligned_cast_int_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_ubyte\n");*/ @@ -120235,8 +120235,8 @@ _cast_int_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_ubyte\n");*/ @@ -120405,8 +120405,8 @@ _aligned_contig_cast_int_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_ubyte\n");*/ @@ -120575,8 +120575,8 @@ _contig_cast_int_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_ubyte\n");*/ @@ -120749,8 +120749,8 @@ _aligned_cast_int_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_ushort\n");*/ @@ -120919,8 +120919,8 @@ _cast_int_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_ushort\n");*/ @@ -121089,8 +121089,8 @@ _aligned_contig_cast_int_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_ushort\n");*/ @@ -121259,8 +121259,8 @@ _contig_cast_int_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_ushort\n");*/ @@ -121433,8 +121433,8 @@ _aligned_cast_int_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_uint\n");*/ @@ -121603,8 +121603,8 @@ _cast_int_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_uint\n");*/ @@ -121773,8 +121773,8 @@ _aligned_contig_cast_int_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_uint\n");*/ @@ -121943,8 +121943,8 @@ _contig_cast_int_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_uint\n");*/ @@ -122117,8 +122117,8 @@ _aligned_cast_int_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_ulong\n");*/ @@ -122287,8 +122287,8 @@ _cast_int_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_ulong\n");*/ @@ -122457,8 +122457,8 @@ _aligned_contig_cast_int_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_ulong\n");*/ @@ -122627,8 +122627,8 @@ _contig_cast_int_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_ulong\n");*/ @@ -122801,8 +122801,8 @@ _aligned_cast_int_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_ulonglong\n");*/ @@ -122971,8 +122971,8 @@ _cast_int_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_ulonglong\n");*/ @@ -123141,8 +123141,8 @@ _aligned_contig_cast_int_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_ulonglong\n");*/ @@ -123311,8 +123311,8 @@ _contig_cast_int_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_ulonglong\n");*/ @@ -123485,8 +123485,8 @@ _aligned_cast_int_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_byte\n");*/ @@ -123655,8 +123655,8 @@ _cast_int_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_byte\n");*/ @@ -123825,8 +123825,8 @@ _aligned_contig_cast_int_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_byte\n");*/ @@ -123995,8 +123995,8 @@ _contig_cast_int_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_byte\n");*/ @@ -124169,8 +124169,8 @@ _aligned_cast_int_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_short\n");*/ @@ -124339,8 +124339,8 @@ _cast_int_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_short\n");*/ @@ -124509,8 +124509,8 @@ _aligned_contig_cast_int_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_short\n");*/ @@ -124679,8 +124679,8 @@ _contig_cast_int_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_short\n");*/ @@ -124853,8 +124853,8 @@ _aligned_cast_int_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_int\n");*/ @@ -125023,8 +125023,8 @@ _cast_int_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_int\n");*/ @@ -125193,8 +125193,8 @@ _aligned_contig_cast_int_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_int\n");*/ @@ -125363,8 +125363,8 @@ _contig_cast_int_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_int\n");*/ @@ -125537,8 +125537,8 @@ _aligned_cast_int_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_long\n");*/ @@ -125707,8 +125707,8 @@ _cast_int_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_long\n");*/ @@ -125877,8 +125877,8 @@ _aligned_contig_cast_int_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_long\n");*/ @@ -126047,8 +126047,8 @@ _contig_cast_int_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_long\n");*/ @@ -126221,8 +126221,8 @@ _aligned_cast_int_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_longlong\n");*/ @@ -126391,8 +126391,8 @@ _cast_int_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_longlong\n");*/ @@ -126561,8 +126561,8 @@ _aligned_contig_cast_int_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_longlong\n");*/ @@ -126731,8 +126731,8 @@ _contig_cast_int_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_longlong\n");*/ @@ -126905,8 +126905,8 @@ _aligned_cast_int_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_half\n");*/ @@ -127075,8 +127075,8 @@ _cast_int_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_half\n");*/ @@ -127245,8 +127245,8 @@ _aligned_contig_cast_int_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_half\n");*/ @@ -127415,8 +127415,8 @@ _contig_cast_int_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_half\n");*/ @@ -127589,8 +127589,8 @@ _aligned_cast_int_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_float\n");*/ @@ -127759,8 +127759,8 @@ _cast_int_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_float\n");*/ @@ -127929,8 +127929,8 @@ _aligned_contig_cast_int_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_float\n");*/ @@ -128099,8 +128099,8 @@ _contig_cast_int_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_float\n");*/ @@ -128273,8 +128273,8 @@ _aligned_cast_int_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_double\n");*/ @@ -128443,8 +128443,8 @@ _cast_int_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_double\n");*/ @@ -128613,8 +128613,8 @@ _aligned_contig_cast_int_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_double\n");*/ @@ -128783,8 +128783,8 @@ _contig_cast_int_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_double\n");*/ @@ -128957,8 +128957,8 @@ _aligned_cast_int_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_longdouble\n");*/ @@ -129127,8 +129127,8 @@ _cast_int_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_longdouble\n");*/ @@ -129297,8 +129297,8 @@ _aligned_contig_cast_int_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_longdouble\n");*/ @@ -129467,8 +129467,8 @@ _contig_cast_int_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_longdouble\n");*/ @@ -129641,8 +129641,8 @@ _aligned_cast_int_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_cfloat\n");*/ @@ -129811,8 +129811,8 @@ _cast_int_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_cfloat\n");*/ @@ -129981,8 +129981,8 @@ _aligned_contig_cast_int_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_cfloat\n");*/ @@ -130151,8 +130151,8 @@ _contig_cast_int_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_cfloat\n");*/ @@ -130325,8 +130325,8 @@ _aligned_cast_int_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_cdouble\n");*/ @@ -130495,8 +130495,8 @@ _cast_int_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_cdouble\n");*/ @@ -130665,8 +130665,8 @@ _aligned_contig_cast_int_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_cdouble\n");*/ @@ -130835,8 +130835,8 @@ _contig_cast_int_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_cdouble\n");*/ @@ -131009,8 +131009,8 @@ _aligned_cast_int_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_int_to_clongdouble\n");*/ @@ -131179,8 +131179,8 @@ _cast_int_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_int_to_clongdouble\n");*/ @@ -131349,8 +131349,8 @@ _aligned_contig_cast_int_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_int_to_clongdouble\n");*/ @@ -131519,8 +131519,8 @@ _contig_cast_int_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_int_to_clongdouble\n");*/ @@ -131697,8 +131697,8 @@ _aligned_cast_long_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_bool\n");*/ @@ -131867,8 +131867,8 @@ _cast_long_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_bool\n");*/ @@ -132037,8 +132037,8 @@ _aligned_contig_cast_long_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_bool\n");*/ @@ -132207,8 +132207,8 @@ _contig_cast_long_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_bool\n");*/ @@ -132381,8 +132381,8 @@ _aligned_cast_long_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_ubyte\n");*/ @@ -132551,8 +132551,8 @@ _cast_long_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_ubyte\n");*/ @@ -132721,8 +132721,8 @@ _aligned_contig_cast_long_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_ubyte\n");*/ @@ -132891,8 +132891,8 @@ _contig_cast_long_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_ubyte\n");*/ @@ -133065,8 +133065,8 @@ _aligned_cast_long_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_ushort\n");*/ @@ -133235,8 +133235,8 @@ _cast_long_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_ushort\n");*/ @@ -133405,8 +133405,8 @@ _aligned_contig_cast_long_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_ushort\n");*/ @@ -133575,8 +133575,8 @@ _contig_cast_long_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_ushort\n");*/ @@ -133749,8 +133749,8 @@ _aligned_cast_long_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_uint\n");*/ @@ -133919,8 +133919,8 @@ _cast_long_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_uint\n");*/ @@ -134089,8 +134089,8 @@ _aligned_contig_cast_long_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_uint\n");*/ @@ -134259,8 +134259,8 @@ _contig_cast_long_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_uint\n");*/ @@ -134433,8 +134433,8 @@ _aligned_cast_long_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_ulong\n");*/ @@ -134603,8 +134603,8 @@ _cast_long_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_ulong\n");*/ @@ -134773,8 +134773,8 @@ _aligned_contig_cast_long_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_ulong\n");*/ @@ -134943,8 +134943,8 @@ _contig_cast_long_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_ulong\n");*/ @@ -135117,8 +135117,8 @@ _aligned_cast_long_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_ulonglong\n");*/ @@ -135287,8 +135287,8 @@ _cast_long_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_ulonglong\n");*/ @@ -135457,8 +135457,8 @@ _aligned_contig_cast_long_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_ulonglong\n");*/ @@ -135627,8 +135627,8 @@ _contig_cast_long_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_ulonglong\n");*/ @@ -135801,8 +135801,8 @@ _aligned_cast_long_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_byte\n");*/ @@ -135971,8 +135971,8 @@ _cast_long_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_byte\n");*/ @@ -136141,8 +136141,8 @@ _aligned_contig_cast_long_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_byte\n");*/ @@ -136311,8 +136311,8 @@ _contig_cast_long_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_byte\n");*/ @@ -136485,8 +136485,8 @@ _aligned_cast_long_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_short\n");*/ @@ -136655,8 +136655,8 @@ _cast_long_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_short\n");*/ @@ -136825,8 +136825,8 @@ _aligned_contig_cast_long_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_short\n");*/ @@ -136995,8 +136995,8 @@ _contig_cast_long_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_short\n");*/ @@ -137169,8 +137169,8 @@ _aligned_cast_long_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_int\n");*/ @@ -137339,8 +137339,8 @@ _cast_long_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_int\n");*/ @@ -137509,8 +137509,8 @@ _aligned_contig_cast_long_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_int\n");*/ @@ -137679,8 +137679,8 @@ _contig_cast_long_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_int\n");*/ @@ -137853,8 +137853,8 @@ _aligned_cast_long_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_long\n");*/ @@ -138023,8 +138023,8 @@ _cast_long_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_long\n");*/ @@ -138193,8 +138193,8 @@ _aligned_contig_cast_long_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_long\n");*/ @@ -138363,8 +138363,8 @@ _contig_cast_long_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_long\n");*/ @@ -138537,8 +138537,8 @@ _aligned_cast_long_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_longlong\n");*/ @@ -138707,8 +138707,8 @@ _cast_long_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_longlong\n");*/ @@ -138877,8 +138877,8 @@ _aligned_contig_cast_long_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_longlong\n");*/ @@ -139047,8 +139047,8 @@ _contig_cast_long_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_longlong\n");*/ @@ -139221,8 +139221,8 @@ _aligned_cast_long_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_half\n");*/ @@ -139391,8 +139391,8 @@ _cast_long_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_half\n");*/ @@ -139561,8 +139561,8 @@ _aligned_contig_cast_long_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_half\n");*/ @@ -139731,8 +139731,8 @@ _contig_cast_long_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_half\n");*/ @@ -139905,8 +139905,8 @@ _aligned_cast_long_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_float\n");*/ @@ -140075,8 +140075,8 @@ _cast_long_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_float\n");*/ @@ -140245,8 +140245,8 @@ _aligned_contig_cast_long_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_float\n");*/ @@ -140415,8 +140415,8 @@ _contig_cast_long_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_float\n");*/ @@ -140589,8 +140589,8 @@ _aligned_cast_long_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_double\n");*/ @@ -140759,8 +140759,8 @@ _cast_long_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_double\n");*/ @@ -140929,8 +140929,8 @@ _aligned_contig_cast_long_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_double\n");*/ @@ -141099,8 +141099,8 @@ _contig_cast_long_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_double\n");*/ @@ -141273,8 +141273,8 @@ _aligned_cast_long_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_longdouble\n");*/ @@ -141443,8 +141443,8 @@ _cast_long_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_longdouble\n");*/ @@ -141613,8 +141613,8 @@ _aligned_contig_cast_long_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_longdouble\n");*/ @@ -141783,8 +141783,8 @@ _contig_cast_long_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_longdouble\n");*/ @@ -141957,8 +141957,8 @@ _aligned_cast_long_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_cfloat\n");*/ @@ -142127,8 +142127,8 @@ _cast_long_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_cfloat\n");*/ @@ -142297,8 +142297,8 @@ _aligned_contig_cast_long_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_cfloat\n");*/ @@ -142467,8 +142467,8 @@ _contig_cast_long_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_cfloat\n");*/ @@ -142641,8 +142641,8 @@ _aligned_cast_long_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_cdouble\n");*/ @@ -142811,8 +142811,8 @@ _cast_long_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_cdouble\n");*/ @@ -142981,8 +142981,8 @@ _aligned_contig_cast_long_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_cdouble\n");*/ @@ -143151,8 +143151,8 @@ _contig_cast_long_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_cdouble\n");*/ @@ -143325,8 +143325,8 @@ _aligned_cast_long_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_long_to_clongdouble\n");*/ @@ -143495,8 +143495,8 @@ _cast_long_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_long_to_clongdouble\n");*/ @@ -143665,8 +143665,8 @@ _aligned_contig_cast_long_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_long_to_clongdouble\n");*/ @@ -143835,8 +143835,8 @@ _contig_cast_long_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_long_to_clongdouble\n");*/ @@ -144013,8 +144013,8 @@ _aligned_cast_longlong_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_bool\n");*/ @@ -144183,8 +144183,8 @@ _cast_longlong_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_bool\n");*/ @@ -144353,8 +144353,8 @@ _aligned_contig_cast_longlong_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_bool\n");*/ @@ -144523,8 +144523,8 @@ _contig_cast_longlong_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_bool\n");*/ @@ -144697,8 +144697,8 @@ _aligned_cast_longlong_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_ubyte\n");*/ @@ -144867,8 +144867,8 @@ _cast_longlong_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_ubyte\n");*/ @@ -145037,8 +145037,8 @@ _aligned_contig_cast_longlong_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_ubyte\n");*/ @@ -145207,8 +145207,8 @@ _contig_cast_longlong_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_ubyte\n");*/ @@ -145381,8 +145381,8 @@ _aligned_cast_longlong_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_ushort\n");*/ @@ -145551,8 +145551,8 @@ _cast_longlong_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_ushort\n");*/ @@ -145721,8 +145721,8 @@ _aligned_contig_cast_longlong_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_ushort\n");*/ @@ -145891,8 +145891,8 @@ _contig_cast_longlong_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_ushort\n");*/ @@ -146065,8 +146065,8 @@ _aligned_cast_longlong_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_uint\n");*/ @@ -146235,8 +146235,8 @@ _cast_longlong_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_uint\n");*/ @@ -146405,8 +146405,8 @@ _aligned_contig_cast_longlong_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_uint\n");*/ @@ -146575,8 +146575,8 @@ _contig_cast_longlong_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_uint\n");*/ @@ -146749,8 +146749,8 @@ _aligned_cast_longlong_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_ulong\n");*/ @@ -146919,8 +146919,8 @@ _cast_longlong_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_ulong\n");*/ @@ -147089,8 +147089,8 @@ _aligned_contig_cast_longlong_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_ulong\n");*/ @@ -147259,8 +147259,8 @@ _contig_cast_longlong_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_ulong\n");*/ @@ -147433,8 +147433,8 @@ _aligned_cast_longlong_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_ulonglong\n");*/ @@ -147603,8 +147603,8 @@ _cast_longlong_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_ulonglong\n");*/ @@ -147773,8 +147773,8 @@ _aligned_contig_cast_longlong_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_ulonglong\n");*/ @@ -147943,8 +147943,8 @@ _contig_cast_longlong_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_ulonglong\n");*/ @@ -148117,8 +148117,8 @@ _aligned_cast_longlong_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_byte\n");*/ @@ -148287,8 +148287,8 @@ _cast_longlong_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_byte\n");*/ @@ -148457,8 +148457,8 @@ _aligned_contig_cast_longlong_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_byte\n");*/ @@ -148627,8 +148627,8 @@ _contig_cast_longlong_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_byte\n");*/ @@ -148801,8 +148801,8 @@ _aligned_cast_longlong_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_short\n");*/ @@ -148971,8 +148971,8 @@ _cast_longlong_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_short\n");*/ @@ -149141,8 +149141,8 @@ _aligned_contig_cast_longlong_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_short\n");*/ @@ -149311,8 +149311,8 @@ _contig_cast_longlong_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_short\n");*/ @@ -149485,8 +149485,8 @@ _aligned_cast_longlong_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_int\n");*/ @@ -149655,8 +149655,8 @@ _cast_longlong_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_int\n");*/ @@ -149825,8 +149825,8 @@ _aligned_contig_cast_longlong_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_int\n");*/ @@ -149995,8 +149995,8 @@ _contig_cast_longlong_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_int\n");*/ @@ -150169,8 +150169,8 @@ _aligned_cast_longlong_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_long\n");*/ @@ -150339,8 +150339,8 @@ _cast_longlong_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_long\n");*/ @@ -150509,8 +150509,8 @@ _aligned_contig_cast_longlong_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_long\n");*/ @@ -150679,8 +150679,8 @@ _contig_cast_longlong_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_long\n");*/ @@ -150853,8 +150853,8 @@ _aligned_cast_longlong_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_longlong\n");*/ @@ -151023,8 +151023,8 @@ _cast_longlong_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_longlong\n");*/ @@ -151193,8 +151193,8 @@ _aligned_contig_cast_longlong_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_longlong\n");*/ @@ -151363,8 +151363,8 @@ _contig_cast_longlong_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_longlong\n");*/ @@ -151537,8 +151537,8 @@ _aligned_cast_longlong_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_half\n");*/ @@ -151707,8 +151707,8 @@ _cast_longlong_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_half\n");*/ @@ -151877,8 +151877,8 @@ _aligned_contig_cast_longlong_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_half\n");*/ @@ -152047,8 +152047,8 @@ _contig_cast_longlong_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_half\n");*/ @@ -152221,8 +152221,8 @@ _aligned_cast_longlong_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_float\n");*/ @@ -152391,8 +152391,8 @@ _cast_longlong_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_float\n");*/ @@ -152561,8 +152561,8 @@ _aligned_contig_cast_longlong_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_float\n");*/ @@ -152731,8 +152731,8 @@ _contig_cast_longlong_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_float\n");*/ @@ -152905,8 +152905,8 @@ _aligned_cast_longlong_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_double\n");*/ @@ -153075,8 +153075,8 @@ _cast_longlong_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_double\n");*/ @@ -153245,8 +153245,8 @@ _aligned_contig_cast_longlong_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_double\n");*/ @@ -153415,8 +153415,8 @@ _contig_cast_longlong_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_double\n");*/ @@ -153589,8 +153589,8 @@ _aligned_cast_longlong_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_longdouble\n");*/ @@ -153759,8 +153759,8 @@ _cast_longlong_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_longdouble\n");*/ @@ -153929,8 +153929,8 @@ _aligned_contig_cast_longlong_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_longdouble\n");*/ @@ -154099,8 +154099,8 @@ _contig_cast_longlong_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_longdouble\n");*/ @@ -154273,8 +154273,8 @@ _aligned_cast_longlong_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_cfloat\n");*/ @@ -154443,8 +154443,8 @@ _cast_longlong_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_cfloat\n");*/ @@ -154613,8 +154613,8 @@ _aligned_contig_cast_longlong_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_cfloat\n");*/ @@ -154783,8 +154783,8 @@ _contig_cast_longlong_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_cfloat\n");*/ @@ -154957,8 +154957,8 @@ _aligned_cast_longlong_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_cdouble\n");*/ @@ -155127,8 +155127,8 @@ _cast_longlong_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_cdouble\n");*/ @@ -155297,8 +155297,8 @@ _aligned_contig_cast_longlong_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_cdouble\n");*/ @@ -155467,8 +155467,8 @@ _contig_cast_longlong_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_cdouble\n");*/ @@ -155641,8 +155641,8 @@ _aligned_cast_longlong_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longlong_to_clongdouble\n");*/ @@ -155811,8 +155811,8 @@ _cast_longlong_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longlong_to_clongdouble\n");*/ @@ -155981,8 +155981,8 @@ _aligned_contig_cast_longlong_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longlong_to_clongdouble\n");*/ @@ -156151,8 +156151,8 @@ _contig_cast_longlong_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longlong_to_clongdouble\n");*/ @@ -156329,8 +156329,8 @@ _aligned_cast_half_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_bool\n");*/ @@ -156499,8 +156499,8 @@ _cast_half_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_bool\n");*/ @@ -156669,8 +156669,8 @@ _aligned_contig_cast_half_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_bool\n");*/ @@ -156839,8 +156839,8 @@ _contig_cast_half_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_bool\n");*/ @@ -157013,8 +157013,8 @@ _aligned_cast_half_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_ubyte\n");*/ @@ -157183,8 +157183,8 @@ _cast_half_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_ubyte\n");*/ @@ -157353,8 +157353,8 @@ _aligned_contig_cast_half_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_ubyte\n");*/ @@ -157523,8 +157523,8 @@ _contig_cast_half_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_ubyte\n");*/ @@ -157697,8 +157697,8 @@ _aligned_cast_half_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_ushort\n");*/ @@ -157867,8 +157867,8 @@ _cast_half_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_ushort\n");*/ @@ -158037,8 +158037,8 @@ _aligned_contig_cast_half_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_ushort\n");*/ @@ -158207,8 +158207,8 @@ _contig_cast_half_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_ushort\n");*/ @@ -158381,8 +158381,8 @@ _aligned_cast_half_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_uint\n");*/ @@ -158551,8 +158551,8 @@ _cast_half_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_uint\n");*/ @@ -158721,8 +158721,8 @@ _aligned_contig_cast_half_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_uint\n");*/ @@ -158891,8 +158891,8 @@ _contig_cast_half_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_uint\n");*/ @@ -159065,8 +159065,8 @@ _aligned_cast_half_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_ulong\n");*/ @@ -159235,8 +159235,8 @@ _cast_half_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_ulong\n");*/ @@ -159405,8 +159405,8 @@ _aligned_contig_cast_half_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_ulong\n");*/ @@ -159575,8 +159575,8 @@ _contig_cast_half_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_ulong\n");*/ @@ -159749,8 +159749,8 @@ _aligned_cast_half_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_ulonglong\n");*/ @@ -159919,8 +159919,8 @@ _cast_half_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_ulonglong\n");*/ @@ -160089,8 +160089,8 @@ _aligned_contig_cast_half_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_ulonglong\n");*/ @@ -160259,8 +160259,8 @@ _contig_cast_half_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_ulonglong\n");*/ @@ -160433,8 +160433,8 @@ _aligned_cast_half_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_byte\n");*/ @@ -160603,8 +160603,8 @@ _cast_half_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_byte\n");*/ @@ -160773,8 +160773,8 @@ _aligned_contig_cast_half_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_byte\n");*/ @@ -160943,8 +160943,8 @@ _contig_cast_half_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_byte\n");*/ @@ -161117,8 +161117,8 @@ _aligned_cast_half_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_short\n");*/ @@ -161287,8 +161287,8 @@ _cast_half_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_short\n");*/ @@ -161457,8 +161457,8 @@ _aligned_contig_cast_half_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_short\n");*/ @@ -161627,8 +161627,8 @@ _contig_cast_half_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_short\n");*/ @@ -161801,8 +161801,8 @@ _aligned_cast_half_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_int\n");*/ @@ -161971,8 +161971,8 @@ _cast_half_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_int\n");*/ @@ -162141,8 +162141,8 @@ _aligned_contig_cast_half_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_int\n");*/ @@ -162311,8 +162311,8 @@ _contig_cast_half_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_int\n");*/ @@ -162485,8 +162485,8 @@ _aligned_cast_half_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_long\n");*/ @@ -162655,8 +162655,8 @@ _cast_half_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_long\n");*/ @@ -162825,8 +162825,8 @@ _aligned_contig_cast_half_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_long\n");*/ @@ -162995,8 +162995,8 @@ _contig_cast_half_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_long\n");*/ @@ -163169,8 +163169,8 @@ _aligned_cast_half_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_longlong\n");*/ @@ -163339,8 +163339,8 @@ _cast_half_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_longlong\n");*/ @@ -163509,8 +163509,8 @@ _aligned_contig_cast_half_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_longlong\n");*/ @@ -163679,8 +163679,8 @@ _contig_cast_half_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_longlong\n");*/ @@ -163853,8 +163853,8 @@ _aligned_cast_half_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_half\n");*/ @@ -164023,8 +164023,8 @@ _cast_half_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_half\n");*/ @@ -164193,8 +164193,8 @@ _aligned_contig_cast_half_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_half\n");*/ @@ -164363,8 +164363,8 @@ _contig_cast_half_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_half\n");*/ @@ -164537,8 +164537,8 @@ _aligned_cast_half_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_float\n");*/ @@ -164707,8 +164707,8 @@ _cast_half_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_float\n");*/ @@ -164877,8 +164877,8 @@ _aligned_contig_cast_half_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_float\n");*/ @@ -165047,8 +165047,8 @@ _contig_cast_half_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_float\n");*/ @@ -165221,8 +165221,8 @@ _aligned_cast_half_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_double\n");*/ @@ -165391,8 +165391,8 @@ _cast_half_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_double\n");*/ @@ -165561,8 +165561,8 @@ _aligned_contig_cast_half_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_double\n");*/ @@ -165731,8 +165731,8 @@ _contig_cast_half_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_double\n");*/ @@ -165905,8 +165905,8 @@ _aligned_cast_half_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_longdouble\n");*/ @@ -166075,8 +166075,8 @@ _cast_half_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_longdouble\n");*/ @@ -166245,8 +166245,8 @@ _aligned_contig_cast_half_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_longdouble\n");*/ @@ -166415,8 +166415,8 @@ _contig_cast_half_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_longdouble\n");*/ @@ -166589,8 +166589,8 @@ _aligned_cast_half_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_cfloat\n");*/ @@ -166759,8 +166759,8 @@ _cast_half_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_cfloat\n");*/ @@ -166929,8 +166929,8 @@ _aligned_contig_cast_half_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_cfloat\n");*/ @@ -167099,8 +167099,8 @@ _contig_cast_half_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_cfloat\n");*/ @@ -167273,8 +167273,8 @@ _aligned_cast_half_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_cdouble\n");*/ @@ -167443,8 +167443,8 @@ _cast_half_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_cdouble\n");*/ @@ -167613,8 +167613,8 @@ _aligned_contig_cast_half_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_cdouble\n");*/ @@ -167783,8 +167783,8 @@ _contig_cast_half_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_cdouble\n");*/ @@ -167957,8 +167957,8 @@ _aligned_cast_half_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_half_to_clongdouble\n");*/ @@ -168127,8 +168127,8 @@ _cast_half_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_half_to_clongdouble\n");*/ @@ -168297,8 +168297,8 @@ _aligned_contig_cast_half_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_half_to_clongdouble\n");*/ @@ -168467,8 +168467,8 @@ _contig_cast_half_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_half_to_clongdouble\n");*/ @@ -168645,8 +168645,8 @@ _aligned_cast_float_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_bool\n");*/ @@ -168815,8 +168815,8 @@ _cast_float_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_bool\n");*/ @@ -168985,8 +168985,8 @@ _aligned_contig_cast_float_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_bool\n");*/ @@ -169155,8 +169155,8 @@ _contig_cast_float_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_bool\n");*/ @@ -169329,8 +169329,8 @@ _aligned_cast_float_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_ubyte\n");*/ @@ -169499,8 +169499,8 @@ _cast_float_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_ubyte\n");*/ @@ -169669,8 +169669,8 @@ _aligned_contig_cast_float_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_ubyte\n");*/ @@ -169839,8 +169839,8 @@ _contig_cast_float_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_ubyte\n");*/ @@ -170013,8 +170013,8 @@ _aligned_cast_float_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_ushort\n");*/ @@ -170183,8 +170183,8 @@ _cast_float_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_ushort\n");*/ @@ -170353,8 +170353,8 @@ _aligned_contig_cast_float_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_ushort\n");*/ @@ -170523,8 +170523,8 @@ _contig_cast_float_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_ushort\n");*/ @@ -170697,8 +170697,8 @@ _aligned_cast_float_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_uint\n");*/ @@ -170867,8 +170867,8 @@ _cast_float_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_uint\n");*/ @@ -171037,8 +171037,8 @@ _aligned_contig_cast_float_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_uint\n");*/ @@ -171207,8 +171207,8 @@ _contig_cast_float_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_uint\n");*/ @@ -171381,8 +171381,8 @@ _aligned_cast_float_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_ulong\n");*/ @@ -171551,8 +171551,8 @@ _cast_float_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_ulong\n");*/ @@ -171721,8 +171721,8 @@ _aligned_contig_cast_float_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_ulong\n");*/ @@ -171891,8 +171891,8 @@ _contig_cast_float_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_ulong\n");*/ @@ -172065,8 +172065,8 @@ _aligned_cast_float_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_ulonglong\n");*/ @@ -172235,8 +172235,8 @@ _cast_float_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_ulonglong\n");*/ @@ -172405,8 +172405,8 @@ _aligned_contig_cast_float_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_ulonglong\n");*/ @@ -172575,8 +172575,8 @@ _contig_cast_float_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_ulonglong\n");*/ @@ -172749,8 +172749,8 @@ _aligned_cast_float_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_byte\n");*/ @@ -172919,8 +172919,8 @@ _cast_float_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_byte\n");*/ @@ -173089,8 +173089,8 @@ _aligned_contig_cast_float_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_byte\n");*/ @@ -173259,8 +173259,8 @@ _contig_cast_float_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_byte\n");*/ @@ -173433,8 +173433,8 @@ _aligned_cast_float_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_short\n");*/ @@ -173603,8 +173603,8 @@ _cast_float_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_short\n");*/ @@ -173773,8 +173773,8 @@ _aligned_contig_cast_float_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_short\n");*/ @@ -173943,8 +173943,8 @@ _contig_cast_float_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_short\n");*/ @@ -174117,8 +174117,8 @@ _aligned_cast_float_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_int\n");*/ @@ -174287,8 +174287,8 @@ _cast_float_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_int\n");*/ @@ -174457,8 +174457,8 @@ _aligned_contig_cast_float_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_int\n");*/ @@ -174627,8 +174627,8 @@ _contig_cast_float_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_int\n");*/ @@ -174801,8 +174801,8 @@ _aligned_cast_float_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_long\n");*/ @@ -174971,8 +174971,8 @@ _cast_float_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_long\n");*/ @@ -175141,8 +175141,8 @@ _aligned_contig_cast_float_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_long\n");*/ @@ -175311,8 +175311,8 @@ _contig_cast_float_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_long\n");*/ @@ -175485,8 +175485,8 @@ _aligned_cast_float_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_longlong\n");*/ @@ -175655,8 +175655,8 @@ _cast_float_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_longlong\n");*/ @@ -175825,8 +175825,8 @@ _aligned_contig_cast_float_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_longlong\n");*/ @@ -175995,8 +175995,8 @@ _contig_cast_float_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_longlong\n");*/ @@ -176169,8 +176169,8 @@ _aligned_cast_float_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_half\n");*/ @@ -176339,8 +176339,8 @@ _cast_float_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_half\n");*/ @@ -176509,8 +176509,8 @@ _aligned_contig_cast_float_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_half\n");*/ @@ -176679,8 +176679,8 @@ _contig_cast_float_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_half\n");*/ @@ -176853,8 +176853,8 @@ _aligned_cast_float_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_float\n");*/ @@ -177023,8 +177023,8 @@ _cast_float_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_float\n");*/ @@ -177193,8 +177193,8 @@ _aligned_contig_cast_float_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_float\n");*/ @@ -177363,8 +177363,8 @@ _contig_cast_float_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_float\n");*/ @@ -177537,8 +177537,8 @@ _aligned_cast_float_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_double\n");*/ @@ -177707,8 +177707,8 @@ _cast_float_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_double\n");*/ @@ -177877,8 +177877,8 @@ _aligned_contig_cast_float_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_double\n");*/ @@ -178047,8 +178047,8 @@ _contig_cast_float_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_double\n");*/ @@ -178221,8 +178221,8 @@ _aligned_cast_float_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_longdouble\n");*/ @@ -178391,8 +178391,8 @@ _cast_float_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_longdouble\n");*/ @@ -178561,8 +178561,8 @@ _aligned_contig_cast_float_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_longdouble\n");*/ @@ -178731,8 +178731,8 @@ _contig_cast_float_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_longdouble\n");*/ @@ -178905,8 +178905,8 @@ _aligned_cast_float_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_cfloat\n");*/ @@ -179075,8 +179075,8 @@ _cast_float_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_cfloat\n");*/ @@ -179245,8 +179245,8 @@ _aligned_contig_cast_float_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_cfloat\n");*/ @@ -179415,8 +179415,8 @@ _contig_cast_float_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_cfloat\n");*/ @@ -179589,8 +179589,8 @@ _aligned_cast_float_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_cdouble\n");*/ @@ -179759,8 +179759,8 @@ _cast_float_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_cdouble\n");*/ @@ -179929,8 +179929,8 @@ _aligned_contig_cast_float_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_cdouble\n");*/ @@ -180099,8 +180099,8 @@ _contig_cast_float_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_cdouble\n");*/ @@ -180273,8 +180273,8 @@ _aligned_cast_float_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_float_to_clongdouble\n");*/ @@ -180443,8 +180443,8 @@ _cast_float_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_float_to_clongdouble\n");*/ @@ -180613,8 +180613,8 @@ _aligned_contig_cast_float_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_float_to_clongdouble\n");*/ @@ -180783,8 +180783,8 @@ _contig_cast_float_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_float_to_clongdouble\n");*/ @@ -180961,8 +180961,8 @@ _aligned_cast_double_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_bool\n");*/ @@ -181131,8 +181131,8 @@ _cast_double_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_bool\n");*/ @@ -181301,8 +181301,8 @@ _aligned_contig_cast_double_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_bool\n");*/ @@ -181471,8 +181471,8 @@ _contig_cast_double_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_bool\n");*/ @@ -181645,8 +181645,8 @@ _aligned_cast_double_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_ubyte\n");*/ @@ -181815,8 +181815,8 @@ _cast_double_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_ubyte\n");*/ @@ -181985,8 +181985,8 @@ _aligned_contig_cast_double_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_ubyte\n");*/ @@ -182155,8 +182155,8 @@ _contig_cast_double_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_ubyte\n");*/ @@ -182329,8 +182329,8 @@ _aligned_cast_double_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_ushort\n");*/ @@ -182499,8 +182499,8 @@ _cast_double_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_ushort\n");*/ @@ -182669,8 +182669,8 @@ _aligned_contig_cast_double_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_ushort\n");*/ @@ -182839,8 +182839,8 @@ _contig_cast_double_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_ushort\n");*/ @@ -183013,8 +183013,8 @@ _aligned_cast_double_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_uint\n");*/ @@ -183183,8 +183183,8 @@ _cast_double_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_uint\n");*/ @@ -183353,8 +183353,8 @@ _aligned_contig_cast_double_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_uint\n");*/ @@ -183523,8 +183523,8 @@ _contig_cast_double_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_uint\n");*/ @@ -183697,8 +183697,8 @@ _aligned_cast_double_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_ulong\n");*/ @@ -183867,8 +183867,8 @@ _cast_double_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_ulong\n");*/ @@ -184037,8 +184037,8 @@ _aligned_contig_cast_double_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_ulong\n");*/ @@ -184207,8 +184207,8 @@ _contig_cast_double_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_ulong\n");*/ @@ -184381,8 +184381,8 @@ _aligned_cast_double_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_ulonglong\n");*/ @@ -184551,8 +184551,8 @@ _cast_double_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_ulonglong\n");*/ @@ -184721,8 +184721,8 @@ _aligned_contig_cast_double_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_ulonglong\n");*/ @@ -184891,8 +184891,8 @@ _contig_cast_double_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_ulonglong\n");*/ @@ -185065,8 +185065,8 @@ _aligned_cast_double_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_byte\n");*/ @@ -185235,8 +185235,8 @@ _cast_double_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_byte\n");*/ @@ -185405,8 +185405,8 @@ _aligned_contig_cast_double_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_byte\n");*/ @@ -185575,8 +185575,8 @@ _contig_cast_double_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_byte\n");*/ @@ -185749,8 +185749,8 @@ _aligned_cast_double_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_short\n");*/ @@ -185919,8 +185919,8 @@ _cast_double_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_short\n");*/ @@ -186089,8 +186089,8 @@ _aligned_contig_cast_double_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_short\n");*/ @@ -186259,8 +186259,8 @@ _contig_cast_double_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_short\n");*/ @@ -186433,8 +186433,8 @@ _aligned_cast_double_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_int\n");*/ @@ -186603,8 +186603,8 @@ _cast_double_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_int\n");*/ @@ -186773,8 +186773,8 @@ _aligned_contig_cast_double_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_int\n");*/ @@ -186943,8 +186943,8 @@ _contig_cast_double_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_int\n");*/ @@ -187117,8 +187117,8 @@ _aligned_cast_double_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_long\n");*/ @@ -187287,8 +187287,8 @@ _cast_double_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_long\n");*/ @@ -187457,8 +187457,8 @@ _aligned_contig_cast_double_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_long\n");*/ @@ -187627,8 +187627,8 @@ _contig_cast_double_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_long\n");*/ @@ -187801,8 +187801,8 @@ _aligned_cast_double_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_longlong\n");*/ @@ -187971,8 +187971,8 @@ _cast_double_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_longlong\n");*/ @@ -188141,8 +188141,8 @@ _aligned_contig_cast_double_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_longlong\n");*/ @@ -188311,8 +188311,8 @@ _contig_cast_double_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_longlong\n");*/ @@ -188485,8 +188485,8 @@ _aligned_cast_double_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_half\n");*/ @@ -188655,8 +188655,8 @@ _cast_double_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_half\n");*/ @@ -188825,8 +188825,8 @@ _aligned_contig_cast_double_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_half\n");*/ @@ -188995,8 +188995,8 @@ _contig_cast_double_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_half\n");*/ @@ -189169,8 +189169,8 @@ _aligned_cast_double_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_float\n");*/ @@ -189339,8 +189339,8 @@ _cast_double_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_float\n");*/ @@ -189509,8 +189509,8 @@ _aligned_contig_cast_double_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_float\n");*/ @@ -189679,8 +189679,8 @@ _contig_cast_double_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_float\n");*/ @@ -189853,8 +189853,8 @@ _aligned_cast_double_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_double\n");*/ @@ -190023,8 +190023,8 @@ _cast_double_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_double\n");*/ @@ -190193,8 +190193,8 @@ _aligned_contig_cast_double_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_double\n");*/ @@ -190363,8 +190363,8 @@ _contig_cast_double_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_double\n");*/ @@ -190537,8 +190537,8 @@ _aligned_cast_double_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_longdouble\n");*/ @@ -190707,8 +190707,8 @@ _cast_double_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_longdouble\n");*/ @@ -190877,8 +190877,8 @@ _aligned_contig_cast_double_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_longdouble\n");*/ @@ -191047,8 +191047,8 @@ _contig_cast_double_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_longdouble\n");*/ @@ -191221,8 +191221,8 @@ _aligned_cast_double_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_cfloat\n");*/ @@ -191391,8 +191391,8 @@ _cast_double_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_cfloat\n");*/ @@ -191561,8 +191561,8 @@ _aligned_contig_cast_double_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_cfloat\n");*/ @@ -191731,8 +191731,8 @@ _contig_cast_double_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_cfloat\n");*/ @@ -191905,8 +191905,8 @@ _aligned_cast_double_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_cdouble\n");*/ @@ -192075,8 +192075,8 @@ _cast_double_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_cdouble\n");*/ @@ -192245,8 +192245,8 @@ _aligned_contig_cast_double_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_cdouble\n");*/ @@ -192415,8 +192415,8 @@ _contig_cast_double_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_cdouble\n");*/ @@ -192589,8 +192589,8 @@ _aligned_cast_double_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_double_to_clongdouble\n");*/ @@ -192759,8 +192759,8 @@ _cast_double_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_double_to_clongdouble\n");*/ @@ -192929,8 +192929,8 @@ _aligned_contig_cast_double_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_double_to_clongdouble\n");*/ @@ -193099,8 +193099,8 @@ _contig_cast_double_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_double_to_clongdouble\n");*/ @@ -193277,8 +193277,8 @@ _aligned_cast_longdouble_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_bool\n");*/ @@ -193447,8 +193447,8 @@ _cast_longdouble_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_bool\n");*/ @@ -193617,8 +193617,8 @@ _aligned_contig_cast_longdouble_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_bool\n");*/ @@ -193787,8 +193787,8 @@ _contig_cast_longdouble_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_bool\n");*/ @@ -193961,8 +193961,8 @@ _aligned_cast_longdouble_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_ubyte\n");*/ @@ -194131,8 +194131,8 @@ _cast_longdouble_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_ubyte\n");*/ @@ -194301,8 +194301,8 @@ _aligned_contig_cast_longdouble_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_ubyte\n");*/ @@ -194471,8 +194471,8 @@ _contig_cast_longdouble_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_ubyte\n");*/ @@ -194645,8 +194645,8 @@ _aligned_cast_longdouble_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_ushort\n");*/ @@ -194815,8 +194815,8 @@ _cast_longdouble_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_ushort\n");*/ @@ -194985,8 +194985,8 @@ _aligned_contig_cast_longdouble_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_ushort\n");*/ @@ -195155,8 +195155,8 @@ _contig_cast_longdouble_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_ushort\n");*/ @@ -195329,8 +195329,8 @@ _aligned_cast_longdouble_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_uint\n");*/ @@ -195499,8 +195499,8 @@ _cast_longdouble_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_uint\n");*/ @@ -195669,8 +195669,8 @@ _aligned_contig_cast_longdouble_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_uint\n");*/ @@ -195839,8 +195839,8 @@ _contig_cast_longdouble_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_uint\n");*/ @@ -196013,8 +196013,8 @@ _aligned_cast_longdouble_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_ulong\n");*/ @@ -196183,8 +196183,8 @@ _cast_longdouble_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_ulong\n");*/ @@ -196353,8 +196353,8 @@ _aligned_contig_cast_longdouble_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_ulong\n");*/ @@ -196523,8 +196523,8 @@ _contig_cast_longdouble_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_ulong\n");*/ @@ -196697,8 +196697,8 @@ _aligned_cast_longdouble_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_ulonglong\n");*/ @@ -196867,8 +196867,8 @@ _cast_longdouble_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_ulonglong\n");*/ @@ -197037,8 +197037,8 @@ _aligned_contig_cast_longdouble_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_ulonglong\n");*/ @@ -197207,8 +197207,8 @@ _contig_cast_longdouble_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_ulonglong\n");*/ @@ -197381,8 +197381,8 @@ _aligned_cast_longdouble_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_byte\n");*/ @@ -197551,8 +197551,8 @@ _cast_longdouble_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_byte\n");*/ @@ -197721,8 +197721,8 @@ _aligned_contig_cast_longdouble_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_byte\n");*/ @@ -197891,8 +197891,8 @@ _contig_cast_longdouble_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_byte\n");*/ @@ -198065,8 +198065,8 @@ _aligned_cast_longdouble_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_short\n");*/ @@ -198235,8 +198235,8 @@ _cast_longdouble_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_short\n");*/ @@ -198405,8 +198405,8 @@ _aligned_contig_cast_longdouble_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_short\n");*/ @@ -198575,8 +198575,8 @@ _contig_cast_longdouble_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_short\n");*/ @@ -198749,8 +198749,8 @@ _aligned_cast_longdouble_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_int\n");*/ @@ -198919,8 +198919,8 @@ _cast_longdouble_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_int\n");*/ @@ -199089,8 +199089,8 @@ _aligned_contig_cast_longdouble_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_int\n");*/ @@ -199259,8 +199259,8 @@ _contig_cast_longdouble_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_int\n");*/ @@ -199433,8 +199433,8 @@ _aligned_cast_longdouble_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_long\n");*/ @@ -199603,8 +199603,8 @@ _cast_longdouble_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_long\n");*/ @@ -199773,8 +199773,8 @@ _aligned_contig_cast_longdouble_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_long\n");*/ @@ -199943,8 +199943,8 @@ _contig_cast_longdouble_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_long\n");*/ @@ -200117,8 +200117,8 @@ _aligned_cast_longdouble_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_longlong\n");*/ @@ -200287,8 +200287,8 @@ _cast_longdouble_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_longlong\n");*/ @@ -200457,8 +200457,8 @@ _aligned_contig_cast_longdouble_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_longlong\n");*/ @@ -200627,8 +200627,8 @@ _contig_cast_longdouble_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_longlong\n");*/ @@ -200801,8 +200801,8 @@ _aligned_cast_longdouble_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_half\n");*/ @@ -200971,8 +200971,8 @@ _cast_longdouble_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_half\n");*/ @@ -201141,8 +201141,8 @@ _aligned_contig_cast_longdouble_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_half\n");*/ @@ -201311,8 +201311,8 @@ _contig_cast_longdouble_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_half\n");*/ @@ -201485,8 +201485,8 @@ _aligned_cast_longdouble_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_float\n");*/ @@ -201655,8 +201655,8 @@ _cast_longdouble_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_float\n");*/ @@ -201825,8 +201825,8 @@ _aligned_contig_cast_longdouble_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_float\n");*/ @@ -201995,8 +201995,8 @@ _contig_cast_longdouble_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_float\n");*/ @@ -202169,8 +202169,8 @@ _aligned_cast_longdouble_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_double\n");*/ @@ -202339,8 +202339,8 @@ _cast_longdouble_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_double\n");*/ @@ -202509,8 +202509,8 @@ _aligned_contig_cast_longdouble_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_double\n");*/ @@ -202679,8 +202679,8 @@ _contig_cast_longdouble_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_double\n");*/ @@ -202853,8 +202853,8 @@ _aligned_cast_longdouble_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_longdouble\n");*/ @@ -203023,8 +203023,8 @@ _cast_longdouble_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_longdouble\n");*/ @@ -203193,8 +203193,8 @@ _aligned_contig_cast_longdouble_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_longdouble\n");*/ @@ -203363,8 +203363,8 @@ _contig_cast_longdouble_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_longdouble\n");*/ @@ -203537,8 +203537,8 @@ _aligned_cast_longdouble_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_cfloat\n");*/ @@ -203707,8 +203707,8 @@ _cast_longdouble_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_cfloat\n");*/ @@ -203877,8 +203877,8 @@ _aligned_contig_cast_longdouble_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_cfloat\n");*/ @@ -204047,8 +204047,8 @@ _contig_cast_longdouble_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_cfloat\n");*/ @@ -204221,8 +204221,8 @@ _aligned_cast_longdouble_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_cdouble\n");*/ @@ -204391,8 +204391,8 @@ _cast_longdouble_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_cdouble\n");*/ @@ -204561,8 +204561,8 @@ _aligned_contig_cast_longdouble_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_cdouble\n");*/ @@ -204731,8 +204731,8 @@ _contig_cast_longdouble_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_cdouble\n");*/ @@ -204905,8 +204905,8 @@ _aligned_cast_longdouble_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_longdouble_to_clongdouble\n");*/ @@ -205075,8 +205075,8 @@ _cast_longdouble_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_longdouble_to_clongdouble\n");*/ @@ -205245,8 +205245,8 @@ _aligned_contig_cast_longdouble_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_longdouble_to_clongdouble\n");*/ @@ -205415,8 +205415,8 @@ _contig_cast_longdouble_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_longdouble_to_clongdouble\n");*/ @@ -205593,8 +205593,8 @@ _aligned_cast_cfloat_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_bool\n");*/ @@ -205763,8 +205763,8 @@ _cast_cfloat_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_bool\n");*/ @@ -205933,8 +205933,8 @@ _aligned_contig_cast_cfloat_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_bool\n");*/ @@ -206103,8 +206103,8 @@ _contig_cast_cfloat_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_bool\n");*/ @@ -206277,8 +206277,8 @@ _aligned_cast_cfloat_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_ubyte\n");*/ @@ -206447,8 +206447,8 @@ _cast_cfloat_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_ubyte\n");*/ @@ -206617,8 +206617,8 @@ _aligned_contig_cast_cfloat_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_ubyte\n");*/ @@ -206787,8 +206787,8 @@ _contig_cast_cfloat_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_ubyte\n");*/ @@ -206961,8 +206961,8 @@ _aligned_cast_cfloat_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_ushort\n");*/ @@ -207131,8 +207131,8 @@ _cast_cfloat_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_ushort\n");*/ @@ -207301,8 +207301,8 @@ _aligned_contig_cast_cfloat_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_ushort\n");*/ @@ -207471,8 +207471,8 @@ _contig_cast_cfloat_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_ushort\n");*/ @@ -207645,8 +207645,8 @@ _aligned_cast_cfloat_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_uint\n");*/ @@ -207815,8 +207815,8 @@ _cast_cfloat_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_uint\n");*/ @@ -207985,8 +207985,8 @@ _aligned_contig_cast_cfloat_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_uint\n");*/ @@ -208155,8 +208155,8 @@ _contig_cast_cfloat_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_uint\n");*/ @@ -208329,8 +208329,8 @@ _aligned_cast_cfloat_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_ulong\n");*/ @@ -208499,8 +208499,8 @@ _cast_cfloat_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_ulong\n");*/ @@ -208669,8 +208669,8 @@ _aligned_contig_cast_cfloat_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_ulong\n");*/ @@ -208839,8 +208839,8 @@ _contig_cast_cfloat_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_ulong\n");*/ @@ -209013,8 +209013,8 @@ _aligned_cast_cfloat_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_ulonglong\n");*/ @@ -209183,8 +209183,8 @@ _cast_cfloat_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_ulonglong\n");*/ @@ -209353,8 +209353,8 @@ _aligned_contig_cast_cfloat_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_ulonglong\n");*/ @@ -209523,8 +209523,8 @@ _contig_cast_cfloat_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_ulonglong\n");*/ @@ -209697,8 +209697,8 @@ _aligned_cast_cfloat_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_byte\n");*/ @@ -209867,8 +209867,8 @@ _cast_cfloat_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_byte\n");*/ @@ -210037,8 +210037,8 @@ _aligned_contig_cast_cfloat_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_byte\n");*/ @@ -210207,8 +210207,8 @@ _contig_cast_cfloat_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_byte\n");*/ @@ -210381,8 +210381,8 @@ _aligned_cast_cfloat_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_short\n");*/ @@ -210551,8 +210551,8 @@ _cast_cfloat_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_short\n");*/ @@ -210721,8 +210721,8 @@ _aligned_contig_cast_cfloat_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_short\n");*/ @@ -210891,8 +210891,8 @@ _contig_cast_cfloat_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_short\n");*/ @@ -211065,8 +211065,8 @@ _aligned_cast_cfloat_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_int\n");*/ @@ -211235,8 +211235,8 @@ _cast_cfloat_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_int\n");*/ @@ -211405,8 +211405,8 @@ _aligned_contig_cast_cfloat_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_int\n");*/ @@ -211575,8 +211575,8 @@ _contig_cast_cfloat_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_int\n");*/ @@ -211749,8 +211749,8 @@ _aligned_cast_cfloat_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_long\n");*/ @@ -211919,8 +211919,8 @@ _cast_cfloat_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_long\n");*/ @@ -212089,8 +212089,8 @@ _aligned_contig_cast_cfloat_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_long\n");*/ @@ -212259,8 +212259,8 @@ _contig_cast_cfloat_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_long\n");*/ @@ -212433,8 +212433,8 @@ _aligned_cast_cfloat_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_longlong\n");*/ @@ -212603,8 +212603,8 @@ _cast_cfloat_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_longlong\n");*/ @@ -212773,8 +212773,8 @@ _aligned_contig_cast_cfloat_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_longlong\n");*/ @@ -212943,8 +212943,8 @@ _contig_cast_cfloat_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_longlong\n");*/ @@ -213117,8 +213117,8 @@ _aligned_cast_cfloat_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_half\n");*/ @@ -213287,8 +213287,8 @@ _cast_cfloat_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_half\n");*/ @@ -213457,8 +213457,8 @@ _aligned_contig_cast_cfloat_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_half\n");*/ @@ -213627,8 +213627,8 @@ _contig_cast_cfloat_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_half\n");*/ @@ -213801,8 +213801,8 @@ _aligned_cast_cfloat_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_float\n");*/ @@ -213971,8 +213971,8 @@ _cast_cfloat_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_float\n");*/ @@ -214141,8 +214141,8 @@ _aligned_contig_cast_cfloat_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_float\n");*/ @@ -214311,8 +214311,8 @@ _contig_cast_cfloat_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_float\n");*/ @@ -214485,8 +214485,8 @@ _aligned_cast_cfloat_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_double\n");*/ @@ -214655,8 +214655,8 @@ _cast_cfloat_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_double\n");*/ @@ -214825,8 +214825,8 @@ _aligned_contig_cast_cfloat_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_double\n");*/ @@ -214995,8 +214995,8 @@ _contig_cast_cfloat_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_double\n");*/ @@ -215169,8 +215169,8 @@ _aligned_cast_cfloat_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_longdouble\n");*/ @@ -215339,8 +215339,8 @@ _cast_cfloat_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_longdouble\n");*/ @@ -215509,8 +215509,8 @@ _aligned_contig_cast_cfloat_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_longdouble\n");*/ @@ -215679,8 +215679,8 @@ _contig_cast_cfloat_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_longdouble\n");*/ @@ -215853,8 +215853,8 @@ _aligned_cast_cfloat_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_cfloat\n");*/ @@ -216023,8 +216023,8 @@ _cast_cfloat_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_cfloat\n");*/ @@ -216193,8 +216193,8 @@ _aligned_contig_cast_cfloat_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_cfloat\n");*/ @@ -216363,8 +216363,8 @@ _contig_cast_cfloat_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_cfloat\n");*/ @@ -216537,8 +216537,8 @@ _aligned_cast_cfloat_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_cdouble\n");*/ @@ -216707,8 +216707,8 @@ _cast_cfloat_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_cdouble\n");*/ @@ -216877,8 +216877,8 @@ _aligned_contig_cast_cfloat_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_cdouble\n");*/ @@ -217047,8 +217047,8 @@ _contig_cast_cfloat_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_cdouble\n");*/ @@ -217221,8 +217221,8 @@ _aligned_cast_cfloat_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cfloat_to_clongdouble\n");*/ @@ -217391,8 +217391,8 @@ _cast_cfloat_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cfloat_to_clongdouble\n");*/ @@ -217561,8 +217561,8 @@ _aligned_contig_cast_cfloat_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cfloat_to_clongdouble\n");*/ @@ -217731,8 +217731,8 @@ _contig_cast_cfloat_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cfloat_to_clongdouble\n");*/ @@ -217909,8 +217909,8 @@ _aligned_cast_cdouble_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_bool\n");*/ @@ -218079,8 +218079,8 @@ _cast_cdouble_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_bool\n");*/ @@ -218249,8 +218249,8 @@ _aligned_contig_cast_cdouble_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_bool\n");*/ @@ -218419,8 +218419,8 @@ _contig_cast_cdouble_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_bool\n");*/ @@ -218593,8 +218593,8 @@ _aligned_cast_cdouble_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_ubyte\n");*/ @@ -218763,8 +218763,8 @@ _cast_cdouble_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_ubyte\n");*/ @@ -218933,8 +218933,8 @@ _aligned_contig_cast_cdouble_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_ubyte\n");*/ @@ -219103,8 +219103,8 @@ _contig_cast_cdouble_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_ubyte\n");*/ @@ -219277,8 +219277,8 @@ _aligned_cast_cdouble_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_ushort\n");*/ @@ -219447,8 +219447,8 @@ _cast_cdouble_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_ushort\n");*/ @@ -219617,8 +219617,8 @@ _aligned_contig_cast_cdouble_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_ushort\n");*/ @@ -219787,8 +219787,8 @@ _contig_cast_cdouble_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_ushort\n");*/ @@ -219961,8 +219961,8 @@ _aligned_cast_cdouble_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_uint\n");*/ @@ -220131,8 +220131,8 @@ _cast_cdouble_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_uint\n");*/ @@ -220301,8 +220301,8 @@ _aligned_contig_cast_cdouble_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_uint\n");*/ @@ -220471,8 +220471,8 @@ _contig_cast_cdouble_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_uint\n");*/ @@ -220645,8 +220645,8 @@ _aligned_cast_cdouble_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_ulong\n");*/ @@ -220815,8 +220815,8 @@ _cast_cdouble_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_ulong\n");*/ @@ -220985,8 +220985,8 @@ _aligned_contig_cast_cdouble_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_ulong\n");*/ @@ -221155,8 +221155,8 @@ _contig_cast_cdouble_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_ulong\n");*/ @@ -221329,8 +221329,8 @@ _aligned_cast_cdouble_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_ulonglong\n");*/ @@ -221499,8 +221499,8 @@ _cast_cdouble_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_ulonglong\n");*/ @@ -221669,8 +221669,8 @@ _aligned_contig_cast_cdouble_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_ulonglong\n");*/ @@ -221839,8 +221839,8 @@ _contig_cast_cdouble_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_ulonglong\n");*/ @@ -222013,8 +222013,8 @@ _aligned_cast_cdouble_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_byte\n");*/ @@ -222183,8 +222183,8 @@ _cast_cdouble_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_byte\n");*/ @@ -222353,8 +222353,8 @@ _aligned_contig_cast_cdouble_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_byte\n");*/ @@ -222523,8 +222523,8 @@ _contig_cast_cdouble_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_byte\n");*/ @@ -222697,8 +222697,8 @@ _aligned_cast_cdouble_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_short\n");*/ @@ -222867,8 +222867,8 @@ _cast_cdouble_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_short\n");*/ @@ -223037,8 +223037,8 @@ _aligned_contig_cast_cdouble_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_short\n");*/ @@ -223207,8 +223207,8 @@ _contig_cast_cdouble_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_short\n");*/ @@ -223381,8 +223381,8 @@ _aligned_cast_cdouble_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_int\n");*/ @@ -223551,8 +223551,8 @@ _cast_cdouble_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_int\n");*/ @@ -223721,8 +223721,8 @@ _aligned_contig_cast_cdouble_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_int\n");*/ @@ -223891,8 +223891,8 @@ _contig_cast_cdouble_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_int\n");*/ @@ -224065,8 +224065,8 @@ _aligned_cast_cdouble_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_long\n");*/ @@ -224235,8 +224235,8 @@ _cast_cdouble_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_long\n");*/ @@ -224405,8 +224405,8 @@ _aligned_contig_cast_cdouble_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_long\n");*/ @@ -224575,8 +224575,8 @@ _contig_cast_cdouble_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_long\n");*/ @@ -224749,8 +224749,8 @@ _aligned_cast_cdouble_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_longlong\n");*/ @@ -224919,8 +224919,8 @@ _cast_cdouble_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_longlong\n");*/ @@ -225089,8 +225089,8 @@ _aligned_contig_cast_cdouble_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_longlong\n");*/ @@ -225259,8 +225259,8 @@ _contig_cast_cdouble_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_longlong\n");*/ @@ -225433,8 +225433,8 @@ _aligned_cast_cdouble_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_half\n");*/ @@ -225603,8 +225603,8 @@ _cast_cdouble_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_half\n");*/ @@ -225773,8 +225773,8 @@ _aligned_contig_cast_cdouble_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_half\n");*/ @@ -225943,8 +225943,8 @@ _contig_cast_cdouble_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_half\n");*/ @@ -226117,8 +226117,8 @@ _aligned_cast_cdouble_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_float\n");*/ @@ -226287,8 +226287,8 @@ _cast_cdouble_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_float\n");*/ @@ -226457,8 +226457,8 @@ _aligned_contig_cast_cdouble_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_float\n");*/ @@ -226627,8 +226627,8 @@ _contig_cast_cdouble_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_float\n");*/ @@ -226801,8 +226801,8 @@ _aligned_cast_cdouble_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_double\n");*/ @@ -226971,8 +226971,8 @@ _cast_cdouble_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_double\n");*/ @@ -227141,8 +227141,8 @@ _aligned_contig_cast_cdouble_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_double\n");*/ @@ -227311,8 +227311,8 @@ _contig_cast_cdouble_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_double\n");*/ @@ -227485,8 +227485,8 @@ _aligned_cast_cdouble_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_longdouble\n");*/ @@ -227655,8 +227655,8 @@ _cast_cdouble_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_longdouble\n");*/ @@ -227825,8 +227825,8 @@ _aligned_contig_cast_cdouble_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_longdouble\n");*/ @@ -227995,8 +227995,8 @@ _contig_cast_cdouble_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_longdouble\n");*/ @@ -228169,8 +228169,8 @@ _aligned_cast_cdouble_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_cfloat\n");*/ @@ -228339,8 +228339,8 @@ _cast_cdouble_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_cfloat\n");*/ @@ -228509,8 +228509,8 @@ _aligned_contig_cast_cdouble_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_cfloat\n");*/ @@ -228679,8 +228679,8 @@ _contig_cast_cdouble_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_cfloat\n");*/ @@ -228853,8 +228853,8 @@ _aligned_cast_cdouble_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_cdouble\n");*/ @@ -229023,8 +229023,8 @@ _cast_cdouble_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_cdouble\n");*/ @@ -229193,8 +229193,8 @@ _aligned_contig_cast_cdouble_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_cdouble\n");*/ @@ -229363,8 +229363,8 @@ _contig_cast_cdouble_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_cdouble\n");*/ @@ -229537,8 +229537,8 @@ _aligned_cast_cdouble_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_cdouble_to_clongdouble\n");*/ @@ -229707,8 +229707,8 @@ _cast_cdouble_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_cdouble_to_clongdouble\n");*/ @@ -229877,8 +229877,8 @@ _aligned_contig_cast_cdouble_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_cdouble_to_clongdouble\n");*/ @@ -230047,8 +230047,8 @@ _contig_cast_cdouble_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_cdouble_to_clongdouble\n");*/ @@ -230225,8 +230225,8 @@ _aligned_cast_clongdouble_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_bool\n");*/ @@ -230395,8 +230395,8 @@ _cast_clongdouble_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_bool\n");*/ @@ -230565,8 +230565,8 @@ _aligned_contig_cast_clongdouble_to_bool( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_bool\n");*/ @@ -230735,8 +230735,8 @@ _contig_cast_clongdouble_to_bool( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_bool\n");*/ @@ -230909,8 +230909,8 @@ _aligned_cast_clongdouble_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_ubyte\n");*/ @@ -231079,8 +231079,8 @@ _cast_clongdouble_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_ubyte\n");*/ @@ -231249,8 +231249,8 @@ _aligned_contig_cast_clongdouble_to_ubyte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_ubyte\n");*/ @@ -231419,8 +231419,8 @@ _contig_cast_clongdouble_to_ubyte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_ubyte\n");*/ @@ -231593,8 +231593,8 @@ _aligned_cast_clongdouble_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_ushort\n");*/ @@ -231763,8 +231763,8 @@ _cast_clongdouble_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_ushort\n");*/ @@ -231933,8 +231933,8 @@ _aligned_contig_cast_clongdouble_to_ushort( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_ushort\n");*/ @@ -232103,8 +232103,8 @@ _contig_cast_clongdouble_to_ushort( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_ushort\n");*/ @@ -232277,8 +232277,8 @@ _aligned_cast_clongdouble_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_uint\n");*/ @@ -232447,8 +232447,8 @@ _cast_clongdouble_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_uint\n");*/ @@ -232617,8 +232617,8 @@ _aligned_contig_cast_clongdouble_to_uint( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_uint\n");*/ @@ -232787,8 +232787,8 @@ _contig_cast_clongdouble_to_uint( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_uint\n");*/ @@ -232961,8 +232961,8 @@ _aligned_cast_clongdouble_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_ulong\n");*/ @@ -233131,8 +233131,8 @@ _cast_clongdouble_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_ulong\n");*/ @@ -233301,8 +233301,8 @@ _aligned_contig_cast_clongdouble_to_ulong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_ulong\n");*/ @@ -233471,8 +233471,8 @@ _contig_cast_clongdouble_to_ulong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_ulong\n");*/ @@ -233645,8 +233645,8 @@ _aligned_cast_clongdouble_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_ulonglong\n");*/ @@ -233815,8 +233815,8 @@ _cast_clongdouble_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_ulonglong\n");*/ @@ -233985,8 +233985,8 @@ _aligned_contig_cast_clongdouble_to_ulonglong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_ulonglong\n");*/ @@ -234155,8 +234155,8 @@ _contig_cast_clongdouble_to_ulonglong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_ulonglong\n");*/ @@ -234329,8 +234329,8 @@ _aligned_cast_clongdouble_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_byte\n");*/ @@ -234499,8 +234499,8 @@ _cast_clongdouble_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_byte\n");*/ @@ -234669,8 +234669,8 @@ _aligned_contig_cast_clongdouble_to_byte( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_byte\n");*/ @@ -234839,8 +234839,8 @@ _contig_cast_clongdouble_to_byte( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_byte\n");*/ @@ -235013,8 +235013,8 @@ _aligned_cast_clongdouble_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_short\n");*/ @@ -235183,8 +235183,8 @@ _cast_clongdouble_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_short\n");*/ @@ -235353,8 +235353,8 @@ _aligned_contig_cast_clongdouble_to_short( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_short\n");*/ @@ -235523,8 +235523,8 @@ _contig_cast_clongdouble_to_short( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_short\n");*/ @@ -235697,8 +235697,8 @@ _aligned_cast_clongdouble_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_int\n");*/ @@ -235867,8 +235867,8 @@ _cast_clongdouble_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_int\n");*/ @@ -236037,8 +236037,8 @@ _aligned_contig_cast_clongdouble_to_int( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_int\n");*/ @@ -236207,8 +236207,8 @@ _contig_cast_clongdouble_to_int( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_int\n");*/ @@ -236381,8 +236381,8 @@ _aligned_cast_clongdouble_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_long\n");*/ @@ -236551,8 +236551,8 @@ _cast_clongdouble_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_long\n");*/ @@ -236721,8 +236721,8 @@ _aligned_contig_cast_clongdouble_to_long( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_long\n");*/ @@ -236891,8 +236891,8 @@ _contig_cast_clongdouble_to_long( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_long\n");*/ @@ -237065,8 +237065,8 @@ _aligned_cast_clongdouble_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_longlong\n");*/ @@ -237235,8 +237235,8 @@ _cast_clongdouble_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_longlong\n");*/ @@ -237405,8 +237405,8 @@ _aligned_contig_cast_clongdouble_to_longlong( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_longlong\n");*/ @@ -237575,8 +237575,8 @@ _contig_cast_clongdouble_to_longlong( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_longlong\n");*/ @@ -237749,8 +237749,8 @@ _aligned_cast_clongdouble_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_half\n");*/ @@ -237919,8 +237919,8 @@ _cast_clongdouble_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_half\n");*/ @@ -238089,8 +238089,8 @@ _aligned_contig_cast_clongdouble_to_half( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_half\n");*/ @@ -238259,8 +238259,8 @@ _contig_cast_clongdouble_to_half( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_half\n");*/ @@ -238433,8 +238433,8 @@ _aligned_cast_clongdouble_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_float\n");*/ @@ -238603,8 +238603,8 @@ _cast_clongdouble_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_float\n");*/ @@ -238773,8 +238773,8 @@ _aligned_contig_cast_clongdouble_to_float( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_float\n");*/ @@ -238943,8 +238943,8 @@ _contig_cast_clongdouble_to_float( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_float\n");*/ @@ -239117,8 +239117,8 @@ _aligned_cast_clongdouble_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_double\n");*/ @@ -239287,8 +239287,8 @@ _cast_clongdouble_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_double\n");*/ @@ -239457,8 +239457,8 @@ _aligned_contig_cast_clongdouble_to_double( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_double\n");*/ @@ -239627,8 +239627,8 @@ _contig_cast_clongdouble_to_double( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_double\n");*/ @@ -239801,8 +239801,8 @@ _aligned_cast_clongdouble_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_longdouble\n");*/ @@ -239971,8 +239971,8 @@ _cast_clongdouble_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_longdouble\n");*/ @@ -240141,8 +240141,8 @@ _aligned_contig_cast_clongdouble_to_longdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_longdouble\n");*/ @@ -240311,8 +240311,8 @@ _contig_cast_clongdouble_to_longdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_longdouble\n");*/ @@ -240485,8 +240485,8 @@ _aligned_cast_clongdouble_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_cfloat\n");*/ @@ -240655,8 +240655,8 @@ _cast_clongdouble_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_cfloat\n");*/ @@ -240825,8 +240825,8 @@ _aligned_contig_cast_clongdouble_to_cfloat( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_cfloat\n");*/ @@ -240995,8 +240995,8 @@ _contig_cast_clongdouble_to_cfloat( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_cfloat\n");*/ @@ -241169,8 +241169,8 @@ _aligned_cast_clongdouble_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_cdouble\n");*/ @@ -241339,8 +241339,8 @@ _cast_clongdouble_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_cdouble\n");*/ @@ -241509,8 +241509,8 @@ _aligned_contig_cast_clongdouble_to_cdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_cdouble\n");*/ @@ -241679,8 +241679,8 @@ _contig_cast_clongdouble_to_cdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_cdouble\n");*/ @@ -241853,8 +241853,8 @@ _aligned_cast_clongdouble_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_cast_clongdouble_to_clongdouble\n");*/ @@ -242023,8 +242023,8 @@ _cast_clongdouble_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_cast_clongdouble_to_clongdouble\n");*/ @@ -242193,8 +242193,8 @@ _aligned_contig_cast_clongdouble_to_clongdouble( #if 1 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_aligned_contig_cast_clongdouble_to_clongdouble\n");*/ @@ -242363,8 +242363,8 @@ _contig_cast_clongdouble_to_clongdouble( #if 0 /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("_contig_cast_clongdouble_to_clongdouble\n");*/ @@ -251525,7 +251525,7 @@ mapiter_trivial_set( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 0 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -251539,8 +251539,8 @@ mapiter_trivial_set( #if 0 #if 1 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint8))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint8))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint8))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)result_ptr = *(npy_uint8 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -251554,8 +251554,8 @@ mapiter_trivial_set( #else /* !0 */ #if 1 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint8))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint8))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint8))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)self_ptr = *(npy_uint8 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -251584,7 +251584,7 @@ mapiter_trivial_set( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 0 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -251598,8 +251598,8 @@ mapiter_trivial_set( #if 0 #if 2 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint16))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint16))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint16))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)result_ptr = *(npy_uint16 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -251613,8 +251613,8 @@ mapiter_trivial_set( #else /* !0 */ #if 2 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint16))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint16))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint16))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)self_ptr = *(npy_uint16 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -251643,7 +251643,7 @@ mapiter_trivial_set( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 0 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -251657,8 +251657,8 @@ mapiter_trivial_set( #if 0 #if 4 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint32))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint32))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint32))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)result_ptr = *(npy_uint32 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -251672,8 +251672,8 @@ mapiter_trivial_set( #else /* !0 */ #if 4 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint32))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint32))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint32))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)self_ptr = *(npy_uint32 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -251702,7 +251702,7 @@ mapiter_trivial_set( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 0 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -251716,8 +251716,8 @@ mapiter_trivial_set( #if 0 #if 8 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint64))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint64))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint64))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)result_ptr = *(npy_uint64 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -251731,8 +251731,8 @@ mapiter_trivial_set( #else /* !0 */ #if 8 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint64))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint64))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint64))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)self_ptr = *(npy_uint64 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -251761,7 +251761,7 @@ mapiter_trivial_set( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 0 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -251775,8 +251775,8 @@ mapiter_trivial_set( #if 0 #if 16 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(copytype128))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(copytype128))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(copytype128))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)result_ptr = *(copytype128 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -251790,8 +251790,8 @@ mapiter_trivial_set( #else /* !0 */ #if 16 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(copytype128))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(copytype128))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(copytype128))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)self_ptr = *(copytype128 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -251820,7 +251820,7 @@ mapiter_trivial_set( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 0 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -251834,8 +251834,8 @@ mapiter_trivial_set( #if 0 #if 0 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(0))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(0))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(0))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(0))); *(0 *)result_ptr = *(0 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -251849,8 +251849,8 @@ mapiter_trivial_set( #else /* !0 */ #if 0 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(0))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(0))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(0))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(0))); *(0 *)self_ptr = *(0 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -251971,7 +251971,7 @@ mapiter_set( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -251992,9 +251992,9 @@ mapiter_set( #if 0 #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)(outer_ptrs[i]) = *(npy_uint8 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252008,9 +252008,9 @@ mapiter_set( #else /* !0 */ #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)self_ptr = *(npy_uint8 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252054,7 +252054,7 @@ mapiter_set( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252075,9 +252075,9 @@ mapiter_set( #if 0 #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)(outer_ptrs[i]) = *(npy_uint16 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252091,9 +252091,9 @@ mapiter_set( #else /* !0 */ #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)self_ptr = *(npy_uint16 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252137,7 +252137,7 @@ mapiter_set( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252158,9 +252158,9 @@ mapiter_set( #if 0 #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)(outer_ptrs[i]) = *(npy_uint32 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252174,9 +252174,9 @@ mapiter_set( #else /* !0 */ #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)self_ptr = *(npy_uint32 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252220,7 +252220,7 @@ mapiter_set( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252241,9 +252241,9 @@ mapiter_set( #if 0 #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)(outer_ptrs[i]) = *(npy_uint64 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252257,9 +252257,9 @@ mapiter_set( #else /* !0 */ #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)self_ptr = *(npy_uint64 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252303,7 +252303,7 @@ mapiter_set( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252324,9 +252324,9 @@ mapiter_set( #if 0 #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)(outer_ptrs[i]) = *(copytype128 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252340,9 +252340,9 @@ mapiter_set( #else /* !0 */ #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)self_ptr = *(copytype128 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252386,7 +252386,7 @@ mapiter_set( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252407,9 +252407,9 @@ mapiter_set( #if 0 #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)(outer_ptrs[i]) = *(0 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252423,9 +252423,9 @@ mapiter_set( #else /* !0 */ #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)self_ptr = *(0 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252488,7 +252488,7 @@ mapiter_set( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252509,9 +252509,9 @@ mapiter_set( #if 0 #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)(outer_ptrs[i]) = *(npy_uint8 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252525,9 +252525,9 @@ mapiter_set( #else /* !0 */ #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)self_ptr = *(npy_uint8 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252571,7 +252571,7 @@ mapiter_set( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252592,9 +252592,9 @@ mapiter_set( #if 0 #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)(outer_ptrs[i]) = *(npy_uint16 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252608,9 +252608,9 @@ mapiter_set( #else /* !0 */ #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)self_ptr = *(npy_uint16 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252654,7 +252654,7 @@ mapiter_set( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252675,9 +252675,9 @@ mapiter_set( #if 0 #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)(outer_ptrs[i]) = *(npy_uint32 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252691,9 +252691,9 @@ mapiter_set( #else /* !0 */ #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)self_ptr = *(npy_uint32 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252737,7 +252737,7 @@ mapiter_set( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252758,9 +252758,9 @@ mapiter_set( #if 0 #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)(outer_ptrs[i]) = *(npy_uint64 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252774,9 +252774,9 @@ mapiter_set( #else /* !0 */ #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)self_ptr = *(npy_uint64 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252820,7 +252820,7 @@ mapiter_set( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252841,9 +252841,9 @@ mapiter_set( #if 0 #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)(outer_ptrs[i]) = *(copytype128 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252857,9 +252857,9 @@ mapiter_set( #else /* !0 */ #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)self_ptr = *(copytype128 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -252903,7 +252903,7 @@ mapiter_set( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 0 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -252924,9 +252924,9 @@ mapiter_set( #if 0 #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)(outer_ptrs[i]) = *(0 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -252940,9 +252940,9 @@ mapiter_set( #else /* !0 */ #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)self_ptr = *(0 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -253283,7 +253283,7 @@ mapiter_trivial_get( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 1 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -253297,8 +253297,8 @@ mapiter_trivial_get( #if 1 #if 1 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint8))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint8))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint8))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)result_ptr = *(npy_uint8 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -253312,8 +253312,8 @@ mapiter_trivial_get( #else /* !1 */ #if 1 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint8))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint8))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint8))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)self_ptr = *(npy_uint8 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -253342,7 +253342,7 @@ mapiter_trivial_get( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 1 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -253356,8 +253356,8 @@ mapiter_trivial_get( #if 1 #if 2 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint16))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint16))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint16))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)result_ptr = *(npy_uint16 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -253371,8 +253371,8 @@ mapiter_trivial_get( #else /* !1 */ #if 2 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint16))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint16))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint16))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)self_ptr = *(npy_uint16 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -253401,7 +253401,7 @@ mapiter_trivial_get( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 1 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -253415,8 +253415,8 @@ mapiter_trivial_get( #if 1 #if 4 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint32))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint32))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint32))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)result_ptr = *(npy_uint32 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -253430,8 +253430,8 @@ mapiter_trivial_get( #else /* !1 */ #if 4 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint32))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint32))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint32))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)self_ptr = *(npy_uint32 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -253460,7 +253460,7 @@ mapiter_trivial_get( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 1 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -253474,8 +253474,8 @@ mapiter_trivial_get( #if 1 #if 8 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint64))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint64))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint64))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)result_ptr = *(npy_uint64 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -253489,8 +253489,8 @@ mapiter_trivial_get( #else /* !1 */ #if 8 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(npy_uint64))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(npy_uint64))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(npy_uint64))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)self_ptr = *(npy_uint64 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -253519,7 +253519,7 @@ mapiter_trivial_get( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 1 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -253533,8 +253533,8 @@ mapiter_trivial_get( #if 1 #if 16 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(copytype128))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(copytype128))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(copytype128))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)result_ptr = *(copytype128 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -253548,8 +253548,8 @@ mapiter_trivial_get( #else /* !1 */ #if 16 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(copytype128))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(copytype128))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(copytype128))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)self_ptr = *(copytype128 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -253578,7 +253578,7 @@ mapiter_trivial_get( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if 1 if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -253592,8 +253592,8 @@ mapiter_trivial_get( #if 1 #if 0 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(0))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(0))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(0))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(0))); *(0 *)result_ptr = *(0 *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -253607,8 +253607,8 @@ mapiter_trivial_get( #else /* !1 */ #if 0 - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(0))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(0))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(0))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(0))); *(0 *)self_ptr = *(0 *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -253729,7 +253729,7 @@ mapiter_get( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -253750,9 +253750,9 @@ mapiter_get( #if 1 #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)(outer_ptrs[i]) = *(npy_uint8 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -253766,9 +253766,9 @@ mapiter_get( #else /* !1 */ #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)self_ptr = *(npy_uint8 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -253812,7 +253812,7 @@ mapiter_get( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -253833,9 +253833,9 @@ mapiter_get( #if 1 #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)(outer_ptrs[i]) = *(npy_uint16 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -253849,9 +253849,9 @@ mapiter_get( #else /* !1 */ #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)self_ptr = *(npy_uint16 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -253895,7 +253895,7 @@ mapiter_get( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -253916,9 +253916,9 @@ mapiter_get( #if 1 #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)(outer_ptrs[i]) = *(npy_uint32 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -253932,9 +253932,9 @@ mapiter_get( #else /* !1 */ #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)self_ptr = *(npy_uint32 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -253978,7 +253978,7 @@ mapiter_get( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -253999,9 +253999,9 @@ mapiter_get( #if 1 #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)(outer_ptrs[i]) = *(npy_uint64 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254015,9 +254015,9 @@ mapiter_get( #else /* !1 */ #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)self_ptr = *(npy_uint64 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254061,7 +254061,7 @@ mapiter_get( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254082,9 +254082,9 @@ mapiter_get( #if 1 #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)(outer_ptrs[i]) = *(copytype128 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254098,9 +254098,9 @@ mapiter_get( #else /* !1 */ #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)self_ptr = *(copytype128 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254144,7 +254144,7 @@ mapiter_get( for (i=0; i < 1; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 1 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254165,9 +254165,9 @@ mapiter_get( #if 1 #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)(outer_ptrs[i]) = *(0 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254181,9 +254181,9 @@ mapiter_get( #else /* !1 */ #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)self_ptr = *(0 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254246,7 +254246,7 @@ mapiter_get( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254267,9 +254267,9 @@ mapiter_get( #if 1 #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)(outer_ptrs[i]) = *(npy_uint8 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254283,9 +254283,9 @@ mapiter_get( #else /* !1 */ #if 1 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint8))); + NPY_ALIGNOF_UINT(npy_uint8))); *(npy_uint8 *)self_ptr = *(npy_uint8 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254329,7 +254329,7 @@ mapiter_get( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254350,9 +254350,9 @@ mapiter_get( #if 1 #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)(outer_ptrs[i]) = *(npy_uint16 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254366,9 +254366,9 @@ mapiter_get( #else /* !1 */ #if 2 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint16))); + NPY_ALIGNOF_UINT(npy_uint16))); *(npy_uint16 *)self_ptr = *(npy_uint16 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254412,7 +254412,7 @@ mapiter_get( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254433,9 +254433,9 @@ mapiter_get( #if 1 #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)(outer_ptrs[i]) = *(npy_uint32 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254449,9 +254449,9 @@ mapiter_get( #else /* !1 */ #if 4 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint32))); + NPY_ALIGNOF_UINT(npy_uint32))); *(npy_uint32 *)self_ptr = *(npy_uint32 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254495,7 +254495,7 @@ mapiter_get( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254516,9 +254516,9 @@ mapiter_get( #if 1 #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)(outer_ptrs[i]) = *(npy_uint64 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254532,9 +254532,9 @@ mapiter_get( #else /* !1 */ #if 8 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(npy_uint64))); + NPY_ALIGNOF_UINT(npy_uint64))); *(npy_uint64 *)self_ptr = *(npy_uint64 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254578,7 +254578,7 @@ mapiter_get( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254599,9 +254599,9 @@ mapiter_get( #if 1 #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)(outer_ptrs[i]) = *(copytype128 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254615,9 +254615,9 @@ mapiter_get( #else /* !1 */ #if 16 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(copytype128))); + NPY_ALIGNOF_UINT(copytype128))); *(copytype128 *)self_ptr = *(copytype128 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; @@ -254661,7 +254661,7 @@ mapiter_get( for (i=0; i < numiter; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if 1 && 0 if (check_and_adjust_index(&indval, fancy_dims[i], @@ -254682,9 +254682,9 @@ mapiter_get( #if 1 #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)(outer_ptrs[i]) = *(0 *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -254698,9 +254698,9 @@ mapiter_get( #else /* !1 */ #if 0 assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(0))); + NPY_ALIGNOF_UINT(0))); *(0 *)self_ptr = *(0 *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; diff --git a/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c.src b/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c.src index 2c48ae58bf..16020ee7a7 100644 --- a/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c.src +++ b/contrib/python/numpy/py3/numpy/core/src/multiarray/lowlevel_strided_loops.c.src @@ -134,8 +134,8 @@ static int #if @is_aligned@ /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(@type@))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(@type@))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(@type@))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(@type@))); #endif /*printf("fn @prefix@_@oper@_size@elsize@\n");*/ while (N > 0) { @@ -220,8 +220,8 @@ static NPY_GCC_OPT_3 int } #if @is_aligned@ && @elsize@ != 16 /* sanity check */ - assert(N == 0 || npy_is_aligned(dst, _UINT_ALIGN(@type@))); - assert(N == 0 || npy_is_aligned(src, _UINT_ALIGN(@type@))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF_UINT(@type@))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF_UINT(@type@))); #endif #if @elsize@ == 1 && @dst_contig@ memset(dst, *src, N); @@ -864,8 +864,8 @@ static NPY_GCC_OPT_3 int #if @aligned@ /* sanity check */ - assert(N == 0 || npy_is_aligned(src, _ALIGN(_TYPE1))); - assert(N == 0 || npy_is_aligned(dst, _ALIGN(_TYPE2))); + assert(N == 0 || npy_is_aligned(src, NPY_ALIGNOF(_TYPE1))); + assert(N == 0 || npy_is_aligned(dst, NPY_ALIGNOF(_TYPE2))); #endif /*printf("@prefix@_cast_@name1@_to_@name2@\n");*/ @@ -1515,7 +1515,7 @@ mapiter_trivial_@name@( while (itersize--) { char * self_ptr; npy_intp indval = *((npy_intp*)ind_ptr); - assert(npy_is_aligned(ind_ptr, _UINT_ALIGN(npy_intp))); + assert(npy_is_aligned(ind_ptr, NPY_ALIGNOF_UINT(npy_intp))); #if @isget@ if (check_and_adjust_index(&indval, fancy_dim, 0, _save) < 0 ) { return -1; @@ -1529,8 +1529,8 @@ mapiter_trivial_@name@( #if @isget@ #if @elsize@ - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(@copytype@))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(@copytype@))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(@copytype@))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(@copytype@))); *(@copytype@ *)result_ptr = *(@copytype@ *)self_ptr; #else char *args[2] = {self_ptr, result_ptr}; @@ -1544,8 +1544,8 @@ mapiter_trivial_@name@( #else /* !@isget@ */ #if @elsize@ - assert(npy_is_aligned(result_ptr, _UINT_ALIGN(@copytype@))); - assert(npy_is_aligned(self_ptr, _UINT_ALIGN(@copytype@))); + assert(npy_is_aligned(result_ptr, NPY_ALIGNOF_UINT(@copytype@))); + assert(npy_is_aligned(self_ptr, NPY_ALIGNOF_UINT(@copytype@))); *(@copytype@ *)self_ptr = *(@copytype@ *)result_ptr; #else char *args[2] = {result_ptr, self_ptr}; @@ -1672,7 +1672,7 @@ mapiter_@name@( for (i=0; i < @numiter@; i++) { npy_intp indval = *((npy_intp*)outer_ptrs[i]); assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(npy_intp))); + NPY_ALIGNOF_UINT(npy_intp))); #if @isget@ && @one_iter@ if (check_and_adjust_index(&indval, fancy_dims[i], @@ -1693,9 +1693,9 @@ mapiter_@name@( #if @isget@ #if @elsize@ assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(@copytype@))); + NPY_ALIGNOF_UINT(@copytype@))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(@copytype@))); + NPY_ALIGNOF_UINT(@copytype@))); *(@copytype@ *)(outer_ptrs[i]) = *(@copytype@ *)self_ptr; #else char *args[2] = {self_ptr, outer_ptrs[i]}; @@ -1709,9 +1709,9 @@ mapiter_@name@( #else /* !@isget@ */ #if @elsize@ assert(npy_is_aligned(outer_ptrs[i], - _UINT_ALIGN(@copytype@))); + NPY_ALIGNOF_UINT(@copytype@))); assert(npy_is_aligned(self_ptr, - _UINT_ALIGN(@copytype@))); + NPY_ALIGNOF_UINT(@copytype@))); *(@copytype@ *)self_ptr = *(@copytype@ *)(outer_ptrs[i]); #else char *args[2] = {outer_ptrs[i], self_ptr}; diff --git a/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c b/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c index 5f6babfd2c..d412131260 100644 --- a/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c +++ b/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c @@ -158,7 +158,9 @@ npy_cargf(npy_cfloat z) #define SCALED_CEXP_LOWERL 11357.216553474703895L #define SCALED_CEXP_UPPERL 22756.021937783004509L -#if !defined(HAVE_CEXPF) +#if !defined(HAVE_CSINHF) || \ + !defined(HAVE_CCOSHF) || \ + !defined(HAVE_CEXPF) static npy_cfloat @@ -1835,7 +1837,9 @@ npy_carg(npy_cdouble z) #define SCALED_CEXP_LOWERL 11357.216553474703895L #define SCALED_CEXP_UPPERL 22756.021937783004509L -#if !defined(HAVE_CEXP) +#if !defined(HAVE_CSINH) || \ + !defined(HAVE_CCOSH) || \ + !defined(HAVE_CEXP) static npy_cdouble @@ -3512,7 +3516,9 @@ npy_cargl(npy_clongdouble z) #define SCALED_CEXP_LOWERL 11357.216553474703895L #define SCALED_CEXP_UPPERL 22756.021937783004509L -#if !defined(HAVE_CEXPL) +#if !defined(HAVE_CSINHL) || \ + !defined(HAVE_CCOSHL) || \ + !defined(HAVE_CEXPL) static npy_clongdouble @@ -5095,9 +5101,9 @@ npy_catanhl(npy_clongdouble z) * Decorate all the functions which are available natively *=========================================================*/ -#line 1750 +#line 1752 -#line 1755 +#line 1757 #ifdef HAVE_CABSF npy_float npy_cabsf(npy_cfloat z) @@ -5108,7 +5114,7 @@ npy_cabsf(npy_cfloat z) } #endif -#line 1755 +#line 1757 #ifdef HAVE_CARGF npy_float npy_cargf(npy_cfloat z) @@ -5120,7 +5126,7 @@ npy_cargf(npy_cfloat z) #endif -#line 1772 +#line 1774 #ifdef HAVE_CEXPF npy_cfloat npy_cexpf(npy_cfloat z) @@ -5133,7 +5139,7 @@ npy_cexpf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CLOGF npy_cfloat npy_clogf(npy_cfloat z) @@ -5146,7 +5152,7 @@ npy_clogf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSQRTF npy_cfloat npy_csqrtf(npy_cfloat z) @@ -5159,7 +5165,7 @@ npy_csqrtf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CCOSF npy_cfloat npy_ccosf(npy_cfloat z) @@ -5172,7 +5178,7 @@ npy_ccosf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSINF npy_cfloat npy_csinf(npy_cfloat z) @@ -5185,7 +5191,7 @@ npy_csinf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CTANF npy_cfloat npy_ctanf(npy_cfloat z) @@ -5198,7 +5204,7 @@ npy_ctanf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CCOSHF npy_cfloat npy_ccoshf(npy_cfloat z) @@ -5211,7 +5217,7 @@ npy_ccoshf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSINHF npy_cfloat npy_csinhf(npy_cfloat z) @@ -5224,7 +5230,7 @@ npy_csinhf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CTANHF npy_cfloat npy_ctanhf(npy_cfloat z) @@ -5237,7 +5243,7 @@ npy_ctanhf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CACOSF npy_cfloat npy_cacosf(npy_cfloat z) @@ -5250,7 +5256,7 @@ npy_cacosf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CASINF npy_cfloat npy_casinf(npy_cfloat z) @@ -5263,7 +5269,7 @@ npy_casinf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CATANF npy_cfloat npy_catanf(npy_cfloat z) @@ -5276,7 +5282,7 @@ npy_catanf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CACOSHF npy_cfloat npy_cacoshf(npy_cfloat z) @@ -5289,7 +5295,7 @@ npy_cacoshf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CASINHF npy_cfloat npy_casinhf(npy_cfloat z) @@ -5302,7 +5308,7 @@ npy_casinhf(npy_cfloat z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CATANHF npy_cfloat npy_catanhf(npy_cfloat z) @@ -5318,9 +5324,9 @@ npy_catanhf(npy_cfloat z) -#line 1750 +#line 1752 -#line 1755 +#line 1757 #ifdef HAVE_CABS npy_double npy_cabs(npy_cdouble z) @@ -5331,7 +5337,7 @@ npy_cabs(npy_cdouble z) } #endif -#line 1755 +#line 1757 #ifdef HAVE_CARG npy_double npy_carg(npy_cdouble z) @@ -5343,7 +5349,7 @@ npy_carg(npy_cdouble z) #endif -#line 1772 +#line 1774 #ifdef HAVE_CEXP npy_cdouble npy_cexp(npy_cdouble z) @@ -5356,7 +5362,7 @@ npy_cexp(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CLOG npy_cdouble npy_clog(npy_cdouble z) @@ -5369,7 +5375,7 @@ npy_clog(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSQRT npy_cdouble npy_csqrt(npy_cdouble z) @@ -5382,7 +5388,7 @@ npy_csqrt(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CCOS npy_cdouble npy_ccos(npy_cdouble z) @@ -5395,7 +5401,7 @@ npy_ccos(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSIN npy_cdouble npy_csin(npy_cdouble z) @@ -5408,7 +5414,7 @@ npy_csin(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CTAN npy_cdouble npy_ctan(npy_cdouble z) @@ -5421,7 +5427,7 @@ npy_ctan(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CCOSH npy_cdouble npy_ccosh(npy_cdouble z) @@ -5434,7 +5440,7 @@ npy_ccosh(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSINH npy_cdouble npy_csinh(npy_cdouble z) @@ -5447,7 +5453,7 @@ npy_csinh(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CTANH npy_cdouble npy_ctanh(npy_cdouble z) @@ -5460,7 +5466,7 @@ npy_ctanh(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CACOS npy_cdouble npy_cacos(npy_cdouble z) @@ -5473,7 +5479,7 @@ npy_cacos(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CASIN npy_cdouble npy_casin(npy_cdouble z) @@ -5486,7 +5492,7 @@ npy_casin(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CATAN npy_cdouble npy_catan(npy_cdouble z) @@ -5499,7 +5505,7 @@ npy_catan(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CACOSH npy_cdouble npy_cacosh(npy_cdouble z) @@ -5512,7 +5518,7 @@ npy_cacosh(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CASINH npy_cdouble npy_casinh(npy_cdouble z) @@ -5525,7 +5531,7 @@ npy_casinh(npy_cdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CATANH npy_cdouble npy_catanh(npy_cdouble z) @@ -5541,9 +5547,9 @@ npy_catanh(npy_cdouble z) -#line 1750 +#line 1752 -#line 1755 +#line 1757 #ifdef HAVE_CABSL npy_longdouble npy_cabsl(npy_clongdouble z) @@ -5554,7 +5560,7 @@ npy_cabsl(npy_clongdouble z) } #endif -#line 1755 +#line 1757 #ifdef HAVE_CARGL npy_longdouble npy_cargl(npy_clongdouble z) @@ -5566,7 +5572,7 @@ npy_cargl(npy_clongdouble z) #endif -#line 1772 +#line 1774 #ifdef HAVE_CEXPL npy_clongdouble npy_cexpl(npy_clongdouble z) @@ -5579,7 +5585,7 @@ npy_cexpl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CLOGL npy_clongdouble npy_clogl(npy_clongdouble z) @@ -5592,7 +5598,7 @@ npy_clogl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSQRTL npy_clongdouble npy_csqrtl(npy_clongdouble z) @@ -5605,7 +5611,7 @@ npy_csqrtl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CCOSL npy_clongdouble npy_ccosl(npy_clongdouble z) @@ -5618,7 +5624,7 @@ npy_ccosl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSINL npy_clongdouble npy_csinl(npy_clongdouble z) @@ -5631,7 +5637,7 @@ npy_csinl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CTANL npy_clongdouble npy_ctanl(npy_clongdouble z) @@ -5644,7 +5650,7 @@ npy_ctanl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CCOSHL npy_clongdouble npy_ccoshl(npy_clongdouble z) @@ -5657,7 +5663,7 @@ npy_ccoshl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CSINHL npy_clongdouble npy_csinhl(npy_clongdouble z) @@ -5670,7 +5676,7 @@ npy_csinhl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CTANHL npy_clongdouble npy_ctanhl(npy_clongdouble z) @@ -5683,7 +5689,7 @@ npy_ctanhl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CACOSL npy_clongdouble npy_cacosl(npy_clongdouble z) @@ -5696,7 +5702,7 @@ npy_cacosl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CASINL npy_clongdouble npy_casinl(npy_clongdouble z) @@ -5709,7 +5715,7 @@ npy_casinl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CATANL npy_clongdouble npy_catanl(npy_clongdouble z) @@ -5722,7 +5728,7 @@ npy_catanl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CACOSHL npy_clongdouble npy_cacoshl(npy_clongdouble z) @@ -5735,7 +5741,7 @@ npy_cacoshl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CASINHL npy_clongdouble npy_casinhl(npy_clongdouble z) @@ -5748,7 +5754,7 @@ npy_casinhl(npy_clongdouble z) } #endif -#line 1772 +#line 1774 #ifdef HAVE_CATANHL npy_clongdouble npy_catanhl(npy_clongdouble z) diff --git a/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c.src b/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c.src index eb9d810b7d..8e1decbfd9 100644 --- a/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c.src +++ b/contrib/python/numpy/py3/numpy/core/src/npymath/npy_math_complex.c.src @@ -158,7 +158,9 @@ npy_carg@c@(@ctype@ z) #define SCALED_CEXP_LOWERL 11357.216553474703895L #define SCALED_CEXP_UPPERL 22756.021937783004509L -#if !defined(HAVE_CEXP@C@) +#if !defined(HAVE_CSINH@C@) || \ + !defined(HAVE_CCOSH@C@) || \ + !defined(HAVE_CEXP@C@) static @ctype@ diff --git a/contrib/python/numpy/py3/numpy/core/src/umath/_scaled_float_dtype.c b/contrib/python/numpy/py3/numpy/core/src/umath/_scaled_float_dtype.c index c26ace9f13..7489e9a766 100644 --- a/contrib/python/numpy/py3/numpy/core/src/umath/_scaled_float_dtype.c +++ b/contrib/python/numpy/py3/numpy/core/src/umath/_scaled_float_dtype.c @@ -149,7 +149,7 @@ static PyArray_SFloatDescr SFloatSingleton = {{ .flags = NPY_USE_GETITEM|NPY_USE_SETITEM, .type_num = -1, .elsize = sizeof(double), - .alignment = _ALIGN(double), + .alignment = NPY_ALIGNOF(double), .f = &sfloat_slots.f, }, .scaling = 1, diff --git a/contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.c b/contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.c index 9d8df4c86d..73a59103c1 100644 --- a/contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.c +++ b/contrib/python/numpy/py3/numpy/core/src/umath/_umath_tests.dispatch.c @@ -5,6 +5,7 @@ * SSE2 SSE41 AVX2 * VSX VSX2 VSX3 * NEON ASIMD ASIMDHP + * VX VXE */ #define PY_SSIZE_T_CLEAN #include <Python.h> diff --git a/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c b/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c index e9adb7c1f5..695d488250 100644 --- a/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c +++ b/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c @@ -41,61 +41,8 @@ /******************************************************************************** ** Defining ufunc inner functions ********************************************************************************/ - -/* - * clang has a bug that's present at -O1 or greater. When partially loading a - * vector register for a divide operation, the remaining elements are set - * to 1 to avoid divide-by-zero. The partial load is paired with a partial - * store after the divide operation. clang notices that the entire register - * is not needed for the store and optimizes out the fill of 1 to the remaining - * elements. This causes either a divide-by-zero or 0/0 with invalid exception - * that we were trying to avoid by filling. - * - * Using a dummy variable marked 'volatile' convinces clang not to ignore - * the explicit fill of remaining elements. If `-ftrapping-math` is - * supported, then it'll also avoid the bug. `-ftrapping-math` is supported - * on Apple clang v12+ for x86_64. It is not currently supported for arm64. - * `-ftrapping-math` is set by default of Numpy builds in - * numpy/distutils/ccompiler.py. - * - * Note: Apple clang and clang upstream have different versions that overlap - */ -#if defined(__clang__) - #if defined(__apple_build_version__) - // Apple Clang - #if __apple_build_version__ < 12000000 - // Apple Clang before v12 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Apple Clang after v12, targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 0 - #else - // Apple Clang after v12, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #endif - #else - // Clang, not Apple Clang - #if __clang_major__ < 10 - // Clang before v10 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #elif defined(_MSC_VER) - // clang-cl has the same bug - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Clang v10+, targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 0 - #else - // Clang v10+, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #endif - #endif -#else -// Not a Clang compiler -#define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 0 -#endif - -#line 96 -#line 105 +#line 43 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_add) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -142,12 +89,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_add) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 0 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); @@ -158,15 +100,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_add) npyv_f32 r = npyv_add_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_add_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_float) && sdst == ssrc1) { npyv_f32 a = npyv_setall_f32(*((npy_float*)src0)); @@ -178,12 +111,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_add) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 0 || 0 npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); #else @@ -192,14 +120,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_add) npyv_f32 r = npyv_add_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_add_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_float) && sdst == ssrc0) { npyv_f32 b = npyv_setall_f32(*((npy_float*)src1)); @@ -211,12 +131,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_add) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 0 || 0 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); #else @@ -225,14 +140,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_add) npyv_f32 r = npyv_add_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - npyv_f32 r = npyv_add_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -271,7 +178,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(FLOAT_add_indexed) } -#line 105 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_subtract) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -318,12 +225,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_subtract) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 0 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); @@ -334,15 +236,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_subtract) npyv_f32 r = npyv_sub_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_sub_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_float) && sdst == ssrc1) { npyv_f32 a = npyv_setall_f32(*((npy_float*)src0)); @@ -354,12 +247,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_subtract) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 0 || 0 npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); #else @@ -368,14 +256,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_subtract) npyv_f32 r = npyv_sub_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_sub_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_float) && sdst == ssrc0) { npyv_f32 b = npyv_setall_f32(*((npy_float*)src1)); @@ -387,12 +267,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_subtract) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 0 || 0 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); #else @@ -401,14 +276,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_subtract) npyv_f32 r = npyv_sub_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - npyv_f32 r = npyv_sub_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -447,7 +314,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(FLOAT_subtract_indexed) } -#line 105 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_multiply) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -494,12 +361,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_multiply) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 0 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); @@ -510,15 +372,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_multiply) npyv_f32 r = npyv_mul_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_mul_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_float) && sdst == ssrc1) { npyv_f32 a = npyv_setall_f32(*((npy_float*)src0)); @@ -530,12 +383,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_multiply) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 0 || 1 npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); #else @@ -544,14 +392,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_multiply) npyv_f32 r = npyv_mul_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_mul_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_float) && sdst == ssrc0) { npyv_f32 b = npyv_setall_f32(*((npy_float*)src1)); @@ -563,12 +403,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_multiply) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 0 || 1 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); #else @@ -577,14 +412,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_multiply) npyv_f32 r = npyv_mul_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - npyv_f32 r = npyv_mul_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -623,7 +450,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(FLOAT_multiply_indexed) } -#line 105 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_divide) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -670,12 +497,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_divide) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 1 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); @@ -686,15 +508,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_divide) npyv_f32 r = npyv_div_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_div_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_float) && sdst == ssrc1) { npyv_f32 a = npyv_setall_f32(*((npy_float*)src0)); @@ -706,12 +519,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_divide) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 1 || 0 npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); #else @@ -720,14 +528,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_divide) npyv_f32 r = npyv_div_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 b = npyv_load_till_f32((const npy_float*)src1, len, 1.0f); - npyv_f32 r = npyv_div_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_float) && sdst == ssrc0) { npyv_f32 b = npyv_setall_f32(*((npy_float*)src1)); @@ -739,12 +539,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_divide) npyv_store_f32((npy_float*)dst, r0); npyv_store_f32((npy_float*)(dst + vstep), r1); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 1 || 0 npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); #else @@ -753,14 +548,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_divide) npyv_f32 r = npyv_div_f32(a, b); npyv_store_till_f32((npy_float*)dst, len, r); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f32 a = npyv_load_till_f32((const npy_float*)src0, len, 1.0f); - npyv_f32 r = npyv_div_f32(a, b); - npyv_store_till_f32((npy_float*)dst, len, r); - } - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -800,8 +587,8 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(FLOAT_divide_indexed) -#line 96 -#line 105 +#line 43 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_add) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -848,12 +635,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_add) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 0 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); @@ -864,15 +646,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_add) npyv_f64 r = npyv_add_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_add_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_double) && sdst == ssrc1) { npyv_f64 a = npyv_setall_f64(*((npy_double*)src0)); @@ -884,12 +657,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_add) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 0 || 0 npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); #else @@ -898,14 +666,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_add) npyv_f64 r = npyv_add_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_add_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_double) && sdst == ssrc0) { npyv_f64 b = npyv_setall_f64(*((npy_double*)src1)); @@ -917,12 +677,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_add) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 0 || 0 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); #else @@ -931,14 +686,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_add) npyv_f64 r = npyv_add_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - npyv_f64 r = npyv_add_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -977,7 +724,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(DOUBLE_add_indexed) } -#line 105 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -1024,12 +771,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 0 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); @@ -1040,15 +782,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract) npyv_f64 r = npyv_sub_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_sub_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_double) && sdst == ssrc1) { npyv_f64 a = npyv_setall_f64(*((npy_double*)src0)); @@ -1060,12 +793,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 0 || 0 npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); #else @@ -1074,14 +802,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract) npyv_f64 r = npyv_sub_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_sub_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_double) && sdst == ssrc0) { npyv_f64 b = npyv_setall_f64(*((npy_double*)src1)); @@ -1093,12 +813,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 0 || 0 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); #else @@ -1107,14 +822,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract) npyv_f64 r = npyv_sub_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - npyv_f64 r = npyv_sub_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (0 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -1153,7 +860,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(DOUBLE_subtract_indexed) } -#line 105 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -1200,12 +907,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 0 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); @@ -1216,15 +918,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply) npyv_f64 r = npyv_mul_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_mul_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if 0 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_double) && sdst == ssrc1) { npyv_f64 a = npyv_setall_f64(*((npy_double*)src0)); @@ -1236,12 +929,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 0 || 1 npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); #else @@ -1250,14 +938,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply) npyv_f64 r = npyv_mul_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_mul_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_double) && sdst == ssrc0) { npyv_f64 b = npyv_setall_f64(*((npy_double*)src1)); @@ -1269,12 +949,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 0 || 1 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); #else @@ -1283,14 +958,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply) npyv_f64 r = npyv_mul_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - npyv_f64 r = npyv_mul_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (0 || 1) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -1329,7 +996,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(DOUBLE_multiply_indexed) } -#line 105 +#line 52 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_divide) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -1376,12 +1043,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_divide) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if 1 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); @@ -1392,15 +1054,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_divide) npyv_f64 r = npyv_div_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_div_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if 1 && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(npy_double) && sdst == ssrc1) { npyv_f64 a = npyv_setall_f64(*((npy_double*)src0)); @@ -1412,12 +1065,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_divide) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if 1 || 0 npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); #else @@ -1426,14 +1074,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_divide) npyv_f64 r = npyv_div_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 b = npyv_load_till_f64((const npy_double*)src1, len, 1.0); - npyv_f64 r = npyv_div_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(npy_double) && sdst == ssrc0) { npyv_f64 b = npyv_setall_f64(*((npy_double*)src1)); @@ -1445,12 +1085,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_divide) npyv_store_f64((npy_double*)dst, r0); npyv_store_f64((npy_double*)(dst + vstep), r1); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if 1 || 0 npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); #else @@ -1459,14 +1094,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_divide) npyv_f64 r = npyv_div_f64(a, b); npyv_store_till_f64((npy_double*)dst, len, r); } - #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_f64 a = npyv_load_till_f64((const npy_double*)src0, len, 1.0); - npyv_f64 r = npyv_div_f64(a, b); - npyv_store_till_f64((npy_double*)dst, len, r); - } - #endif // #if (1 || 0) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -1507,8 +1134,6 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(DOUBLE_divide_indexed) -#undef WORKAROUND_CLANG_PARTIAL_LOAD_BUG - //############################################################################### //## Complex Single/Double precision //############################################################################### @@ -1595,7 +1220,7 @@ simd_csquare_f64(npyv_f64 x) { return simd_cmul_f64(x, x); } #endif -#line 381 +#line 286 #if NPY_SIMD_F32 NPY_FINLINE npyv_f32 simd_cabsolute_f32(npyv_f32 re, npyv_f32 im) @@ -1639,7 +1264,7 @@ simd_cabsolute_f32(npyv_f32 re, npyv_f32 im) } #endif // VECTOR -#line 381 +#line 286 #if NPY_SIMD_F64 NPY_FINLINE npyv_f64 simd_cabsolute_f64(npyv_f64 re, npyv_f64 im) @@ -1687,8 +1312,8 @@ simd_cabsolute_f64(npyv_f64 re, npyv_f64 im) /******************************************************************************** ** Defining ufunc inner functions ********************************************************************************/ -#line 437 -#line 445 +#line 342 +#line 350 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_add) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -1709,6 +1334,16 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_add) } #endif #if NPY_SIMD_F32 + // Certain versions of Apple clang (commonly used in CI images) produce + // non-deterministic output in the mul path with AVX2 enabled on x86_64. + // Work around by scalarising. + #if 0 \ + && defined(NPY_CPU_AMD64) && defined(__clang__) \ + && defined(__apple_build_version__) \ + && __apple_build_version__ >= 14000000 \ + && __apple_build_version__ < 14030000 + goto loop_scalar; + #endif // end affected Apple clang. if (is_mem_overlap(b_src0, b_ssrc0, b_dst, b_sdst, len) || is_mem_overlap(b_src1, b_ssrc1, b_dst, b_sdst, len) || b_sdst % sizeof(npy_float) != 0 || b_sdst == 0 || @@ -1930,7 +1565,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(CFLOAT_add_indexed) return 0; } -#line 445 +#line 350 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_subtract) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -1951,6 +1586,16 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_subtract) } #endif #if NPY_SIMD_F32 + // Certain versions of Apple clang (commonly used in CI images) produce + // non-deterministic output in the mul path with AVX2 enabled on x86_64. + // Work around by scalarising. + #if 0 \ + && defined(NPY_CPU_AMD64) && defined(__clang__) \ + && defined(__apple_build_version__) \ + && __apple_build_version__ >= 14000000 \ + && __apple_build_version__ < 14030000 + goto loop_scalar; + #endif // end affected Apple clang. if (is_mem_overlap(b_src0, b_ssrc0, b_dst, b_sdst, len) || is_mem_overlap(b_src1, b_ssrc1, b_dst, b_sdst, len) || b_sdst % sizeof(npy_float) != 0 || b_sdst == 0 || @@ -2172,7 +1817,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(CFLOAT_subtract_indexed) return 0; } -#line 445 +#line 350 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_multiply) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -2193,6 +1838,16 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_multiply) } #endif #if NPY_SIMD_F32 + // Certain versions of Apple clang (commonly used in CI images) produce + // non-deterministic output in the mul path with AVX2 enabled on x86_64. + // Work around by scalarising. + #if 1 \ + && defined(NPY_CPU_AMD64) && defined(__clang__) \ + && defined(__apple_build_version__) \ + && __apple_build_version__ >= 14000000 \ + && __apple_build_version__ < 14030000 + goto loop_scalar; + #endif // end affected Apple clang. if (is_mem_overlap(b_src0, b_ssrc0, b_dst, b_sdst, len) || is_mem_overlap(b_src1, b_ssrc1, b_dst, b_sdst, len) || b_sdst % sizeof(npy_float) != 0 || b_sdst == 0 || @@ -2415,7 +2070,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(CFLOAT_multiply_indexed) } -#line 691 +#line 606 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_conjugate) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -2503,7 +2158,7 @@ loop_scalar: } } -#line 691 +#line 606 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CFLOAT_square) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -2592,8 +2247,8 @@ loop_scalar: } -#line 437 -#line 445 +#line 342 +#line 350 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_add) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -2614,6 +2269,16 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_add) } #endif #if NPY_SIMD_F64 + // Certain versions of Apple clang (commonly used in CI images) produce + // non-deterministic output in the mul path with AVX2 enabled on x86_64. + // Work around by scalarising. + #if 0 \ + && defined(NPY_CPU_AMD64) && defined(__clang__) \ + && defined(__apple_build_version__) \ + && __apple_build_version__ >= 14000000 \ + && __apple_build_version__ < 14030000 + goto loop_scalar; + #endif // end affected Apple clang. if (is_mem_overlap(b_src0, b_ssrc0, b_dst, b_sdst, len) || is_mem_overlap(b_src1, b_ssrc1, b_dst, b_sdst, len) || b_sdst % sizeof(npy_double) != 0 || b_sdst == 0 || @@ -2835,7 +2500,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(CDOUBLE_add_indexed) return 0; } -#line 445 +#line 350 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_subtract) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -2856,6 +2521,16 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_subtract) } #endif #if NPY_SIMD_F64 + // Certain versions of Apple clang (commonly used in CI images) produce + // non-deterministic output in the mul path with AVX2 enabled on x86_64. + // Work around by scalarising. + #if 0 \ + && defined(NPY_CPU_AMD64) && defined(__clang__) \ + && defined(__apple_build_version__) \ + && __apple_build_version__ >= 14000000 \ + && __apple_build_version__ < 14030000 + goto loop_scalar; + #endif // end affected Apple clang. if (is_mem_overlap(b_src0, b_ssrc0, b_dst, b_sdst, len) || is_mem_overlap(b_src1, b_ssrc1, b_dst, b_sdst, len) || b_sdst % sizeof(npy_double) != 0 || b_sdst == 0 || @@ -3077,7 +2752,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(CDOUBLE_subtract_indexed) return 0; } -#line 445 +#line 350 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_multiply) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -3098,6 +2773,16 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_multiply) } #endif #if NPY_SIMD_F64 + // Certain versions of Apple clang (commonly used in CI images) produce + // non-deterministic output in the mul path with AVX2 enabled on x86_64. + // Work around by scalarising. + #if 1 \ + && defined(NPY_CPU_AMD64) && defined(__clang__) \ + && defined(__apple_build_version__) \ + && __apple_build_version__ >= 14000000 \ + && __apple_build_version__ < 14030000 + goto loop_scalar; + #endif // end affected Apple clang. if (is_mem_overlap(b_src0, b_ssrc0, b_dst, b_sdst, len) || is_mem_overlap(b_src1, b_ssrc1, b_dst, b_sdst, len) || b_sdst % sizeof(npy_double) != 0 || b_sdst == 0 || @@ -3320,7 +3005,7 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(CDOUBLE_multiply_indexed) } -#line 691 +#line 606 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_conjugate) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -3408,7 +3093,7 @@ loop_scalar: } } -#line 691 +#line 606 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(CDOUBLE_square) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { diff --git a/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src b/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src index 7ba3981e81..30111258d6 100644 --- a/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src +++ b/contrib/python/numpy/py3/numpy/core/src/umath/loops_arithm_fp.dispatch.c.src @@ -31,59 +31,6 @@ /******************************************************************************** ** Defining ufunc inner functions ********************************************************************************/ - -/* - * clang has a bug that's present at -O1 or greater. When partially loading a - * vector register for a divide operation, the remaining elements are set - * to 1 to avoid divide-by-zero. The partial load is paired with a partial - * store after the divide operation. clang notices that the entire register - * is not needed for the store and optimizes out the fill of 1 to the remaining - * elements. This causes either a divide-by-zero or 0/0 with invalid exception - * that we were trying to avoid by filling. - * - * Using a dummy variable marked 'volatile' convinces clang not to ignore - * the explicit fill of remaining elements. If `-ftrapping-math` is - * supported, then it'll also avoid the bug. `-ftrapping-math` is supported - * on Apple clang v12+ for x86_64. It is not currently supported for arm64. - * `-ftrapping-math` is set by default of Numpy builds in - * numpy/distutils/ccompiler.py. - * - * Note: Apple clang and clang upstream have different versions that overlap - */ -#if defined(__clang__) - #if defined(__apple_build_version__) - // Apple Clang - #if __apple_build_version__ < 12000000 - // Apple Clang before v12 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Apple Clang after v12, targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 0 - #else - // Apple Clang after v12, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #endif - #else - // Clang, not Apple Clang - #if __clang_major__ < 10 - // Clang before v10 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #elif defined(_MSC_VER) - // clang-cl has the same bug - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Clang v10+, targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 0 - #else - // Clang v10+, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 1 - #endif - #endif -#else -// Not a Clang compiler -#define WORKAROUND_CLANG_PARTIAL_LOAD_BUG 0 -#endif - /**begin repeat * Float types * #type = npy_float, npy_double# @@ -148,12 +95,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) npyv_store_@sfx@((@type@*)dst, r0); npyv_store_@sfx@((@type@*)(dst + vstep), r1); } - #if @is_div@ && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if @is_div@ && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, src1 += vstep, dst += vstep) { #if @is_div@ npyv_@sfx@ a = npyv_load_till_@sfx@((const @type@*)src0, len, 1.0@c@); npyv_@sfx@ b = npyv_load_till_@sfx@((const @type@*)src1, len, 1.0@c@); @@ -164,15 +106,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) npyv_@sfx@ r = npyv_@intrin@_@sfx@(a, b); npyv_store_till_@sfx@((@type@*)dst, len, r); } - #if @is_div@ && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for divide and working around clang partial load bug - if(len > 0){ - npyv_@sfx@ a = npyv_load_till_@sfx@((const @type@*)src0, len, 1.0@c@); - volatile npyv_@sfx@ b = npyv_load_till_@sfx@((const @type@*)src1, len, 1.0@c@); - npyv_@sfx@ r = npyv_@intrin@_@sfx@(a, b); - npyv_store_till_@sfx@((@type@*)dst, len, r); - } - #endif // #if @is_div@ && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc0 == 0 && ssrc1 == sizeof(@type@) && sdst == ssrc1) { npyv_@sfx@ a = npyv_setall_@sfx@(*((@type@*)src0)); @@ -184,12 +117,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) npyv_store_@sfx@((@type@*)dst, r0); npyv_store_@sfx@((@type@*)(dst + vstep), r1); } - #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src1 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src1 += vstep, dst += vstep) { #if @is_div@ || @is_mul@ npyv_@sfx@ b = npyv_load_till_@sfx@((const @type@*)src1, len, 1.0@c@); #else @@ -198,14 +126,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) npyv_@sfx@ r = npyv_@intrin@_@sfx@(a, b); npyv_store_till_@sfx@((@type@*)dst, len, r); } - #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_@sfx@ b = npyv_load_till_@sfx@((const @type@*)src1, len, 1.0@c@); - npyv_@sfx@ r = npyv_@intrin@_@sfx@(a, b); - npyv_store_till_@sfx@((@type@*)dst, len, r); - } - #endif // #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else if (ssrc1 == 0 && ssrc0 == sizeof(@type@) && sdst == ssrc0) { npyv_@sfx@ b = npyv_setall_@sfx@(*((@type@*)src1)); @@ -217,12 +137,7 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) npyv_store_@sfx@((@type@*)dst, r0); npyv_store_@sfx@((@type@*)(dst + vstep), r1); } - #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - const int vstop = hstep - 1; - #else - const int vstop = 0; - #endif // #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - for (; len > vstop; len -= hstep, src0 += vstep, dst += vstep) { + for (; len > 0; len -= hstep, src0 += vstep, dst += vstep) { #if @is_div@ || @is_mul@ npyv_@sfx@ a = npyv_load_till_@sfx@((const @type@*)src0, len, 1.0@c@); #else @@ -231,14 +146,6 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) npyv_@sfx@ r = npyv_@intrin@_@sfx@(a, b); npyv_store_till_@sfx@((@type@*)dst, len, r); } - #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG - // last partial iteration for multiply / divide and working around clang partial load bug - if(len > 0){ - volatile npyv_@sfx@ a = npyv_load_till_@sfx@((const @type@*)src0, len, 1.0@c@); - npyv_@sfx@ r = npyv_@intrin@_@sfx@(a, b); - npyv_store_till_@sfx@((@type@*)dst, len, r); - } - #endif // #if (@is_div@ || @is_mul@) && WORKAROUND_CLANG_PARTIAL_LOAD_BUG } else { goto loop_scalar; } @@ -279,8 +186,6 @@ NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@_indexed) /**end repeat1**/ /**end repeat**/ -#undef WORKAROUND_CLANG_PARTIAL_LOAD_BUG - //############################################################################### //## Complex Single/Double precision //############################################################################### @@ -462,6 +367,16 @@ NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(@TYPE@_@kind@) } #endif #if @VECTOR@ + // Certain versions of Apple clang (commonly used in CI images) produce + // non-deterministic output in the mul path with AVX2 enabled on x86_64. + // Work around by scalarising. + #if @is_mul@ \ + && defined(NPY_CPU_AMD64) && defined(__clang__) \ + && defined(__apple_build_version__) \ + && __apple_build_version__ >= 14000000 \ + && __apple_build_version__ < 14030000 + goto loop_scalar; + #endif // end affected Apple clang. if (is_mem_overlap(b_src0, b_ssrc0, b_dst, b_sdst, len) || is_mem_overlap(b_src1, b_ssrc1, b_dst, b_sdst, len) || b_sdst % sizeof(@ftype@) != 0 || b_sdst == 0 || diff --git a/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c b/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c index f686e09ade..02d03e22e6 100644 --- a/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c +++ b/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c @@ -103,62 +103,10 @@ NPY_FINLINE double c_square_f64(double a) #define CONTIG 0 #define NCONTIG 1 -/* - * clang has a bug that's present at -O1 or greater. When partially loading a - * vector register for a reciprocal operation, the remaining elements are set - * to 1 to avoid divide-by-zero. The partial load is paired with a partial - * store after the reciprocal operation. clang notices that the entire register - * is not needed for the store and optimizes out the fill of 1 to the remaining - * elements. This causes either a divide-by-zero or 0/0 with invalid exception - * that we were trying to avoid by filling. - * - * Using a dummy variable marked 'volatile' convinces clang not to ignore - * the explicit fill of remaining elements. If `-ftrapping-math` is - * supported, then it'll also avoid the bug. `-ftrapping-math` is supported - * on Apple clang v12+ for x86_64. It is not currently supported for arm64. - * `-ftrapping-math` is set by default of Numpy builds in - * numpy/distutils/ccompiler.py. - * - * Note: Apple clang and clang upstream have different versions that overlap - */ -#if defined(__clang__) - #if defined(__apple_build_version__) - // Apple Clang - #if __apple_build_version__ < 12000000 - // Apple Clang before v12 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Apple Clang after v12, targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 0 - #else - // Apple Clang after v12, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #endif - #else - // Clang, not Apple Clang - #if __clang_major__ < 10 - // Clang before v10 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #elif defined(_MSC_VER) - // clang-cl has the same bug - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Clang v10+, targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 0 - #else - // Clang v10+, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #endif - #endif -#else -// Not a Clang compiler -#define WORKAROUND_CLANG_RECIPROCAL_BUG 0 -#endif - -#line 153 +#line 101 #if NPY_SIMD_F32 -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_rint_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -170,7 +118,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -180,7 +128,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -190,7 +138,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_rint_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -200,7 +148,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_rint_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -210,7 +158,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_rint_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -219,7 +167,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -228,7 +176,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -237,7 +185,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -278,15 +226,6 @@ static void simd_FLOAT_rint_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -298,7 +237,7 @@ static void simd_FLOAT_rint_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_rint_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -310,7 +249,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -320,7 +259,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -330,7 +269,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_rint_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -340,7 +279,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_rint_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -350,7 +289,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_rint_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -359,7 +298,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -368,7 +307,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -377,7 +316,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -418,15 +357,6 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -438,7 +368,7 @@ static void simd_FLOAT_rint_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_rint_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -450,7 +380,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -460,7 +390,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -470,7 +400,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_rint_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -480,7 +410,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_rint_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -490,7 +420,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_rint_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -499,7 +429,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -508,7 +438,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -517,7 +447,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -558,15 +488,6 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -578,7 +499,7 @@ static void simd_FLOAT_rint_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_rint_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -590,7 +511,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -600,7 +521,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -610,7 +531,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_rint_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -620,7 +541,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_rint_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -630,7 +551,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_rint_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -639,7 +560,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -648,7 +569,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -657,7 +578,7 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -698,15 +619,6 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_rint_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -719,8 +631,8 @@ static void simd_FLOAT_rint_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_floor_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -732,7 +644,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -742,7 +654,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -752,7 +664,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_floor_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -762,7 +674,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_floor_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -772,7 +684,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_floor_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -781,7 +693,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -790,7 +702,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -799,7 +711,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -840,15 +752,6 @@ static void simd_FLOAT_floor_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -860,7 +763,7 @@ static void simd_FLOAT_floor_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_floor_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -872,7 +775,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -882,7 +785,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -892,7 +795,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_floor_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -902,7 +805,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_floor_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -912,7 +815,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_floor_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -921,7 +824,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -930,7 +833,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -939,7 +842,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -980,15 +883,6 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1000,7 +894,7 @@ static void simd_FLOAT_floor_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_floor_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1012,7 +906,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -1022,7 +916,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -1032,7 +926,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_floor_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -1042,7 +936,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_floor_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -1052,7 +946,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_floor_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -1061,7 +955,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -1070,7 +964,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -1079,7 +973,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -1120,15 +1014,6 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1140,7 +1025,7 @@ static void simd_FLOAT_floor_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_floor_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1152,7 +1037,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -1162,7 +1047,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -1172,7 +1057,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_floor_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -1182,7 +1067,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_floor_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -1192,7 +1077,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_floor_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -1201,7 +1086,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -1210,7 +1095,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -1219,7 +1104,7 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -1260,15 +1145,6 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_floor_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1281,8 +1157,8 @@ static void simd_FLOAT_floor_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_ceil_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1294,7 +1170,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -1304,7 +1180,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -1314,7 +1190,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_ceil_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -1324,7 +1200,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_ceil_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -1334,7 +1210,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_ceil_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -1343,7 +1219,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -1352,7 +1228,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -1361,7 +1237,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -1402,15 +1278,6 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1422,7 +1289,7 @@ static void simd_FLOAT_ceil_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_ceil_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1434,7 +1301,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -1444,7 +1311,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -1454,7 +1321,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_ceil_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -1464,7 +1331,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_ceil_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -1474,7 +1341,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_ceil_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -1483,7 +1350,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -1492,7 +1359,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -1501,7 +1368,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -1542,15 +1409,6 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1562,7 +1420,7 @@ static void simd_FLOAT_ceil_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_ceil_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1574,7 +1432,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -1584,7 +1442,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -1594,7 +1452,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_ceil_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -1604,7 +1462,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_ceil_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -1614,7 +1472,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_ceil_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -1623,7 +1481,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -1632,7 +1490,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -1641,7 +1499,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -1682,15 +1540,6 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1702,7 +1551,7 @@ static void simd_FLOAT_ceil_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_ceil_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1714,7 +1563,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -1724,7 +1573,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -1734,7 +1583,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_ceil_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -1744,7 +1593,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_ceil_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -1754,7 +1603,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_ceil_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -1763,7 +1612,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -1772,7 +1621,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -1781,7 +1630,7 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -1822,15 +1671,6 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_ceil_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1843,8 +1683,8 @@ static void simd_FLOAT_ceil_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_trunc_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1856,7 +1696,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -1866,7 +1706,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -1876,7 +1716,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_trunc_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -1886,7 +1726,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_trunc_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -1896,7 +1736,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_trunc_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -1905,7 +1745,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -1914,7 +1754,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -1923,7 +1763,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -1964,15 +1804,6 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -1984,7 +1815,7 @@ static void simd_FLOAT_trunc_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_trunc_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -1996,7 +1827,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2006,7 +1837,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -2016,7 +1847,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_trunc_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -2026,7 +1857,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_trunc_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -2036,7 +1867,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_trunc_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -2045,7 +1876,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -2054,7 +1885,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -2063,7 +1894,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -2104,15 +1935,6 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -2124,7 +1946,7 @@ static void simd_FLOAT_trunc_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_trunc_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -2136,7 +1958,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2146,7 +1968,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -2156,7 +1978,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_trunc_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -2166,7 +1988,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_trunc_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -2176,7 +1998,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_trunc_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -2185,7 +2007,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -2194,7 +2016,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -2203,7 +2025,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -2244,15 +2066,6 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -2264,7 +2077,7 @@ static void simd_FLOAT_trunc_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_trunc_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -2276,7 +2089,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2286,7 +2099,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -2296,7 +2109,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_trunc_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -2306,7 +2119,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_trunc_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -2316,7 +2129,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_trunc_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -2325,7 +2138,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -2334,7 +2147,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -2343,7 +2156,7 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -2384,15 +2197,6 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_trunc_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -2405,8 +2209,8 @@ static void simd_FLOAT_trunc_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_sqrt_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -2418,7 +2222,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2428,7 +2232,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -2438,7 +2242,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_sqrt_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -2448,7 +2252,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_sqrt_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -2458,7 +2262,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_sqrt_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -2467,7 +2271,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -2476,7 +2280,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -2485,7 +2289,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -2526,15 +2330,6 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -2546,7 +2341,7 @@ static void simd_FLOAT_sqrt_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_sqrt_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -2558,7 +2353,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2568,7 +2363,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -2578,7 +2373,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_sqrt_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -2588,7 +2383,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_sqrt_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -2598,7 +2393,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_sqrt_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -2607,7 +2402,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -2616,7 +2411,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -2625,7 +2420,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -2666,15 +2461,6 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -2686,7 +2472,7 @@ static void simd_FLOAT_sqrt_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_sqrt_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -2698,7 +2484,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2708,7 +2494,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -2718,7 +2504,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_sqrt_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -2728,7 +2514,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_sqrt_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -2738,7 +2524,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_sqrt_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -2747,7 +2533,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -2756,7 +2542,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -2765,7 +2551,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -2806,15 +2592,6 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -2826,7 +2603,7 @@ static void simd_FLOAT_sqrt_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_sqrt_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -2838,7 +2615,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2848,7 +2625,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -2858,7 +2635,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_sqrt_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -2868,7 +2645,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_sqrt_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -2878,7 +2655,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_sqrt_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -2887,7 +2664,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -2896,7 +2673,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -2905,7 +2682,7 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -2946,15 +2723,6 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_sqrt_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -2967,8 +2735,8 @@ static void simd_FLOAT_sqrt_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_absolute_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -2980,7 +2748,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -2990,7 +2758,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3000,7 +2768,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_abs_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3010,7 +2778,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_abs_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -3020,7 +2788,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_abs_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -3029,7 +2797,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -3038,7 +2806,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -3047,7 +2815,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -3088,15 +2856,6 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -3108,7 +2867,7 @@ static void simd_FLOAT_absolute_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_absolute_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -3120,7 +2879,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -3130,7 +2889,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3140,7 +2899,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_abs_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3150,7 +2909,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_abs_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -3160,7 +2919,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_abs_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -3169,7 +2928,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -3178,7 +2937,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -3187,7 +2946,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -3228,15 +2987,6 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -3248,7 +2998,7 @@ static void simd_FLOAT_absolute_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_absolute_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -3260,7 +3010,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -3270,7 +3020,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3280,7 +3030,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_abs_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3290,7 +3040,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_abs_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -3300,7 +3050,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_abs_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -3309,7 +3059,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -3318,7 +3068,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -3327,7 +3077,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -3368,15 +3118,6 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -3388,7 +3129,7 @@ static void simd_FLOAT_absolute_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_absolute_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -3400,7 +3141,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -3410,7 +3151,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3420,7 +3161,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_abs_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3430,7 +3171,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_abs_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -3440,7 +3181,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_abs_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -3449,7 +3190,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -3458,7 +3199,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -3467,7 +3208,7 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -3508,15 +3249,6 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_abs_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -3529,8 +3261,8 @@ static void simd_FLOAT_absolute_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_square_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -3542,7 +3274,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -3552,7 +3284,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_square_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3562,7 +3294,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_square_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3572,7 +3304,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_square_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -3582,7 +3314,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_square_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -3591,7 +3323,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -3600,7 +3332,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -3609,7 +3341,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -3650,15 +3382,6 @@ static void simd_FLOAT_square_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_square_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -3670,7 +3393,7 @@ static void simd_FLOAT_square_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_square_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -3682,7 +3405,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -3692,7 +3415,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_square_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3702,7 +3425,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_square_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3712,7 +3435,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_square_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -3722,7 +3445,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_square_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -3731,7 +3454,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -3740,7 +3463,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -3749,7 +3472,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -3790,15 +3513,6 @@ static void simd_FLOAT_square_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_square_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -3810,7 +3524,7 @@ static void simd_FLOAT_square_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_square_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -3822,7 +3536,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -3832,7 +3546,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_square_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3842,7 +3556,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_square_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3852,7 +3566,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_square_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -3862,7 +3576,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_square_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -3871,7 +3585,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -3880,7 +3594,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -3889,7 +3603,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -3930,15 +3644,6 @@ static void simd_FLOAT_square_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_square_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -3950,7 +3655,7 @@ static void simd_FLOAT_square_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_square_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -3962,7 +3667,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -3972,7 +3677,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_square_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -3982,7 +3687,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_square_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -3992,7 +3697,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_square_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -4002,7 +3707,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_square_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -4011,7 +3716,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -4020,7 +3725,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -4029,7 +3734,7 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -4070,15 +3775,6 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f32 v_unary0 = npyv_square_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -4091,8 +3787,8 @@ static void simd_FLOAT_square_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_FLOAT_reciprocal_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -4104,7 +3800,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -4114,7 +3810,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -4124,7 +3820,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG npyv_f32 v_unary1 = npyv_recip_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -4134,7 +3830,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG npyv_f32 v_unary2 = npyv_recip_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -4144,7 +3840,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG npyv_f32 v_unary3 = npyv_recip_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -4153,7 +3849,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -4162,7 +3858,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -4171,7 +3867,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -4212,15 +3908,6 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -4232,7 +3919,7 @@ static void simd_FLOAT_reciprocal_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_reciprocal_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -4244,7 +3931,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -4254,7 +3941,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -4264,7 +3951,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG npyv_f32 v_unary1 = npyv_recip_f32(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -4274,7 +3961,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG npyv_f32 v_unary2 = npyv_recip_f32(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -4284,7 +3971,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG npyv_f32 v_unary3 = npyv_recip_f32(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -4293,7 +3980,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -4302,7 +3989,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -4311,7 +3998,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -4352,15 +4039,6 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #if CONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -4372,7 +4050,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_reciprocal_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -4384,7 +4062,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -4394,7 +4072,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -4404,7 +4082,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG npyv_f32 v_unary1 = npyv_recip_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -4414,7 +4092,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG npyv_f32 v_unary2 = npyv_recip_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -4424,7 +4102,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG npyv_f32 v_unary3 = npyv_recip_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -4433,7 +4111,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -4442,7 +4120,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -4451,7 +4129,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -4492,15 +4170,6 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -4512,7 +4181,7 @@ static void simd_FLOAT_reciprocal_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -4524,7 +4193,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f32 v_src0 = npyv_load_f32(src + vstep*0); @@ -4534,7 +4203,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f32 v_src1 = npyv_load_f32(src + vstep*1); @@ -4544,7 +4213,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG npyv_f32 v_unary1 = npyv_recip_f32(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f32 v_src2 = npyv_load_f32(src + vstep*2); @@ -4554,7 +4223,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG npyv_f32 v_unary2 = npyv_recip_f32(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f32 v_src3 = npyv_load_f32(src + vstep*3); @@ -4564,7 +4233,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG npyv_f32 v_unary3 = npyv_recip_f32(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*0, v_unary0); @@ -4573,7 +4242,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*1, v_unary1); @@ -4582,7 +4251,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*2, v_unary2); @@ -4591,7 +4260,7 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f32(dst + vstep*3, v_unary3); @@ -4632,15 +4301,6 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG npyv_f32 v_src0 = npyv_loadn_tillz_f32(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f32 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f32 v_unary0 = npyv_recip_f32(v_src0); #if NCONTIG == CONTIG npyv_store_till_f32(dst, len, v_unary0); @@ -4655,10 +4315,10 @@ static void simd_FLOAT_reciprocal_NCONTIG_NCONTIG #endif // NPY_SIMD_F32 -#line 153 +#line 101 #if NPY_SIMD_F64 -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_rint_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -4670,7 +4330,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -4680,7 +4340,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -4690,7 +4350,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_rint_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -4700,7 +4360,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_rint_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -4710,7 +4370,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_rint_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -4719,7 +4379,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -4728,7 +4388,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -4737,7 +4397,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -4778,15 +4438,6 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -4798,7 +4449,7 @@ static void simd_DOUBLE_rint_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_rint_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -4810,7 +4461,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -4820,7 +4471,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -4830,7 +4481,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_rint_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -4840,7 +4491,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_rint_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -4850,7 +4501,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_rint_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -4859,7 +4510,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -4868,7 +4519,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -4877,7 +4528,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -4918,15 +4569,6 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -4938,7 +4580,7 @@ static void simd_DOUBLE_rint_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_rint_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -4950,7 +4592,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -4960,7 +4602,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -4970,7 +4612,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_rint_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -4980,7 +4622,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_rint_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -4990,7 +4632,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_rint_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -4999,7 +4641,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5008,7 +4650,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -5017,7 +4659,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -5058,15 +4700,6 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -5078,7 +4711,7 @@ static void simd_DOUBLE_rint_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_rint_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -5090,7 +4723,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -5100,7 +4733,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -5110,7 +4743,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_rint_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -5120,7 +4753,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_rint_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -5130,7 +4763,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_rint_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -5139,7 +4772,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5148,7 +4781,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -5157,7 +4790,7 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -5198,15 +4831,6 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_rint_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -5219,8 +4843,8 @@ static void simd_DOUBLE_rint_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_floor_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -5232,7 +4856,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -5242,7 +4866,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -5252,7 +4876,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_floor_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -5262,7 +4886,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_floor_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -5272,7 +4896,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_floor_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -5281,7 +4905,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5290,7 +4914,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -5299,7 +4923,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -5340,15 +4964,6 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -5360,7 +4975,7 @@ static void simd_DOUBLE_floor_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_floor_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -5372,7 +4987,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -5382,7 +4997,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -5392,7 +5007,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_floor_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -5402,7 +5017,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_floor_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -5412,7 +5027,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_floor_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -5421,7 +5036,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5430,7 +5045,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -5439,7 +5054,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -5480,15 +5095,6 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -5500,7 +5106,7 @@ static void simd_DOUBLE_floor_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_floor_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -5512,7 +5118,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -5522,7 +5128,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -5532,7 +5138,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_floor_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -5542,7 +5148,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_floor_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -5552,7 +5158,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_floor_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -5561,7 +5167,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5570,7 +5176,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -5579,7 +5185,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -5620,15 +5226,6 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -5640,7 +5237,7 @@ static void simd_DOUBLE_floor_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_floor_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -5652,7 +5249,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -5662,7 +5259,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -5672,7 +5269,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_floor_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -5682,7 +5279,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_floor_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -5692,7 +5289,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_floor_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -5701,7 +5298,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5710,7 +5307,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -5719,7 +5316,7 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -5760,15 +5357,6 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_floor_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -5781,8 +5369,8 @@ static void simd_DOUBLE_floor_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_ceil_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -5794,7 +5382,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -5804,7 +5392,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -5814,7 +5402,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_ceil_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -5824,7 +5412,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_ceil_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -5834,7 +5422,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_ceil_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -5843,7 +5431,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5852,7 +5440,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -5861,7 +5449,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -5902,15 +5490,6 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -5922,7 +5501,7 @@ static void simd_DOUBLE_ceil_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_ceil_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -5934,7 +5513,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -5944,7 +5523,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -5954,7 +5533,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_ceil_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -5964,7 +5543,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_ceil_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -5974,7 +5553,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_ceil_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -5983,7 +5562,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -5992,7 +5571,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6001,7 +5580,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -6042,15 +5621,6 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -6062,7 +5632,7 @@ static void simd_DOUBLE_ceil_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_ceil_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -6074,7 +5644,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -6084,7 +5654,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -6094,7 +5664,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_ceil_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -6104,7 +5674,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_ceil_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -6114,7 +5684,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_ceil_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -6123,7 +5693,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -6132,7 +5702,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6141,7 +5711,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -6182,15 +5752,6 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -6202,7 +5763,7 @@ static void simd_DOUBLE_ceil_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_ceil_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -6214,7 +5775,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -6224,7 +5785,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -6234,7 +5795,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_ceil_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -6244,7 +5805,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_ceil_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -6254,7 +5815,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_ceil_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -6263,7 +5824,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -6272,7 +5833,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6281,7 +5842,7 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -6322,15 +5883,6 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_ceil_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -6343,8 +5895,8 @@ static void simd_DOUBLE_ceil_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_trunc_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -6356,7 +5908,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -6366,7 +5918,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -6376,7 +5928,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_trunc_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -6386,7 +5938,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_trunc_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -6396,7 +5948,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_trunc_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -6405,7 +5957,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -6414,7 +5966,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6423,7 +5975,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -6464,15 +6016,6 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -6484,7 +6027,7 @@ static void simd_DOUBLE_trunc_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_trunc_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -6496,7 +6039,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -6506,7 +6049,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -6516,7 +6059,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_trunc_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -6526,7 +6069,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_trunc_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -6536,7 +6079,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_trunc_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -6545,7 +6088,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -6554,7 +6097,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6563,7 +6106,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -6604,15 +6147,6 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -6624,7 +6158,7 @@ static void simd_DOUBLE_trunc_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_trunc_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -6636,7 +6170,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -6646,7 +6180,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -6656,7 +6190,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_trunc_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -6666,7 +6200,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_trunc_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -6676,7 +6210,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_trunc_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -6685,7 +6219,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -6694,7 +6228,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6703,7 +6237,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -6744,15 +6278,6 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -6764,7 +6289,7 @@ static void simd_DOUBLE_trunc_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_trunc_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -6776,7 +6301,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -6786,7 +6311,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -6796,7 +6321,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_trunc_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -6806,7 +6331,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_trunc_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -6816,7 +6341,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_trunc_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -6825,7 +6350,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -6834,7 +6359,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6843,7 +6368,7 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -6884,15 +6409,6 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_trunc_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -6905,8 +6421,8 @@ static void simd_DOUBLE_trunc_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_sqrt_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -6918,7 +6434,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -6928,7 +6444,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -6938,7 +6454,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_sqrt_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -6948,7 +6464,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_sqrt_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -6958,7 +6474,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_sqrt_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -6967,7 +6483,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -6976,7 +6492,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -6985,7 +6501,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -7026,15 +6542,6 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -7046,7 +6553,7 @@ static void simd_DOUBLE_sqrt_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_sqrt_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -7058,7 +6565,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -7068,7 +6575,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -7078,7 +6585,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_sqrt_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -7088,7 +6595,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_sqrt_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -7098,7 +6605,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_sqrt_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -7107,7 +6614,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -7116,7 +6623,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -7125,7 +6632,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -7166,15 +6673,6 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -7186,7 +6684,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_sqrt_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -7198,7 +6696,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -7208,7 +6706,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -7218,7 +6716,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_sqrt_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -7228,7 +6726,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_sqrt_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -7238,7 +6736,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_sqrt_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -7247,7 +6745,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -7256,7 +6754,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -7265,7 +6763,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -7306,15 +6804,6 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -7326,7 +6815,7 @@ static void simd_DOUBLE_sqrt_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -7338,7 +6827,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -7348,7 +6837,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -7358,7 +6847,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_sqrt_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -7368,7 +6857,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_sqrt_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -7378,7 +6867,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_sqrt_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -7387,7 +6876,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -7396,7 +6885,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -7405,7 +6894,7 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -7446,15 +6935,6 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_sqrt_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -7467,8 +6947,8 @@ static void simd_DOUBLE_sqrt_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_absolute_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -7480,7 +6960,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -7490,7 +6970,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -7500,7 +6980,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_abs_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -7510,7 +6990,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_abs_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -7520,7 +7000,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_abs_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -7529,7 +7009,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -7538,7 +7018,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -7547,7 +7027,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -7588,15 +7068,6 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -7608,7 +7079,7 @@ static void simd_DOUBLE_absolute_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_absolute_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -7620,7 +7091,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -7630,7 +7101,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -7640,7 +7111,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_abs_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -7650,7 +7121,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_abs_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -7660,7 +7131,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_abs_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -7669,7 +7140,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -7678,7 +7149,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -7687,7 +7158,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -7728,15 +7199,6 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -7748,7 +7210,7 @@ static void simd_DOUBLE_absolute_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_absolute_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -7760,7 +7222,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -7770,7 +7232,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -7780,7 +7242,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_abs_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -7790,7 +7252,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_abs_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -7800,7 +7262,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_abs_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -7809,7 +7271,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -7818,7 +7280,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -7827,7 +7289,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -7868,15 +7330,6 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -7888,7 +7341,7 @@ static void simd_DOUBLE_absolute_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_absolute_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -7900,7 +7353,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -7910,7 +7363,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -7920,7 +7373,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_abs_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -7930,7 +7383,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_abs_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -7940,7 +7393,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_abs_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -7949,7 +7402,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -7958,7 +7411,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -7967,7 +7420,7 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8008,15 +7461,6 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_abs_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -8029,8 +7473,8 @@ static void simd_DOUBLE_absolute_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_square_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -8042,7 +7486,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -8052,7 +7496,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_square_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -8062,7 +7506,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_square_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -8072,7 +7516,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_square_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -8082,7 +7526,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_square_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -8091,7 +7535,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -8100,7 +7544,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -8109,7 +7553,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8150,15 +7594,6 @@ static void simd_DOUBLE_square_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_square_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -8170,7 +7605,7 @@ static void simd_DOUBLE_square_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_square_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -8182,7 +7617,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -8192,7 +7627,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_square_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -8202,7 +7637,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_square_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -8212,7 +7647,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_square_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -8222,7 +7657,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_square_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -8231,7 +7666,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -8240,7 +7675,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -8249,7 +7684,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8290,15 +7725,6 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_square_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -8310,7 +7736,7 @@ static void simd_DOUBLE_square_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_square_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -8322,7 +7748,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -8332,7 +7758,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_square_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -8342,7 +7768,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_square_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -8352,7 +7778,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_square_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -8362,7 +7788,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_square_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -8371,7 +7797,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -8380,7 +7806,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -8389,7 +7815,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8430,15 +7856,6 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_square_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -8450,7 +7867,7 @@ static void simd_DOUBLE_square_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_square_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -8462,7 +7879,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -8472,7 +7889,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_square_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -8482,7 +7899,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_square_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -8492,7 +7909,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_square_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -8502,7 +7919,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_square_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -8511,7 +7928,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -8520,7 +7937,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -8529,7 +7946,7 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8570,15 +7987,6 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if 0 - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // 0 npyv_f64 v_unary0 = npyv_square_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -8591,8 +7999,8 @@ static void simd_DOUBLE_square_NCONTIG_NCONTIG } -#line 160 -#line 165 +#line 107 +#line 112 static void simd_DOUBLE_reciprocal_CONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -8604,7 +8012,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -8614,7 +8022,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -8624,7 +8032,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG npyv_f64 v_unary1 = npyv_recip_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -8634,7 +8042,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG npyv_f64 v_unary2 = npyv_recip_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -8644,7 +8052,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG npyv_f64 v_unary3 = npyv_recip_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -8653,7 +8061,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -8662,7 +8070,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -8671,7 +8079,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8712,15 +8120,6 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -8732,7 +8131,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -8744,7 +8143,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 4 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -8754,7 +8153,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #endif -#line 179 +#line 126 #if 4 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -8764,7 +8163,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG npyv_f64 v_unary1 = npyv_recip_f64(v_src1); #endif -#line 179 +#line 126 #if 4 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -8774,7 +8173,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG npyv_f64 v_unary2 = npyv_recip_f64(v_src2); #endif -#line 179 +#line 126 #if 4 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -8784,7 +8183,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG npyv_f64 v_unary3 = npyv_recip_f64(v_src3); #endif - #line 191 + #line 138 #if 4 > 0 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -8793,7 +8192,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 1 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -8802,7 +8201,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 2 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -8811,7 +8210,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG #endif #endif -#line 191 +#line 138 #if 4 > 3 #if CONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8852,15 +8251,6 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #if CONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -8872,7 +8262,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_CONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -8884,7 +8274,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if CONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -8894,7 +8284,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if CONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -8904,7 +8294,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG npyv_f64 v_unary1 = npyv_recip_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if CONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -8914,7 +8304,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG npyv_f64 v_unary2 = npyv_recip_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if CONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -8924,7 +8314,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG npyv_f64 v_unary3 = npyv_recip_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -8933,7 +8323,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -8942,7 +8332,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -8951,7 +8341,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -8992,15 +8382,6 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -9012,7 +8393,7 @@ static void simd_DOUBLE_reciprocal_CONTIG_NCONTIG npyv_cleanup(); } -#line 165 +#line 112 static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG (const void *_src, npy_intp ssrc, void *_dst, npy_intp sdst, npy_intp len) { @@ -9024,7 +8405,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG // unrolled iterations for (; len >= wstep; len -= wstep, src += ssrc*wstep, dst += sdst*wstep) { - #line 179 + #line 126 #if 2 > 0 #if NCONTIG == CONTIG npyv_f64 v_src0 = npyv_load_f64(src + vstep*0); @@ -9034,7 +8415,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #endif -#line 179 +#line 126 #if 2 > 1 #if NCONTIG == CONTIG npyv_f64 v_src1 = npyv_load_f64(src + vstep*1); @@ -9044,7 +8425,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG npyv_f64 v_unary1 = npyv_recip_f64(v_src1); #endif -#line 179 +#line 126 #if 2 > 2 #if NCONTIG == CONTIG npyv_f64 v_src2 = npyv_load_f64(src + vstep*2); @@ -9054,7 +8435,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG npyv_f64 v_unary2 = npyv_recip_f64(v_src2); #endif -#line 179 +#line 126 #if 2 > 3 #if NCONTIG == CONTIG npyv_f64 v_src3 = npyv_load_f64(src + vstep*3); @@ -9064,7 +8445,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG npyv_f64 v_unary3 = npyv_recip_f64(v_src3); #endif - #line 191 + #line 138 #if 2 > 0 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*0, v_unary0); @@ -9073,7 +8454,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 1 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*1, v_unary1); @@ -9082,7 +8463,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 2 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*2, v_unary2); @@ -9091,7 +8472,7 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG #endif #endif -#line 191 +#line 138 #if 2 > 3 #if NCONTIG == CONTIG npyv_store_f64(dst + vstep*3, v_unary3); @@ -9132,15 +8513,6 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG npyv_f64 v_src0 = npyv_loadn_tillz_f64(src, ssrc, len); #endif #endif - #if WORKAROUND_CLANG_RECIPROCAL_BUG - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_f64 unused_but_workaround_bug = v_src0; - #endif // WORKAROUND_CLANG_RECIPROCAL_BUG npyv_f64 v_unary0 = npyv_recip_f64(v_src0); #if NCONTIG == CONTIG npyv_store_till_f64(dst, len, v_unary0); @@ -9156,13 +8528,11 @@ static void simd_DOUBLE_reciprocal_NCONTIG_NCONTIG #endif // NPY_SIMD_F64 -#undef WORKAROUND_CLANG_RECIPROCAL_BUG - /******************************************************************************** ** Defining ufunc inner functions ********************************************************************************/ -#line 265 -#line 270 +#line 201 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_rint) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9212,7 +8582,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_floor) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9262,7 +8632,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_ceil) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9312,7 +8682,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_trunc) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9362,7 +8732,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_sqrt) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9412,7 +8782,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_absolute) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9462,7 +8832,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_square) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9512,7 +8882,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(FLOAT_reciprocal) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9563,8 +8933,8 @@ clear:; } -#line 265 -#line 270 +#line 201 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_rint) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9614,7 +8984,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_floor) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9664,7 +9034,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_ceil) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9714,7 +9084,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_trunc) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9764,7 +9134,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_sqrt) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9814,7 +9184,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_absolute) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9864,7 +9234,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_square) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { @@ -9914,7 +9284,7 @@ clear:; #endif } -#line 270 +#line 206 NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(DOUBLE_reciprocal) (char **args, npy_intp const *dimensions, npy_intp const *steps, void *NPY_UNUSED(func)) { diff --git a/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c.src b/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c.src index c4e7b8929f..f6404f6f7d 100644 --- a/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c.src +++ b/contrib/python/numpy/py3/numpy/core/src/umath/loops_unary_fp.dispatch.c.src @@ -93,58 +93,6 @@ NPY_FINLINE double c_square_f64(double a) #define CONTIG 0 #define NCONTIG 1 -/* - * clang has a bug that's present at -O1 or greater. When partially loading a - * vector register for a reciprocal operation, the remaining elements are set - * to 1 to avoid divide-by-zero. The partial load is paired with a partial - * store after the reciprocal operation. clang notices that the entire register - * is not needed for the store and optimizes out the fill of 1 to the remaining - * elements. This causes either a divide-by-zero or 0/0 with invalid exception - * that we were trying to avoid by filling. - * - * Using a dummy variable marked 'volatile' convinces clang not to ignore - * the explicit fill of remaining elements. If `-ftrapping-math` is - * supported, then it'll also avoid the bug. `-ftrapping-math` is supported - * on Apple clang v12+ for x86_64. It is not currently supported for arm64. - * `-ftrapping-math` is set by default of Numpy builds in - * numpy/distutils/ccompiler.py. - * - * Note: Apple clang and clang upstream have different versions that overlap - */ -#if defined(__clang__) - #if defined(__apple_build_version__) - // Apple Clang - #if __apple_build_version__ < 12000000 - // Apple Clang before v12 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Apple Clang after v12, targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 0 - #else - // Apple Clang after v12, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #endif - #else - // Clang, not Apple Clang - #if __clang_major__ < 10 - // Clang before v10 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #elif defined(_MSC_VER) - // clang-cl has the same bug - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #elif defined(NPY_CPU_X86) || defined(NPY_CPU_AMD64) - // Clang v10+, targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 0 - #else - // Clang v10+, not targeting i386 or x86_64 - #define WORKAROUND_CLANG_RECIPROCAL_BUG 1 - #endif - #endif -#else -// Not a Clang compiler -#define WORKAROUND_CLANG_RECIPROCAL_BUG 0 -#endif - /**begin repeat * #TYPE = FLOAT, DOUBLE# * #sfx = f32, f64# @@ -155,7 +103,6 @@ NPY_FINLINE double c_square_f64(double a) * #kind = rint, floor, ceil, trunc, sqrt, absolute, square, reciprocal# * #intr = rint, floor, ceil, trunc, sqrt, abs, square, recip# * #repl_0w1 = 0*7, 1# - * #RECIP_WORKAROUND = 0*7, WORKAROUND_CLANG_RECIPROCAL_BUG# */ /**begin repeat2 * #STYPE = CONTIG, NCONTIG, CONTIG, NCONTIG# @@ -228,15 +175,6 @@ static void simd_@TYPE@_@kind@_@STYPE@_@DTYPE@ npyv_@sfx@ v_src0 = npyv_loadn_tillz_@sfx@(src, ssrc, len); #endif #endif - #if @RECIP_WORKAROUND@ - /* - * Workaround clang bug. We use a dummy variable marked 'volatile' - * to convince clang that the entire vector is needed. We only - * want to do this for the last iteration / partial load-store of - * the loop since 'volatile' forces a refresh of the contents. - */ - volatile npyv_@sfx@ unused_but_workaround_bug = v_src0; - #endif // @RECIP_WORKAROUND@ npyv_@sfx@ v_unary0 = npyv_@intr@_@sfx@(v_src0); #if @DTYPE@ == CONTIG npyv_store_till_@sfx@(dst, len, v_unary0); @@ -252,8 +190,6 @@ static void simd_@TYPE@_@kind@_@STYPE@_@DTYPE@ #endif // @VCHK@ /**end repeat**/ -#undef WORKAROUND_CLANG_RECIPROCAL_BUG - /******************************************************************************** ** Defining ufunc inner functions ********************************************************************************/ diff --git a/contrib/python/numpy/py3/numpy/core/tests/data/numpy_2_0_array.pkl b/contrib/python/numpy/py3/numpy/core/tests/data/numpy_2_0_array.pkl Binary files differnew file mode 100644 index 0000000000..958eee50c9 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/core/tests/data/numpy_2_0_array.pkl diff --git a/contrib/python/numpy/py3/numpy/core/tests/examples/cython/checks.pyx b/contrib/python/numpy/py3/numpy/core/tests/examples/cython/checks.pyx index e41c6d6573..c5529ee8fc 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/examples/cython/checks.pyx +++ b/contrib/python/numpy/py3/numpy/core/tests/examples/cython/checks.pyx @@ -30,3 +30,6 @@ def get_dt64_unit(obj): def is_integer(obj): return isinstance(obj, (cnp.integer, int)) + +def conv_intp(cnp.intp_t val): + return val diff --git a/contrib/python/numpy/py3/numpy/core/tests/examples/cython/meson.build b/contrib/python/numpy/py3/numpy/core/tests/examples/cython/meson.build new file mode 100644 index 0000000000..12fc640b88 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/core/tests/examples/cython/meson.build @@ -0,0 +1,27 @@ +project('checks', 'c', 'cython') + +py = import('python').find_installation(pure: false) + +cc = meson.get_compiler('c') +cy = meson.get_compiler('cython') + +if not cy.version().version_compare('>=0.29.35') + error('tests requires Cython >= 0.29.35') +endif + +npy_include_path = run_command(py, [ + '-c', + 'import os; os.chdir(".."); import numpy; print(os.path.abspath(numpy.get_include()))' + ], check: true).stdout().strip() + +py.extension_module( + 'checks', + 'checks.pyx', + install: false, + c_args: [ + '-DNPY_NO_DEPRECATED_API=0', # Cython still uses old NumPy C API + # Require 1.25+ to test datetime additions + '-DNPY_TARGET_VERSION=NPY_2_0_API_VERSION', + ], + include_directories: [npy_include_path], +) diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_array_interface.py b/contrib/python/numpy/py3/numpy/core/tests/test_array_interface.py index 8b1ab27c5c..16c719c5a5 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_array_interface.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_array_interface.py @@ -128,6 +128,9 @@ def get_module(tmp_path): more_init=more_init) +# FIXME: numpy.testing.extbuild uses `numpy.distutils`, so this won't work on +# Python 3.12 and up. +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") @pytest.mark.slow def test_cstruct(get_module): diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_cpu_dispatcher.py b/contrib/python/numpy/py3/numpy/core/tests/test_cpu_dispatcher.py index 2f7eac7e8e..41a60d5c39 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_cpu_dispatcher.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_cpu_dispatcher.py @@ -9,7 +9,8 @@ def test_dispatcher(): targets = ( "SSE2", "SSE41", "AVX2", "VSX", "VSX2", "VSX3", - "NEON", "ASIMD", "ASIMDHP" + "NEON", "ASIMD", "ASIMDHP", + "VX", "VXE" ) highest_sfx = "" # no suffix for the baseline all_sfx = [] diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_cython.py b/contrib/python/numpy/py3/numpy/core/tests/test_cython.py index e916adceb1..99dd57e4c6 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_cython.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_cython.py @@ -29,44 +29,31 @@ pytestmark = pytest.mark.skipif(cython is None, reason="requires cython") @pytest.fixture -def install_temp(request, tmp_path): +def install_temp(tmp_path): # Based in part on test_cython from random.tests.test_extending if IS_WASM: pytest.skip("No subprocess") - here = os.path.dirname(__file__) - ext_dir = os.path.join(here, "examples", "cython") - - cytest = str(tmp_path / "cytest") - - shutil.copytree(ext_dir, cytest) - # build the examples and "install" them into a temporary directory - - install_log = str(tmp_path / "tmp_install_log.txt") - subprocess.check_output( - [ - sys.executable, - "setup.py", - "build", - "install", - "--prefix", str(tmp_path / "installdir"), - "--single-version-externally-managed", - "--record", - install_log, - ], - cwd=cytest, - ) - - # In order to import the built module, we need its path to sys.path - # so parse that out of the record - with open(install_log) as fid: - for line in fid: - if "checks" in line: - sys.path.append(os.path.dirname(line)) - break - else: - raise RuntimeError(f'could not parse "{install_log}"') - + srcdir = os.path.join(os.path.dirname(__file__), 'examples', 'cython') + build_dir = tmp_path / "build" + os.makedirs(build_dir, exist_ok=True) + try: + subprocess.check_call(["meson", "--version"]) + except FileNotFoundError: + pytest.skip("No usable 'meson' found") + if sys.platform == "win32": + subprocess.check_call(["meson", "setup", + "--buildtype=release", + "--vsenv", str(srcdir)], + cwd=build_dir, + ) + else: + subprocess.check_call(["meson", "setup", str(srcdir)], + cwd=build_dir + ) + subprocess.check_call(["meson", "compile", "-vv"], cwd=build_dir) + + sys.path.append(str(build_dir)) def test_is_timedelta64_object(install_temp): import checks @@ -135,3 +122,14 @@ def test_abstract_scalars(install_temp): assert checks.is_integer(1) assert checks.is_integer(np.int8(1)) assert checks.is_integer(np.uint64(1)) + +def test_conv_intp(install_temp): + import checks + + class myint: + def __int__(self): + return 3 + + # These conversion passes via `__int__`, not `__index__`: + assert checks.conv_intp(3.) == 3 + assert checks.conv_intp(myint()) == 3 diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_dtype.py b/contrib/python/numpy/py3/numpy/core/tests/test_dtype.py index 57831f46f4..ac155b67ba 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_dtype.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_dtype.py @@ -756,6 +756,11 @@ def iter_struct_object_dtypes(): yield pytest.param(dt, p, 12, obj, id="<structured subarray 2>") +@pytest.mark.skipif( + sys.version_info >= (3, 12), + reason="Python 3.12 has immortal refcounts, this test will no longer " + "work. See gh-23986" +) @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts") class TestStructuredObjectRefcounting: """These tests cover various uses of complicated structured types which @@ -1893,3 +1898,9 @@ def test_result_type_integers_and_unitless_timedelta64(): td = np.timedelta64(4) result = np.result_type(0, td) assert_dtype_equal(result, td.dtype) + + +def test_creating_dtype_with_dtype_class_errors(): + # Regression test for #25031, calling `np.dtype` with itself segfaulted. + with pytest.raises(TypeError, match="Cannot convert np.dtype into a"): + np.array(np.ones(10), dtype=np.dtype) diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_half.py b/contrib/python/numpy/py3/numpy/core/tests/test_half.py index ca849ad52e..fbc1bf6a0a 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_half.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_half.py @@ -21,8 +21,11 @@ class TestHalf: # An array of all possible float16 values self.all_f16 = np.arange(0x10000, dtype=uint16) self.all_f16.dtype = float16 - self.all_f32 = np.array(self.all_f16, dtype=float32) - self.all_f64 = np.array(self.all_f16, dtype=float64) + + # NaN value can cause an invalid FP exception if HW is been used + with np.errstate(invalid='ignore'): + self.all_f32 = np.array(self.all_f16, dtype=float32) + self.all_f64 = np.array(self.all_f16, dtype=float64) # An array of all non-NaN float16 values, in sorted order self.nonan_f16 = np.concatenate( @@ -44,14 +47,19 @@ class TestHalf: # value is preserved when converting to/from other floats. # Convert from float32 back to float16 - b = np.array(self.all_f32, dtype=float16) - assert_equal(self.all_f16.view(dtype=uint16), - b.view(dtype=uint16)) + with np.errstate(invalid='ignore'): + b = np.array(self.all_f32, dtype=float16) + # avoid testing NaNs due to differ bits wither Q/SNaNs + b_nn = b == b + assert_equal(self.all_f16[b_nn].view(dtype=uint16), + b[b_nn].view(dtype=uint16)) # Convert from float64 back to float16 - b = np.array(self.all_f64, dtype=float16) - assert_equal(self.all_f16.view(dtype=uint16), - b.view(dtype=uint16)) + with np.errstate(invalid='ignore'): + b = np.array(self.all_f64, dtype=float16) + b_nn = b == b + assert_equal(self.all_f16[b_nn].view(dtype=uint16), + b[b_nn].view(dtype=uint16)) # Convert float16 to longdouble and back # This doesn't necessarily preserve the extra NaN bits, @@ -266,8 +274,8 @@ class TestHalf: if len(a32_fail) != 0: bad_index = a32_fail[0] assert_equal(self.finite_f32, a_manual, - "First non-equal is half value %x -> %g != %g" % - (self.finite_f16[bad_index], + "First non-equal is half value 0x%x -> %g != %g" % + (a_bits[bad_index], self.finite_f32[bad_index], a_manual[bad_index])) @@ -275,8 +283,8 @@ class TestHalf: if len(a64_fail) != 0: bad_index = a64_fail[0] assert_equal(self.finite_f64, a_manual, - "First non-equal is half value %x -> %g != %g" % - (self.finite_f16[bad_index], + "First non-equal is half value 0x%x -> %g != %g" % + (a_bits[bad_index], self.finite_f64[bad_index], a_manual[bad_index])) @@ -319,7 +327,8 @@ class TestHalf: a = np.array([0, 0, -1, -1/1e20, 0, 2.0**-24, 7.629e-6], dtype=float16) assert_equal(a.nonzero()[0], [2, 5, 6]) - a = a.byteswap().newbyteorder() + a = a.byteswap() + a = a.view(a.dtype.newbyteorder()) assert_equal(a.nonzero()[0], [2, 5, 6]) diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_mem_policy.py b/contrib/python/numpy/py3/numpy/core/tests/test_mem_policy.py index 60cdaa8faa..bc3f330dc1 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_mem_policy.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_mem_policy.py @@ -9,6 +9,11 @@ from numpy.testing import extbuild, assert_warns, IS_WASM import sys +# FIXME: numpy.testing.extbuild uses `numpy.distutils`, so this won't work on +# Python 3.12 and up. It's an internal test utility, so for now we just skip +# these tests. + + @pytest.fixture def get_module(tmp_path): """ Add a memory policy that returns a false pointer 64 bytes into the @@ -213,6 +218,7 @@ def get_module(tmp_path): more_init=more_init) +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") def test_set_policy(get_module): get_handler_name = np.core.multiarray.get_handler_name @@ -241,6 +247,7 @@ def test_set_policy(get_module): assert get_handler_name() == orig_policy_name +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") def test_default_policy_singleton(get_module): get_handler_name = np.core.multiarray.get_handler_name @@ -262,6 +269,7 @@ def test_default_policy_singleton(get_module): assert def_policy_1 is def_policy_2 is get_module.get_default_policy() +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") def test_policy_propagation(get_module): # The memory policy goes hand-in-hand with flags.owndata @@ -320,6 +328,7 @@ async def async_test_context_locality(get_module): assert np.core.multiarray.get_handler_name() == orig_policy_name +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") def test_context_locality(get_module): if (sys.implementation.name == 'pypy' and sys.pypy_version_info[:3] < (7, 3, 6)): @@ -341,6 +350,7 @@ def concurrent_thread2(get_module, event): get_module.set_secret_data_policy() +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") def test_thread_locality(get_module): orig_policy_name = np.core.multiarray.get_handler_name() @@ -359,7 +369,8 @@ def test_thread_locality(get_module): assert np.core.multiarray.get_handler_name() == orig_policy_name -@pytest.mark.slow +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") +@pytest.mark.skip(reason="too slow, see gh-23975") def test_new_policy(get_module): a = np.arange(10) orig_policy_name = np.core.multiarray.get_handler_name(a) @@ -377,16 +388,19 @@ def test_new_policy(get_module): # # if needed, debug this by # - running tests with -- -s (to not capture stdout/stderr + # - setting verbose=2 # - setting extra_argv=['-vv'] here - assert np.core.test('full', verbose=2, extra_argv=['-vv']) + assert np.core.test('full', verbose=1, extra_argv=[]) # also try the ma tests, the pickling test is quite tricky - assert np.ma.test('full', verbose=2, extra_argv=['-vv']) + assert np.ma.test('full', verbose=1, extra_argv=[]) get_module.set_old_policy(orig_policy) c = np.arange(10) assert np.core.multiarray.get_handler_name(c) == orig_policy_name + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") @pytest.mark.xfail(sys.implementation.name == "pypy", reason=("bad interaction between getenv and " "os.environ inside pytest")) @@ -419,6 +433,8 @@ def test_switch_owner(get_module, policy): if oldval is not None: np.core._multiarray_umath._set_numpy_warn_if_no_mem_policy(oldval) + +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="no numpy.distutils") def test_owner_is_base(get_module): a = get_module.get_array_with_base() with pytest.warns(UserWarning, match='warn_on_free'): diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py b/contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py index fc3b871532..7016308b8c 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_multiarray.py @@ -3726,6 +3726,7 @@ class TestBinop: # - defer if other has __array_ufunc__ and it is None # or other is not a subclass and has higher array priority # - else, call ufunc + @pytest.mark.xfail(IS_PYPY, reason="Bug in pypy3.{9, 10}-v7.3.13, #24862") def test_ufunc_binop_interaction(self): # Python method name (without underscores) # -> (numpy ufunc, has_in_place_version, preferred_dtype) @@ -9722,9 +9723,12 @@ def test_ragged_comparison_fails(op): def test_npymath_complex(fun, npfun, x, y, test_dtype): # Smoketest npymath functions z = test_dtype(complex(x, y)) - got = fun(z) - expected = npfun(z) - assert_allclose(got, expected) + with np.errstate(invalid='ignore'): + # Fallback implementations may emit a warning for +-inf (see gh-24876): + # RuntimeWarning: invalid value encountered in absolute + got = fun(z) + expected = npfun(z) + assert_allclose(got, expected) def test_npymath_real(): @@ -10031,3 +10035,20 @@ def test_argsort_int(N, dtype): arr = rnd.randint(low=minv, high=maxv, size=N, dtype=dtype) arr[N-1] = maxv assert_arg_sorted(arr, np.argsort(arr, kind='quick')) + + +@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts") +def test_gh_22683(): + b = 777.68760986 + a = np.array([b] * 10000, dtype=object) + refc_start = sys.getrefcount(b) + np.choose(np.zeros(10000, dtype=int), [a], out=a) + np.choose(np.zeros(10000, dtype=int), [a], out=a) + refc_end = sys.getrefcount(b) + assert refc_end - refc_start < 10 + + +def test_gh_24459(): + a = np.zeros((50, 3), dtype=np.float64) + with pytest.raises(TypeError): + np.choose(a, [3, -1]) diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_nditer.py b/contrib/python/numpy/py3/numpy/core/tests/test_nditer.py index 8c1a770cd2..35bd6e97e0 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_nditer.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_nditer.py @@ -3203,6 +3203,7 @@ def test_warn_noclose(): assert len(sup.log) == 1 +@pytest.mark.skip @pytest.mark.skipif(sys.version_info[:2] == (3, 9) and sys.platform == "win32", reason="Errors with Python 3.9 on Windows") @pytest.mark.parametrize(["in_dtype", "buf_dtype"], diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_numeric.py b/contrib/python/numpy/py3/numpy/core/tests/test_numeric.py index dd41d6a623..1bbdde1317 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_numeric.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_numeric.py @@ -645,6 +645,11 @@ class TestFloatExceptions: @pytest.mark.skipif(IS_WASM, reason="no wasm fp exception support") @pytest.mark.parametrize("typecode", np.typecodes["AllFloat"]) def test_floating_exceptions(self, typecode): + if 'bsd' in sys.platform and typecode in 'gG': + pytest.skip(reason="Fallback impl for (c)longdouble may not raise " + "FPE errors as expected on BSD OSes, " + "see gh-24876, gh-23379") + # Test basic arithmetic function errors with np.errstate(all='raise'): ftype = np.obj2sctype(typecode) diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_numpy_2_0_compat.py b/contrib/python/numpy/py3/numpy/core/tests/test_numpy_2_0_compat.py new file mode 100644 index 0000000000..30a3b107c6 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/core/tests/test_numpy_2_0_compat.py @@ -0,0 +1,49 @@ +from os import path +import pickle + +import numpy as np +import yatest.common as yc + + +class TestNumPy2Compatibility: + + data_dir = yc.source_path(path.join(path.dirname(__file__), "data")) + filename = path.join(data_dir, "numpy_2_0_array.pkl") + + def test_importable__core_stubs(self): + """ + Checks if stubs for `numpy._core` are importable. + """ + from numpy._core.multiarray import _reconstruct + from numpy._core.umath import cos + from numpy._core._multiarray_umath import exp + from numpy._core._internal import ndarray + from numpy._core._dtype import _construction_repr + from numpy._core._dtype_ctypes import dtype_from_ctypes_type + + def test_unpickle_numpy_2_0_file(self): + """ + Checks that NumPy 1.26 and pickle is able to load pickles + created with NumPy 2.0 without errors/warnings. + """ + with open(self.filename, mode="rb") as file: + content = file.read() + + # Let's make sure that the pickle object we're loading + # was built with NumPy 2.0. + assert b"numpy._core.multiarray" in content + + arr = pickle.loads(content, encoding="latin1") + + assert isinstance(arr, np.ndarray) + assert arr.shape == (73,) and arr.dtype == np.float64 + + def test_numpy_load_numpy_2_0_file(self): + """ + Checks that `numpy.load` for NumPy 1.26 is able to load pickles + created with NumPy 2.0 without errors/warnings. + """ + arr = np.load(self.filename, encoding="latin1", allow_pickle=True) + + assert isinstance(arr, np.ndarray) + assert arr.shape == (73,) and arr.dtype == np.float64 diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_regression.py b/contrib/python/numpy/py3/numpy/core/tests/test_regression.py index 4348ff93e8..93593d5738 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_regression.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_regression.py @@ -1465,6 +1465,10 @@ class TestRegression: x[x.nonzero()] = x.ravel()[:1] assert_(x[0, 1] == x[0, 0]) + @pytest.mark.skipif( + sys.version_info >= (3, 12), + reason="Python 3.12 has immortal refcounts, this test no longer works." + ) @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts") def test_structured_arrays_with_objects2(self): # Ticket #1299 second test diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_simd_module.py b/contrib/python/numpy/py3/numpy/core/tests/test_simd_module.py index 44dc58dac0..4fbaa9f300 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_simd_module.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_simd_module.py @@ -86,6 +86,8 @@ class Test_SIMD_MODULE: assert lanes == [0] * nlanes def test_truncate_f32(self): + if not npyv.simd_f32: + pytest.skip("F32 isn't support by the SIMD extension") f32 = npyv.setall_f32(0.1)[0] assert f32 != 0.1 assert round(f32, 1) == 0.1 diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_ufunc.py b/contrib/python/numpy/py3/numpy/core/tests/test_ufunc.py index 02c437021f..9fbc4b2dc5 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_ufunc.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_ufunc.py @@ -1617,6 +1617,8 @@ class TestUfunc: assert_equal(np.minimum.reduce(a, axis=()), a) @requires_memory(6 * 1024**3) + @pytest.mark.skipif(sys.maxsize < 2**32, + reason="test array too large for 32bit platform") def test_identityless_reduction_huge_array(self): # Regression test for gh-20921 (copying identity incorrectly failed) arr = np.zeros((2, 2**31), 'uint8') diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_umath.py b/contrib/python/numpy/py3/numpy/core/tests/test_umath.py index 892226f993..59c670ffed 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_umath.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_umath.py @@ -1646,6 +1646,8 @@ class TestSpecialFloats: np.array(1200.0, dtype='d')) @pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm") + @pytest.mark.skipif('bsd' in sys.platform, + reason="fallback implementation may not raise, see gh-2487") def test_cosh(self): in_ = [np.nan, -np.nan, np.inf, -np.inf] out = [np.nan, np.nan, np.inf, np.inf] @@ -1710,6 +1712,9 @@ class TestSpecialFloats: assert_raises(FloatingPointError, np.arctanh, np.array(value, dtype=dt)) + # Make sure glibc < 2.18 atanh is not used, issue 25087 + assert np.signbit(np.arctanh(-1j).real) + # See: https://github.com/numpy/numpy/issues/20448 @pytest.mark.xfail( _glibc_older_than("2.17"), @@ -1764,6 +1769,8 @@ class TestSpecialFloats: np.log, np.log2, np.log10, np.reciprocal, np.arccosh ] + @pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1, + reason='failures on 32-bit Python, see FIXME below') @pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP) @pytest.mark.parametrize("dtype", ('e', 'f', 'd')) @pytest.mark.parametrize("data, escape", ( @@ -1810,6 +1817,8 @@ class TestSpecialFloats: # FIXME: NAN raises FP invalid exception: # - ceil/float16 on MSVC:32-bit # - spacing/float16 on almost all platforms + # FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail + # when SIMD support not present / disabled if ufunc in (np.spacing, np.ceil) and dtype == 'e': return array = np.array(data, dtype=dtype) @@ -4173,6 +4182,11 @@ class TestComplexFunctions: b = cfunc(p) assert_(abs(a - b) < atol, "%s %s: %s; cmath: %s" % (fname, p, a, b)) + @pytest.mark.xfail( + # manylinux2014 uses glibc2.17 + _glibc_older_than("2.18"), + reason="Older glibc versions are imprecise (maybe passes with SIMD?)" + ) @pytest.mark.xfail(IS_MUSL, reason="gh23049") @pytest.mark.xfail(IS_WASM, reason="doesn't work") @pytest.mark.parametrize('dtype', [np.complex64, np.complex_, np.longcomplex]) diff --git a/contrib/python/numpy/py3/numpy/core/tests/test_umath_complex.py b/contrib/python/numpy/py3/numpy/core/tests/test_umath_complex.py index 8aa9a28ff4..e543005890 100644 --- a/contrib/python/numpy/py3/numpy/core/tests/test_umath_complex.py +++ b/contrib/python/numpy/py3/numpy/core/tests/test_umath_complex.py @@ -576,8 +576,8 @@ class TestSpecialComplexAVX: complex(0., 0.), complex(np.nan, np.nan), complex(np.nan, np.nan)], dtype=astype) - assert_equal(np.abs(arr[::stride]), abs_true[::stride]) with np.errstate(invalid='ignore'): + assert_equal(np.abs(arr[::stride]), abs_true[::stride]) assert_equal(np.square(arr[::stride]), sq_true[::stride]) class TestComplexAbsoluteAVX: diff --git a/contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py b/contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py index 1e9de3c45b..37a5368b0b 100644 --- a/contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py +++ b/contrib/python/numpy/py3/numpy/distutils/ccompiler_opt.py @@ -301,7 +301,8 @@ class _Config: ## Power8/ISA 2.07 VSX2 = dict(interest=2, implies="VSX", implies_detect=False), ## Power9/ISA 3.00 - VSX3 = dict(interest=3, implies="VSX2", implies_detect=False), + VSX3 = dict(interest=3, implies="VSX2", implies_detect=False, + extra_checks="VSX3_HALF_DOUBLE"), ## Power10/ISA 3.1 VSX4 = dict(interest=4, implies="VSX3", implies_detect=False, extra_checks="VSX4_MMA"), @@ -1308,7 +1309,7 @@ class _Feature: def feature_is_exist(self, name): """ Returns True if a certain feature is exist and covered within - `_Config.conf_features`. + ``_Config.conf_features``. Parameters ---------- diff --git a/contrib/python/numpy/py3/numpy/distutils/checks/extra_vsx3_half_double.c b/contrib/python/numpy/py3/numpy/distutils/checks/extra_vsx3_half_double.c new file mode 100644 index 0000000000..514a2b18f9 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/distutils/checks/extra_vsx3_half_double.c @@ -0,0 +1,12 @@ +/** + * Assembler may not fully support the following VSX3 scalar + * instructions, even though compilers report VSX3 support. + */ +int main(void) +{ + unsigned short bits = 0xFF; + double f; + __asm__ __volatile__("xscvhpdp %x0,%x1" : "=wa"(f) : "wa"(bits)); + __asm__ __volatile__ ("xscvdphp %x0,%x1" : "=wa" (bits) : "wa" (f)); + return bits; +} diff --git a/contrib/python/numpy/py3/numpy/distutils/command/build_clib.py b/contrib/python/numpy/py3/numpy/distutils/command/build_clib.py index 11999dae23..6cd2f3e7ee 100644 --- a/contrib/python/numpy/py3/numpy/distutils/command/build_clib.py +++ b/contrib/python/numpy/py3/numpy/distutils/command/build_clib.py @@ -320,8 +320,8 @@ class build_clib(old_build_clib): dispatch_hpath = os.path.join("numpy", "distutils", "include") dispatch_hpath = os.path.join(bsrc_dir, dispatch_hpath) include_dirs.append(dispatch_hpath) - - copt_build_src = None if self.inplace else bsrc_dir + # copt_build_src = None if self.inplace else bsrc_dir + copt_build_src = bsrc_dir for _srcs, _dst, _ext in ( ((c_sources,), copt_c_sources, ('.dispatch.c',)), ((c_sources, cxx_sources), copt_cxx_sources, diff --git a/contrib/python/numpy/py3/numpy/distutils/command/build_ext.py b/contrib/python/numpy/py3/numpy/distutils/command/build_ext.py index 68b13c0dd3..5c62d90c57 100644 --- a/contrib/python/numpy/py3/numpy/distutils/command/build_ext.py +++ b/contrib/python/numpy/py3/numpy/distutils/command/build_ext.py @@ -458,7 +458,18 @@ class build_ext (old_build_ext): dispatch_hpath = os.path.join(bsrc_dir, dispatch_hpath) include_dirs.append(dispatch_hpath) - copt_build_src = None if self.inplace else bsrc_dir + # copt_build_src = None if self.inplace else bsrc_dir + # Always generate the generated config files and + # dispatch-able sources inside the build directory, + # even if the build option `inplace` is enabled. + # This approach prevents conflicts with Meson-generated + # config headers. Since `spin build --clean` will not remove + # these headers, they might overwrite the generated Meson headers, + # causing compatibility issues. Maintaining separate directories + # ensures compatibility between distutils dispatch config headers + # and Meson headers, avoiding build disruptions. + # See gh-24450 for more details. + copt_build_src = bsrc_dir for _srcs, _dst, _ext in ( ((c_sources,), copt_c_sources, ('.dispatch.c',)), ((c_sources, cxx_sources), copt_cxx_sources, diff --git a/contrib/python/numpy/py3/numpy/distutils/command/build_src.py b/contrib/python/numpy/py3/numpy/distutils/command/build_src.py index bf3d03c70e..7303db124c 100644 --- a/contrib/python/numpy/py3/numpy/distutils/command/build_src.py +++ b/contrib/python/numpy/py3/numpy/distutils/command/build_src.py @@ -539,8 +539,8 @@ class build_src(build_ext.build_ext): if (self.force or newer_group(depends, target_file, 'newer')) \ and not skip_f2py: log.info("f2py: %s" % (source)) - import numpy.f2py - numpy.f2py.run_main(f2py_options + from numpy.f2py import f2py2e + f2py2e.run_main(f2py_options + ['--build-dir', target_dir, source]) else: log.debug(" skipping '%s' f2py interface (up-to-date)" % (source)) @@ -558,8 +558,8 @@ class build_src(build_ext.build_ext): and not skip_f2py: log.info("f2py:> %s" % (target_file)) self.mkpath(target_dir) - import numpy.f2py - numpy.f2py.run_main(f2py_options + ['--lower', + from numpy.f2py import f2py2e + f2py2e.run_main(f2py_options + ['--lower', '--build-dir', target_dir]+\ ['-m', ext_name]+f_sources) else: diff --git a/contrib/python/numpy/py3/numpy/distutils/core.py b/contrib/python/numpy/py3/numpy/distutils/core.py index c4a14e5990..1cdc739731 100644 --- a/contrib/python/numpy/py3/numpy/distutils/core.py +++ b/contrib/python/numpy/py3/numpy/distutils/core.py @@ -65,7 +65,8 @@ def _dict_append(d, **kws): elif isinstance(dv, dict): _dict_append(dv, **v) elif is_string(dv): - d[k] = dv + v + assert is_string(v) + d[k] = v else: raise TypeError(repr(type(dv))) diff --git a/contrib/python/numpy/py3/numpy/distutils/system_info.py b/contrib/python/numpy/py3/numpy/distutils/system_info.py index 3dca7fb5a7..feb28f61cf 100644 --- a/contrib/python/numpy/py3/numpy/distutils/system_info.py +++ b/contrib/python/numpy/py3/numpy/distutils/system_info.py @@ -47,6 +47,7 @@ Currently, the following classes are available, along with their section names: _numpy_info:Numeric _pkg_config_info:None accelerate_info:accelerate + accelerate_lapack_info:accelerate agg2_info:agg2 amd_info:amd atlas_3_10_blas_info:atlas @@ -534,6 +535,7 @@ def get_info(name, notfound_action=0): 'lapack_ssl2': lapack_ssl2_info, 'blas_ssl2': blas_ssl2_info, 'accelerate': accelerate_info, # use blas_opt instead + 'accelerate_lapack': accelerate_lapack_info, 'openblas64_': openblas64__info, 'openblas64__lapack': openblas64__lapack_info, 'openblas_ilp64': openblas_ilp64_info, @@ -2015,14 +2017,17 @@ class _ilp64_opt_info_mixin: class lapack_ilp64_opt_info(lapack_opt_info, _ilp64_opt_info_mixin): notfounderror = LapackILP64NotFoundError - lapack_order = ['openblas64_', 'openblas_ilp64'] + lapack_order = ['openblas64_', 'openblas_ilp64', 'accelerate'] order_env_var_name = 'NPY_LAPACK_ILP64_ORDER' def _calc_info(self, name): + print('lapack_ilp64_opt_info._calc_info(name=%s)' % (name)) info = get_info(name + '_lapack') if self._check_info(info): self.set_info(**info) return True + else: + print('%s_lapack does not exist' % (name)) return False @@ -2163,7 +2168,7 @@ class blas_opt_info(system_info): class blas_ilp64_opt_info(blas_opt_info, _ilp64_opt_info_mixin): notfounderror = BlasILP64NotFoundError - blas_order = ['openblas64_', 'openblas_ilp64'] + blas_order = ['openblas64_', 'openblas_ilp64', 'accelerate'] order_env_var_name = 'NPY_BLAS_ILP64_ORDER' def _calc_info(self, name): @@ -2352,7 +2357,10 @@ class openblas_info(blas_info): if self.symbol_prefix: info['define_macros'] += [('BLAS_SYMBOL_PREFIX', self.symbol_prefix)] if self.symbol_suffix: - info['define_macros'] += [('BLAS_SYMBOL_SUFFIX', self.symbol_suffix)] + info['define_macros'] += [ + ('BLAS_SYMBOL_SUFFIX', self.symbol_suffix), + ('OPENBLAS_ILP64_NAMING_SCHEME', None), + ] return info @@ -2625,13 +2633,27 @@ class accelerate_info(system_info): link_args.extend(['-Wl,-framework', '-Wl,vecLib']) if args: + macros = [ + ('NO_ATLAS_INFO', 3), + ('HAVE_CBLAS', None), + ('ACCELERATE_NEW_LAPACK', None), + ] + if(os.getenv('NPY_USE_BLAS_ILP64', None)): + print('Setting HAVE_BLAS_ILP64') + macros += [ + ('HAVE_BLAS_ILP64', None), + ('ACCELERATE_LAPACK_ILP64', None), + ] self.set_info(extra_compile_args=args, extra_link_args=link_args, - define_macros=[('NO_ATLAS_INFO', 3), - ('HAVE_CBLAS', None)]) + define_macros=macros) return +class accelerate_lapack_info(accelerate_info): + def _calc_info(self): + return super()._calc_info() + class blas_src_info(system_info): # BLAS_SRC is deprecated, please do not use this! # Build or install a BLAS library via your package manager or from diff --git a/contrib/python/numpy/py3/numpy/distutils/tests/test_system_info.py b/contrib/python/numpy/py3/numpy/distutils/tests/test_system_info.py index 66304a5e50..9bcc090505 100644 --- a/contrib/python/numpy/py3/numpy/distutils/tests/test_system_info.py +++ b/contrib/python/numpy/py3/numpy/distutils/tests/test_system_info.py @@ -3,6 +3,7 @@ import shutil import pytest from tempfile import mkstemp, mkdtemp from subprocess import Popen, PIPE +import importlib.metadata from distutils.errors import DistutilsError from numpy.testing import assert_, assert_equal, assert_raises @@ -13,6 +14,16 @@ from numpy.distutils.system_info import default_lib_dirs, default_include_dirs from numpy.distutils import _shell_utils +try: + if importlib.metadata.version('setuptools') >= '60': + # pkg-resources gives deprecation warnings, and there may be more + # issues. We only support setuptools <60 + pytest.skip("setuptools is too new", allow_module_level=True) +except importlib.metadata.PackageNotFoundError: + # we don't require `setuptools`; if it is not found, continue + pass + + def get_class(name, notfound_action=1): """ notfound_action: diff --git a/contrib/python/numpy/py3/numpy/f2py/__init__.pyi b/contrib/python/numpy/py3/numpy/f2py/__init__.pyi index 6e3a82cf8f..81b6a24f39 100644 --- a/contrib/python/numpy/py3/numpy/f2py/__init__.pyi +++ b/contrib/python/numpy/py3/numpy/f2py/__init__.pyi @@ -14,7 +14,6 @@ class _F2PyDict(_F2PyDictBase, total=False): ltx: list[str] __all__: list[str] -__path__: list[str] test: PytestTester def run_main(comline_list: Iterable[str]) -> dict[str, _F2PyDict]: ... diff --git a/contrib/python/numpy/py3/numpy/f2py/_backends/__init__.py b/contrib/python/numpy/py3/numpy/f2py/_backends/__init__.py new file mode 100644 index 0000000000..e91393c14b --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/_backends/__init__.py @@ -0,0 +1,9 @@ +def f2py_build_generator(name): + if name == "meson": + from ._meson import MesonBackend + return MesonBackend + elif name == "distutils": + from ._distutils import DistutilsBackend + return DistutilsBackend + else: + raise ValueError(f"Unknown backend: {name}") diff --git a/contrib/python/numpy/py3/numpy/f2py/_backends/_backend.py b/contrib/python/numpy/py3/numpy/f2py/_backends/_backend.py new file mode 100644 index 0000000000..a7d43d2587 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/_backends/_backend.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +from abc import ABC, abstractmethod + + +class Backend(ABC): + def __init__( + self, + modulename, + sources, + extra_objects, + build_dir, + include_dirs, + library_dirs, + libraries, + define_macros, + undef_macros, + f2py_flags, + sysinfo_flags, + fc_flags, + flib_flags, + setup_flags, + remove_build_dir, + extra_dat, + ): + self.modulename = modulename + self.sources = sources + self.extra_objects = extra_objects + self.build_dir = build_dir + self.include_dirs = include_dirs + self.library_dirs = library_dirs + self.libraries = libraries + self.define_macros = define_macros + self.undef_macros = undef_macros + self.f2py_flags = f2py_flags + self.sysinfo_flags = sysinfo_flags + self.fc_flags = fc_flags + self.flib_flags = flib_flags + self.setup_flags = setup_flags + self.remove_build_dir = remove_build_dir + self.extra_dat = extra_dat + + @abstractmethod + def compile(self) -> None: + """Compile the wrapper.""" + pass diff --git a/contrib/python/numpy/py3/numpy/f2py/_backends/_distutils.py b/contrib/python/numpy/py3/numpy/f2py/_backends/_distutils.py new file mode 100644 index 0000000000..e548fc5430 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/_backends/_distutils.py @@ -0,0 +1,75 @@ +from ._backend import Backend + +from numpy.distutils.core import setup, Extension +from numpy.distutils.system_info import get_info +from numpy.distutils.misc_util import dict_append +from numpy.exceptions import VisibleDeprecationWarning +import os +import sys +import shutil +import warnings + + +class DistutilsBackend(Backend): + def __init__(sef, *args, **kwargs): + warnings.warn( + "distutils has been deprecated since NumPy 1.26." + "Use the Meson backend instead, or generate wrappers" + "without -c and use a custom build script", + VisibleDeprecationWarning, + stacklevel=2, + ) + super().__init__(*args, **kwargs) + + def compile(self): + num_info = {} + if num_info: + self.include_dirs.extend(num_info.get("include_dirs", [])) + ext_args = { + "name": self.modulename, + "sources": self.sources, + "include_dirs": self.include_dirs, + "library_dirs": self.library_dirs, + "libraries": self.libraries, + "define_macros": self.define_macros, + "undef_macros": self.undef_macros, + "extra_objects": self.extra_objects, + "f2py_options": self.f2py_flags, + } + + if self.sysinfo_flags: + for n in self.sysinfo_flags: + i = get_info(n) + if not i: + print( + f"No {repr(n)} resources found" + "in system (try `f2py --help-link`)" + ) + dict_append(ext_args, **i) + + ext = Extension(**ext_args) + + sys.argv = [sys.argv[0]] + self.setup_flags + sys.argv.extend( + [ + "build", + "--build-temp", + self.build_dir, + "--build-base", + self.build_dir, + "--build-platlib", + ".", + "--disable-optimization", + ] + ) + + if self.fc_flags: + sys.argv.extend(["config_fc"] + self.fc_flags) + if self.flib_flags: + sys.argv.extend(["build_ext"] + self.flib_flags) + + setup(ext_modules=[ext]) + + if self.remove_build_dir and os.path.exists(self.build_dir): + print(f"Removing build directory {self.build_dir}") + shutil.rmtree(self.build_dir) diff --git a/contrib/python/numpy/py3/numpy/f2py/_backends/_meson.py b/contrib/python/numpy/py3/numpy/f2py/_backends/_meson.py new file mode 100644 index 0000000000..3176a5e08f --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/_backends/_meson.py @@ -0,0 +1,157 @@ +from __future__ import annotations + +import errno +import shutil +import subprocess +from pathlib import Path + +from ._backend import Backend +from string import Template + +import warnings + + +class MesonTemplate: + """Template meson build file generation class.""" + + def __init__( + self, + modulename: str, + sources: list[Path], + deps: list[str], + object_files: list[Path], + linker_args: list[str], + c_args: list[str], + build_type: str, + ): + self.modulename = modulename + self.build_template_path = ( + Path(__file__).parent.absolute() / "meson.build.template" + ) + self.sources = sources + self.deps = deps + self.substitutions = {} + self.objects = object_files + self.pipeline = [ + self.initialize_template, + self.sources_substitution, + self.deps_substitution, + ] + self.build_type = build_type + + def meson_build_template(self) -> str: + if not self.build_template_path.is_file(): + raise FileNotFoundError( + errno.ENOENT, + "Meson build template" + f" {self.build_template_path.absolute()}" + " does not exist.", + ) + return self.build_template_path.read_text() + + def initialize_template(self) -> None: + self.substitutions["modulename"] = self.modulename + self.substitutions["buildtype"] = self.build_type + + def sources_substitution(self) -> None: + indent = " " * 21 + self.substitutions["source_list"] = f",\n{indent}".join( + [f"'{source}'" for source in self.sources] + ) + + def deps_substitution(self) -> None: + indent = " " * 21 + self.substitutions["dep_list"] = f",\n{indent}".join( + [f"dependency('{dep}')" for dep in self.deps] + ) + + def generate_meson_build(self): + for node in self.pipeline: + node() + template = Template(self.meson_build_template()) + return template.substitute(self.substitutions) + + +class MesonBackend(Backend): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.dependencies = self.extra_dat.get("dependencies", []) + self.meson_build_dir = "bbdir" + self.build_type = ( + "debug" if any("debug" in flag for flag in self.fc_flags) else "release" + ) + + def _move_exec_to_root(self, build_dir: Path): + walk_dir = Path(build_dir) / self.meson_build_dir + path_objects = walk_dir.glob(f"{self.modulename}*.so") + for path_object in path_objects: + shutil.move(path_object, Path.cwd()) + + def _get_build_command(self): + return [ + "meson", + "setup", + self.meson_build_dir, + ] + + def write_meson_build(self, build_dir: Path) -> None: + """Writes the meson build file at specified location""" + meson_template = MesonTemplate( + self.modulename, + self.sources, + self.dependencies, + self.extra_objects, + self.flib_flags, + self.fc_flags, + self.build_type, + ) + src = meson_template.generate_meson_build() + Path(build_dir).mkdir(parents=True, exist_ok=True) + meson_build_file = Path(build_dir) / "meson.build" + meson_build_file.write_text(src) + return meson_build_file + + def run_meson(self, build_dir: Path): + completed_process = subprocess.run(self._get_build_command(), cwd=build_dir) + if completed_process.returncode != 0: + raise subprocess.CalledProcessError( + completed_process.returncode, completed_process.args + ) + completed_process = subprocess.run( + ["meson", "compile", "-C", self.meson_build_dir], cwd=build_dir + ) + if completed_process.returncode != 0: + raise subprocess.CalledProcessError( + completed_process.returncode, completed_process.args + ) + + def compile(self) -> None: + self.sources = _prepare_sources(self.modulename, self.sources, self.build_dir) + self.write_meson_build(self.build_dir) + self.run_meson(self.build_dir) + self._move_exec_to_root(self.build_dir) + + +def _prepare_sources(mname, sources, bdir): + extended_sources = sources.copy() + Path(bdir).mkdir(parents=True, exist_ok=True) + # Copy sources + for source in sources: + shutil.copy(source, bdir) + generated_sources = [ + Path(f"{mname}module.c"), + Path(f"{mname}-f2pywrappers2.f90"), + Path(f"{mname}-f2pywrappers.f"), + ] + bdir = Path(bdir) + for generated_source in generated_sources: + if generated_source.exists(): + shutil.copy(generated_source, bdir / generated_source.name) + extended_sources.append(generated_source.name) + generated_source.unlink() + extended_sources = [ + Path(source).name + for source in extended_sources + if not Path(source).suffix == ".pyf" + ] + return extended_sources diff --git a/contrib/python/numpy/py3/numpy/f2py/_backends/meson.build.template b/contrib/python/numpy/py3/numpy/f2py/_backends/meson.build.template new file mode 100644 index 0000000000..545e399521 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/_backends/meson.build.template @@ -0,0 +1,42 @@ +project('${modulename}', + ['c', 'fortran'], + version : '0.1', + meson_version: '>= 1.1.0', + default_options : [ + 'warning_level=1', + 'buildtype=${buildtype}' + ]) + +py = import('python').find_installation(pure: false) +py_dep = py.dependency() + +incdir_numpy = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'], + check : true +).stdout().strip() + +incdir_f2py = run_command(py, + ['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'], + check : true +).stdout().strip() + +inc_np = include_directories(incdir_numpy) +np_dep = declare_dependency(include_directories: inc_np) + +incdir_f2py = incdir_numpy / '..' / '..' / 'f2py' / 'src' +inc_f2py = include_directories(incdir_f2py) +fortranobject_c = incdir_f2py / 'fortranobject.c' + +inc_np = include_directories(incdir_numpy, incdir_f2py) + +py.extension_module('${modulename}', + [ +${source_list}, + fortranobject_c + ], + include_directories: [inc_np], + dependencies : [ + py_dep, +${dep_list} + ], + install : true) diff --git a/contrib/python/numpy/py3/numpy/f2py/_isocbind.py b/contrib/python/numpy/py3/numpy/f2py/_isocbind.py new file mode 100644 index 0000000000..81f52fb4de --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/_isocbind.py @@ -0,0 +1,46 @@ +iso_c_binding_map = { + 'integer': { + 'c_int': 'int', + 'c_short': 'short int', + 'c_long': 'long int', + 'c_long_long': 'long long int', + 'c_signed_char': 'signed char', + 'c_size_t': 'size_t', + 'c_int8_t': 'int8_t', + 'c_int16_t': 'int16_t', + 'c_int32_t': 'int32_t', + 'c_int64_t': 'int64_t', + 'c_int_least8_t': 'int_least8_t', + 'c_int_least16_t': 'int_least16_t', + 'c_int_least32_t': 'int_least32_t', + 'c_int_least64_t': 'int_least64_t', + 'c_int_fast8_t': 'int_fast8_t', + 'c_int_fast16_t': 'int_fast16_t', + 'c_int_fast32_t': 'int_fast32_t', + 'c_int_fast64_t': 'int_fast64_t', + 'c_intmax_t': 'intmax_t', + 'c_intptr_t': 'intptr_t', + 'c_ptrdiff_t': 'intptr_t', + }, + 'real': { + 'c_float': 'float', + 'c_double': 'double', + 'c_long_double': 'long double' + }, + 'complex': { + 'c_float_complex': 'float _Complex', + 'c_double_complex': 'double _Complex', + 'c_long_double_complex': 'long double _Complex' + }, + 'logical': { + 'c_bool': '_Bool' + }, + 'character': { + 'c_char': 'char' + } +} + +isoc_kindmap = {} +for fortran_type, c_type_dict in iso_c_binding_map.items(): + for c_type in c_type_dict.keys(): + isoc_kindmap[c_type] = fortran_type diff --git a/contrib/python/numpy/py3/numpy/f2py/auxfuncs.py b/contrib/python/numpy/py3/numpy/f2py/auxfuncs.py index 3f9b0ceafa..0c08e0a5e2 100644 --- a/contrib/python/numpy/py3/numpy/f2py/auxfuncs.py +++ b/contrib/python/numpy/py3/numpy/f2py/auxfuncs.py @@ -16,8 +16,10 @@ Pearu Peterson """ import pprint import sys +import re import types from functools import reduce +from copy import deepcopy from . import __version__ from . import cfuncs @@ -26,7 +28,7 @@ __all__ = [ 'applyrules', 'debugcapi', 'dictappend', 'errmess', 'gentitle', 'getargs2', 'getcallprotoargument', 'getcallstatement', 'getfortranname', 'getpymethoddef', 'getrestdoc', 'getusercode', - 'getusercode1', 'hasbody', 'hascallstatement', 'hascommon', + 'getusercode1', 'getdimension', 'hasbody', 'hascallstatement', 'hascommon', 'hasexternals', 'hasinitvalue', 'hasnote', 'hasresultnote', 'isallocatable', 'isarray', 'isarrayofstrings', 'ischaracter', 'ischaracterarray', 'ischaracter_or_characterarray', @@ -42,12 +44,13 @@ __all__ = [ 'ismodule', 'ismoduleroutine', 'isoptional', 'isprivate', 'isrequired', 'isroutine', 'isscalar', 'issigned_long_longarray', 'isstring', 'isstringarray', 'isstring_or_stringarray', 'isstringfunction', - 'issubroutine', + 'issubroutine', 'get_f2py_modulename', 'issubroutine_wrap', 'isthreadsafe', 'isunsigned', 'isunsigned_char', 'isunsigned_chararray', 'isunsigned_long_long', 'isunsigned_long_longarray', 'isunsigned_short', 'isunsigned_shortarray', 'l_and', 'l_not', 'l_or', 'outmess', - 'replace', 'show', 'stripcomma', 'throw_error', 'isattr_value' + 'replace', 'show', 'stripcomma', 'throw_error', 'isattr_value', + 'deep_merge' ] @@ -417,6 +420,13 @@ def isexternal(var): return 'attrspec' in var and 'external' in var['attrspec'] +def getdimension(var): + dimpattern = r"\((.*?)\)" + if 'attrspec' in var.keys(): + if any('dimension' in s for s in var['attrspec']): + return [re.findall(dimpattern, v) for v in var['attrspec']][0] + + def isrequired(var): return not isoptional(var) and isintent_nothide(var) @@ -888,3 +898,42 @@ def applyrules(rules, d, var={}): if ret[k] == []: del ret[k] return ret + +def deep_merge(dict1, dict2): + """Recursively merge two dictionaries into a new dictionary. + + Parameters: + - dict1: The base dictionary. + - dict2: The dictionary to merge into a copy of dict1. + If a key exists in both, the dict2 value will take precedence. + + Returns: + - A new merged dictionary. + """ + merged_dict = deepcopy(dict1) + for key, value in dict2.items(): + if key in merged_dict: + if isinstance(merged_dict[key], dict) and isinstance(value, dict): + merged_dict[key] = deep_merge(merged_dict[key], value) + else: + merged_dict[key] = value + else: + merged_dict[key] = value + return merged_dict + +_f2py_module_name_match = re.compile(r'\s*python\s*module\s*(?P<name>[\w_]+)', + re.I).match +_f2py_user_module_name_match = re.compile(r'\s*python\s*module\s*(?P<name>[\w_]*?' + r'__user__[\w_]*)', re.I).match + +def get_f2py_modulename(source): + name = None + with open(source) as f: + for line in f: + m = _f2py_module_name_match(line) + if m: + if _f2py_user_module_name_match(line): # skip *__user__* names + continue + name = m.group('name') + break + return name diff --git a/contrib/python/numpy/py3/numpy/f2py/capi_maps.py b/contrib/python/numpy/py3/numpy/f2py/capi_maps.py index f0a7221b71..32b6db5c59 100644 --- a/contrib/python/numpy/py3/numpy/f2py/capi_maps.py +++ b/contrib/python/numpy/py3/numpy/f2py/capi_maps.py @@ -19,6 +19,7 @@ import re import os from .crackfortran import markoutercomma from . import cb_rules +from ._isocbind import iso_c_binding_map # The environment provided by auxfuncs.py is needed for some calls to eval. # As the needed functions cannot be determined by static inspection of the @@ -32,9 +33,6 @@ __all__ = [ ] -# Numarray and Numeric users should set this False -using_newcore = True - depargs = [] lcb_map = {} lcb2_map = {} @@ -58,89 +56,48 @@ c2py_map = {'double': 'float', 'string': 'string', 'character': 'bytes', } + c2capi_map = {'double': 'NPY_DOUBLE', - 'float': 'NPY_FLOAT', - 'long_double': 'NPY_DOUBLE', # forced casting - 'char': 'NPY_STRING', - 'unsigned_char': 'NPY_UBYTE', - 'signed_char': 'NPY_BYTE', - 'short': 'NPY_SHORT', - 'unsigned_short': 'NPY_USHORT', - 'int': 'NPY_INT', - 'unsigned': 'NPY_UINT', - 'long': 'NPY_LONG', - 'long_long': 'NPY_LONG', # forced casting - 'complex_float': 'NPY_CFLOAT', - 'complex_double': 'NPY_CDOUBLE', - 'complex_long_double': 'NPY_CDOUBLE', # forced casting - 'string': 'NPY_STRING', - 'character': 'NPY_CHAR'} - -# These new maps aren't used anywhere yet, but should be by default -# unless building numeric or numarray extensions. -if using_newcore: - c2capi_map = {'double': 'NPY_DOUBLE', - 'float': 'NPY_FLOAT', - 'long_double': 'NPY_LONGDOUBLE', - 'char': 'NPY_BYTE', - 'unsigned_char': 'NPY_UBYTE', - 'signed_char': 'NPY_BYTE', - 'short': 'NPY_SHORT', - 'unsigned_short': 'NPY_USHORT', - 'int': 'NPY_INT', - 'unsigned': 'NPY_UINT', - 'long': 'NPY_LONG', - 'unsigned_long': 'NPY_ULONG', - 'long_long': 'NPY_LONGLONG', - 'unsigned_long_long': 'NPY_ULONGLONG', - 'complex_float': 'NPY_CFLOAT', - 'complex_double': 'NPY_CDOUBLE', - 'complex_long_double': 'NPY_CDOUBLE', - 'string': 'NPY_STRING', - 'character': 'NPY_STRING'} + 'float': 'NPY_FLOAT', + 'long_double': 'NPY_LONGDOUBLE', + 'char': 'NPY_BYTE', + 'unsigned_char': 'NPY_UBYTE', + 'signed_char': 'NPY_BYTE', + 'short': 'NPY_SHORT', + 'unsigned_short': 'NPY_USHORT', + 'int': 'NPY_INT', + 'unsigned': 'NPY_UINT', + 'long': 'NPY_LONG', + 'unsigned_long': 'NPY_ULONG', + 'long_long': 'NPY_LONGLONG', + 'unsigned_long_long': 'NPY_ULONGLONG', + 'complex_float': 'NPY_CFLOAT', + 'complex_double': 'NPY_CDOUBLE', + 'complex_long_double': 'NPY_CDOUBLE', + 'string': 'NPY_STRING', + 'character': 'NPY_STRING'} c2pycode_map = {'double': 'd', 'float': 'f', - 'long_double': 'd', # forced casting - 'char': '1', - 'signed_char': '1', - 'unsigned_char': 'b', - 'short': 's', - 'unsigned_short': 'w', + 'long_double': 'g', + 'char': 'b', + 'unsigned_char': 'B', + 'signed_char': 'b', + 'short': 'h', + 'unsigned_short': 'H', 'int': 'i', - 'unsigned': 'u', + 'unsigned': 'I', 'long': 'l', - 'long_long': 'L', + 'unsigned_long': 'L', + 'long_long': 'q', + 'unsigned_long_long': 'Q', 'complex_float': 'F', 'complex_double': 'D', - 'complex_long_double': 'D', # forced casting - 'string': 'c', - 'character': 'c' - } - -if using_newcore: - c2pycode_map = {'double': 'd', - 'float': 'f', - 'long_double': 'g', - 'char': 'b', - 'unsigned_char': 'B', - 'signed_char': 'b', - 'short': 'h', - 'unsigned_short': 'H', - 'int': 'i', - 'unsigned': 'I', - 'long': 'l', - 'unsigned_long': 'L', - 'long_long': 'q', - 'unsigned_long_long': 'Q', - 'complex_float': 'F', - 'complex_double': 'D', - 'complex_long_double': 'G', - 'string': 'S', - 'character': 'c'} + 'complex_long_double': 'G', + 'string': 'S', + 'character': 'c'} # https://docs.python.org/3/c-api/arg.html#building-values -# c2buildvalue_map is NumPy agnostic, so no need to bother with using_newcore c2buildvalue_map = {'double': 'd', 'float': 'f', 'char': 'b', @@ -174,6 +131,7 @@ f2cmap_all = {'real': {'': 'float', '4': 'float', '8': 'double', 'byte': {'': 'char'}, } +f2cmap_all = deep_merge(f2cmap_all, iso_c_binding_map) f2cmap_default = copy.deepcopy(f2cmap_all) f2cmap_mapped = [] diff --git a/contrib/python/numpy/py3/numpy/f2py/cfuncs.py b/contrib/python/numpy/py3/numpy/f2py/cfuncs.py index 2d27b65243..f89793061b 100644 --- a/contrib/python/numpy/py3/numpy/f2py/cfuncs.py +++ b/contrib/python/numpy/py3/numpy/f2py/cfuncs.py @@ -53,6 +53,7 @@ includes0['setjmp.h'] = '#include <setjmp.h>' includes['arrayobject.h'] = '''#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API #include "arrayobject.h"''' +includes['npy_math.h'] = '#include "numpy/npy_math.h"' includes['arrayobject.h'] = '#include "fortranobject.h"' includes['stdarg.h'] = '#include <stdarg.h>' @@ -1096,7 +1097,7 @@ float_from_pyobj(float* v, PyObject *obj, const char *errmess) needs['complex_long_double_from_pyobj'] = ['complex_long_double', 'long_double', - 'complex_double_from_pyobj'] + 'complex_double_from_pyobj', 'npy_math.h'] cfuncs['complex_long_double_from_pyobj'] = """\ static int complex_long_double_from_pyobj(complex_long_double* v, PyObject *obj, const char *errmess) @@ -1108,8 +1109,8 @@ complex_long_double_from_pyobj(complex_long_double* v, PyObject *obj, const char return 1; } else if (PyArray_Check(obj) && PyArray_TYPE(obj)==NPY_CLONGDOUBLE) { - (*v).r = ((npy_clongdouble *)PyArray_DATA(obj))->real; - (*v).i = ((npy_clongdouble *)PyArray_DATA(obj))->imag; + (*v).r = npy_creall(*(((npy_clongdouble *)PyArray_DATA(obj)))); + (*v).i = npy_cimagl(*(((npy_clongdouble *)PyArray_DATA(obj)))); return 1; } } @@ -1123,7 +1124,7 @@ complex_long_double_from_pyobj(complex_long_double* v, PyObject *obj, const char """ -needs['complex_double_from_pyobj'] = ['complex_double'] +needs['complex_double_from_pyobj'] = ['complex_double', 'npy_math.h'] cfuncs['complex_double_from_pyobj'] = """\ static int complex_double_from_pyobj(complex_double* v, PyObject *obj, const char *errmess) { @@ -1138,14 +1139,14 @@ complex_double_from_pyobj(complex_double* v, PyObject *obj, const char *errmess) if (PyArray_IsScalar(obj, CFloat)) { npy_cfloat new; PyArray_ScalarAsCtype(obj, &new); - (*v).r = (double)new.real; - (*v).i = (double)new.imag; + (*v).r = (double)npy_crealf(new); + (*v).i = (double)npy_cimagf(new); } else if (PyArray_IsScalar(obj, CLongDouble)) { npy_clongdouble new; PyArray_ScalarAsCtype(obj, &new); - (*v).r = (double)new.real; - (*v).i = (double)new.imag; + (*v).r = (double)npy_creall(new); + (*v).i = (double)npy_cimagl(new); } else { /* if (PyArray_IsScalar(obj, CDouble)) */ PyArray_ScalarAsCtype(obj, v); @@ -1163,8 +1164,8 @@ complex_double_from_pyobj(complex_double* v, PyObject *obj, const char *errmess) if (arr == NULL) { return 0; } - (*v).r = ((npy_cdouble *)PyArray_DATA(arr))->real; - (*v).i = ((npy_cdouble *)PyArray_DATA(arr))->imag; + (*v).r = npy_creal(*(((npy_cdouble *)PyArray_DATA(arr)))); + (*v).i = npy_cimag(*(((npy_cdouble *)PyArray_DATA(arr)))); Py_DECREF(arr); return 1; } diff --git a/contrib/python/numpy/py3/numpy/f2py/crackfortran.py b/contrib/python/numpy/py3/numpy/f2py/crackfortran.py index cce93dd7f5..f352bbaa27 100755 --- a/contrib/python/numpy/py3/numpy/f2py/crackfortran.py +++ b/contrib/python/numpy/py3/numpy/f2py/crackfortran.py @@ -614,7 +614,8 @@ groupends = (r'end|endprogram|endblockdata|endmodule|endpythonmodule|' r'endinterface|endsubroutine|endfunction') endpattern = re.compile( beforethisafter % ('', groupends, groupends, '.*'), re.I), 'end' -endifs = r'end\s*(if|do|where|select|while|forall|associate|block|' + \ +# block, the Fortran 2008 construct needs special handling in the rest of the file +endifs = r'end\s*(if|do|where|select|while|forall|associate|' + \ r'critical|enum|team)' endifpattern = re.compile( beforethisafter % (r'[\w]*?', endifs, endifs, '.*'), re.I), 'endif' @@ -695,7 +696,8 @@ def _simplifyargs(argsline): return ','.join(a) crackline_re_1 = re.compile(r'\s*(?P<result>\b[a-z]+\w*\b)\s*=.*', re.I) - +crackline_bind_1 = re.compile(r'\s*(?P<bind>\b[a-z]+\w*\b)\s*=.*', re.I) +crackline_bindlang = re.compile(r'\s*bind\(\s*(?P<lang>[^,]+)\s*,\s*name\s*=\s*"(?P<lang_name>[^"]+)"\s*\)', re.I) def crackline(line, reset=0): """ @@ -966,12 +968,22 @@ def _resolvetypedefpattern(line): return m1.group('name'), attrs, m1.group('params') return None, [], None +def parse_name_for_bind(line): + pattern = re.compile(r'bind\(\s*(?P<lang>[^,]+)(?:\s*,\s*name\s*=\s*["\'](?P<name>[^"\']+)["\']\s*)?\)', re.I) + match = pattern.search(line) + bind_statement = None + if match: + bind_statement = match.group(0) + # Remove the 'bind' construct from the line. + line = line[:match.start()] + line[match.end():] + return line, bind_statement def _resolvenameargspattern(line): + line, bind_cname = parse_name_for_bind(line) line = markouterparen(line) m1 = nameargspattern.match(line) if m1: - return m1.group('name'), m1.group('args'), m1.group('result'), m1.group('bind') + return m1.group('name'), m1.group('args'), m1.group('result'), bind_cname m1 = operatorpattern.match(line) if m1: name = m1.group('scheme') + '(' + m1.group('name') + ')' @@ -1021,7 +1033,7 @@ def analyzeline(m, case, line): args = [] result = None else: - name, args, result, _ = _resolvenameargspattern(m.group('after')) + name, args, result, bindcline = _resolvenameargspattern(m.group('after')) if name is None: if block == 'block data': name = '_BLOCK_DATA_' @@ -1139,6 +1151,14 @@ def analyzeline(m, case, line): except Exception: pass if block in ['function', 'subroutine']: # set global attributes + # name is fortran name + if bindcline: + bindcdat = re.search(crackline_bindlang, bindcline) + if bindcdat: + groupcache[groupcounter]['bindlang'] = {name : {}} + groupcache[groupcounter]['bindlang'][name]["lang"] = bindcdat.group('lang') + if bindcdat.group('lang_name'): + groupcache[groupcounter]['bindlang'][name]["name"] = bindcdat.group('lang_name') try: groupcache[groupcounter]['vars'][name] = appenddecl( groupcache[groupcounter]['vars'][name], groupcache[groupcounter - 2]['vars']['']) @@ -1172,7 +1192,7 @@ def analyzeline(m, case, line): groupcounter = groupcounter - 1 # end interface elif case == 'entry': - name, args, result, bind = _resolvenameargspattern(m.group('after')) + name, args, result, _= _resolvenameargspattern(m.group('after')) if name is not None: if args: args = rmbadname([x.strip() @@ -1405,45 +1425,61 @@ def analyzeline(m, case, line): if dl.startswith(','): dl = dl[1:].strip() ll.append([dl, il]) - vars = {} - if 'vars' in groupcache[groupcounter]: - vars = groupcache[groupcounter]['vars'] + vars = groupcache[groupcounter].get('vars', {}) last_name = None for l in ll: - l = [x.strip() for x in l] - if l[0][0] == ',': + l[0], l[1] = l[0].strip(), l[1].strip() + if l[0].startswith(','): l[0] = l[0][1:] - if l[0][0] == '(': - outmess( - 'analyzeline: implied-DO list "%s" is not supported. Skipping.\n' % l[0]) + if l[0].startswith('('): + outmess('analyzeline: implied-DO list "%s" is not supported. Skipping.\n' % l[0]) continue - i = 0 - j = 0 - llen = len(l[1]) - for v in rmbadname([x.strip() for x in markoutercomma(l[0]).split('@,@')]): - if v[0] == '(': - outmess( - 'analyzeline: implied-DO list "%s" is not supported. Skipping.\n' % v) + for idx, v in enumerate(rmbadname([x.strip() for x in markoutercomma(l[0]).split('@,@')])): + if v.startswith('('): + outmess('analyzeline: implied-DO list "%s" is not supported. Skipping.\n' % v) # XXX: subsequent init expressions may get wrong values. # Ignoring since data statements are irrelevant for # wrapping. continue - fc = 0 - while (i < llen) and (fc or not l[1][i] == ','): - if l[1][i] == "'": - fc = not fc - i = i + 1 - i = i + 1 - if v not in vars: - vars[v] = {} - if '=' in vars[v] and not vars[v]['='] == l[1][j:i - 1]: - outmess('analyzeline: changing init expression of "%s" ("%s") to "%s"\n' % ( - v, vars[v]['='], l[1][j:i - 1])) - vars[v]['='] = l[1][j:i - 1] - j = i + if '!' in l[1]: + # Fixes gh-24746 pyf generation + # XXX: This essentially ignores the value for generating the pyf which is fine: + # integer dimension(3) :: mytab + # common /mycom/ mytab + # Since in any case it is initialized in the Fortran code + outmess('Comment line in declaration "%s" is not supported. Skipping.\n' % l[1]) + continue + vars.setdefault(v, {}) + vtype = vars[v].get('typespec') + vdim = getdimension(vars[v]) + matches = re.findall(r"\(.*?\)", l[1]) if vtype == 'complex' else l[1].split(',') + try: + new_val = "(/{}/)".format(", ".join(matches)) if vdim else matches[idx] + except IndexError: + # gh-24746 + # Runs only if above code fails. Fixes the line + # DATA IVAR1, IVAR2, IVAR3, IVAR4, EVAR5 /4*0,0.0D0/ + # by expanding to ['0', '0', '0', '0', '0.0d0'] + if any("*" in m for m in matches): + expanded_list = [] + for match in matches: + if "*" in match: + try: + multiplier, value = match.split("*") + expanded_list.extend([value.strip()] * int(multiplier)) + except ValueError: # if int(multiplier) fails + expanded_list.append(match.strip()) + else: + expanded_list.append(match.strip()) + matches = expanded_list + new_val = "(/{}/)".format(", ".join(matches)) if vdim else matches[idx] + current_val = vars[v].get('=') + if current_val and (current_val != new_val): + outmess('analyzeline: changing init expression of "%s" ("%s") to "%s"\n' % (v, current_val, new_val)) + vars[v]['='] = new_val last_name = v groupcache[groupcounter]['vars'] = vars - if last_name is not None: + if last_name: previous_context = ('variable', last_name, groupcounter) elif case == 'common': line = m.group('after').strip() @@ -1741,6 +1777,23 @@ def updatevars(typespec, selector, attrspec, entitydecl): else: del d1[k] + if 'len' in d1 and 'array' in d1: + if d1['len'] == '': + d1['len'] = d1['array'] + del d1['array'] + elif typespec == 'character': + if ('charselector' not in edecl) or (not edecl['charselector']): + edecl['charselector'] = {} + if 'len' in edecl['charselector']: + del edecl['charselector']['len'] + edecl['charselector']['*'] = d1['len'] + del d1['len'] + else: + d1['array'] = d1['array'] + ',' + d1['len'] + del d1['len'] + errmess('updatevars: "%s %s" is mapped to "%s %s(%s)"\n' % ( + typespec, e, typespec, ename, d1['array'])) + if 'len' in d1: if typespec in ['complex', 'integer', 'logical', 'real']: if ('kindselector' not in edecl) or (not edecl['kindselector']): @@ -1762,16 +1815,6 @@ def updatevars(typespec, selector, attrspec, entitydecl): else: edecl['='] = d1['init'] - if 'len' in d1 and 'array' in d1: - if d1['len'] == '': - d1['len'] = d1['array'] - del d1['array'] - else: - d1['array'] = d1['array'] + ',' + d1['len'] - del d1['len'] - errmess('updatevars: "%s %s" is mapped to "%s %s(%s)"\n' % ( - typespec, e, typespec, ename, d1['array'])) - if 'array' in d1: dm = 'dimension(%s)' % d1['array'] if 'attrspec' not in edecl or (not edecl['attrspec']): @@ -2409,7 +2452,7 @@ def _selected_real_kind_func(p, r=0, radix=0): if p < 16: return 8 machine = platform.machine().lower() - if machine.startswith(('aarch64', 'arm64', 'power', 'ppc', 'riscv', 's390x', 'sparc')): + if machine.startswith(('aarch64', 'arm64', 'loongarch', 'power', 'ppc', 'riscv', 's390x', 'sparc')): if p <= 33: return 16 else: diff --git a/contrib/python/numpy/py3/numpy/f2py/f2py2e.py b/contrib/python/numpy/py3/numpy/f2py/f2py2e.py index 10508488dc..1cfe8cddd6 100755 --- a/contrib/python/numpy/py3/numpy/f2py/f2py2e.py +++ b/contrib/python/numpy/py3/numpy/f2py/f2py2e.py @@ -19,6 +19,8 @@ import os import pprint import re from pathlib import Path +from itertools import dropwhile +import argparse from . import crackfortran from . import rules @@ -28,6 +30,7 @@ from . import cfuncs from . import f90mod_rules from . import __version__ from . import capi_maps +from numpy.f2py._backends import f2py_build_generator f2py_version = __version__.version numpy_version = __version__.version @@ -126,7 +129,7 @@ Options: -v Print f2py version ID and exit. -numpy.distutils options (only effective with -c): +build backend options (only effective with -c): --fcompiler= Specify Fortran compiler type by vendor --compiler= Specify C compiler type (as defined by distutils) @@ -142,6 +145,22 @@ numpy.distutils options (only effective with -c): --noarch Compile without arch-dependent optimization --debug Compile with debugging information + --dep <dependency> + Specify a meson dependency for the module. This may + be passed multiple times for multiple dependencies. + Dependencies are stored in a list for further processing. + + Example: --dep lapack --dep scalapack + This will identify "lapack" and "scalapack" as dependencies + and remove them from argv, leaving a dependencies list + containing ["lapack", "scalapack"]. + + --backend <backend_type> + Specify the build backend for the compilation process. + The supported backends are 'meson' and 'distutils'. + If not specified, defaults to 'distutils'. On + Python 3.12 or higher, the default is 'meson'. + Extra options (only effective with -c): --link-<resource> Link extension module with <resource> as defined @@ -251,6 +270,8 @@ def scaninputline(inputline): 'f2py option --include_paths is deprecated, use --include-paths instead.\n') f7 = 1 elif l[:15] in '--include-paths': + # Similar to using -I with -c, however this is + # also used during generation of wrappers f7 = 1 elif l == '--skip-empty-wrappers': emptygen = False @@ -501,6 +522,25 @@ def get_prefix(module): p = os.path.dirname(os.path.dirname(module.__file__)) return p +def preparse_sysargv(): + # To keep backwards bug compatibility, newer flags are handled by argparse, + # and `sys.argv` is passed to the rest of `f2py` as is. + parser = argparse.ArgumentParser(add_help=False) + parser.add_argument("--dep", action="append", dest="dependencies") + parser.add_argument("--backend", choices=['meson', 'distutils'], default='distutils') + + args, remaining_argv = parser.parse_known_args() + sys.argv = [sys.argv[0]] + remaining_argv + + backend_key = args.backend + if sys.version_info >= (3, 12) and backend_key == 'distutils': + outmess('Cannot use distutils backend with Python 3.12, using meson backend instead.') + backend_key = 'meson' + + return { + "dependencies": args.dependencies or [], + "backend": backend_key + } def run_compile(): """ @@ -508,6 +548,13 @@ def run_compile(): """ import tempfile + # Collect dependency flags, preprocess sys.argv + argy = preparse_sysargv() + dependencies = argy["dependencies"] + backend_key = argy["backend"] + build_backend = f2py_build_generator(backend_key) + + i = sys.argv.index('-c') del sys.argv[i] @@ -546,7 +593,6 @@ def run_compile(): if f2py_flags2 and f2py_flags2[-1] != ':': f2py_flags2.append(':') f2py_flags.extend(f2py_flags2) - sys.argv = [_m for _m in sys.argv if _m not in f2py_flags2] _reg3 = re.compile( r'--((f(90)?compiler(-exec|)|compiler)=|help-compiler)') @@ -598,17 +644,17 @@ def run_compile(): del sys.argv[i + 1], sys.argv[i] sources = sys.argv[1:] + pyf_files = [] if '-m' in sys.argv: i = sys.argv.index('-m') modulename = sys.argv[i + 1] del sys.argv[i + 1], sys.argv[i] sources = sys.argv[1:] else: - from numpy.distutils.command.build_src import get_f2py_modulename - pyf_files, sources = filter_files('', '[.]pyf([.]src|)', sources) - sources = pyf_files + sources + pyf_files, _sources = filter_files('', '[.]pyf([.]src|)', sources) + sources = pyf_files + _sources for f in pyf_files: - modulename = get_f2py_modulename(f) + modulename = auxfuncs.get_f2py_modulename(f) if modulename: break @@ -627,52 +673,36 @@ def run_compile(): else: print('Invalid use of -D:', name_value) - from numpy.distutils.system_info import get_info - - num_info = {} - if num_info: - include_dirs.extend(num_info.get('include_dirs', [])) - - from numpy.distutils.core import setup, Extension - ext_args = {'name': modulename, 'sources': sources, - 'include_dirs': include_dirs, - 'library_dirs': library_dirs, - 'libraries': libraries, - 'define_macros': define_macros, - 'undef_macros': undef_macros, - 'extra_objects': extra_objects, - 'f2py_options': f2py_flags, - } - - if sysinfo_flags: - from numpy.distutils.misc_util import dict_append - for n in sysinfo_flags: - i = get_info(n) - if not i: - outmess('No %s resources found in system' - ' (try `f2py --help-link`)\n' % (repr(n))) - dict_append(ext_args, **i) - - ext = Extension(**ext_args) - sys.argv = [sys.argv[0]] + setup_flags - sys.argv.extend(['build', - '--build-temp', build_dir, - '--build-base', build_dir, - '--build-platlib', '.', - # disable CCompilerOpt - '--disable-optimization']) - if fc_flags: - sys.argv.extend(['config_fc'] + fc_flags) - if flib_flags: - sys.argv.extend(['build_ext'] + flib_flags) - - setup(ext_modules=[ext]) - - if remove_build_dir and os.path.exists(build_dir): - import shutil - outmess('Removing build directory %s\n' % (build_dir)) - shutil.rmtree(build_dir) - + # Construct wrappers / signatures / things + if backend_key == 'meson': + outmess('Using meson backend\nWill pass --lower to f2py\nSee https://numpy.org/doc/stable/f2py/buildtools/meson.html') + f2py_flags.append('--lower') + if pyf_files: + run_main(f" {' '.join(f2py_flags)} {' '.join(pyf_files)}".split()) + else: + run_main(f" {' '.join(f2py_flags)} -m {modulename} {' '.join(sources)}".split()) + + # Now use the builder + builder = build_backend( + modulename, + sources, + extra_objects, + build_dir, + include_dirs, + library_dirs, + libraries, + define_macros, + undef_macros, + f2py_flags, + sysinfo_flags, + fc_flags, + flib_flags, + setup_flags, + remove_build_dir, + {"dependencies": dependencies}, + ) + + builder.compile() def main(): if '--help-link' in sys.argv[1:]: diff --git a/contrib/python/numpy/py3/numpy/f2py/func2subr.py b/contrib/python/numpy/py3/numpy/f2py/func2subr.py index cc3cdc5b4f..2eedc0ade8 100644 --- a/contrib/python/numpy/py3/numpy/f2py/func2subr.py +++ b/contrib/python/numpy/py3/numpy/f2py/func2subr.py @@ -21,6 +21,7 @@ from .auxfuncs import ( issubroutine, issubroutine_wrap, outmess, show ) +from ._isocbind import isoc_kindmap def var2fixfortran(vars, a, fa=None, f90mode=None): if fa is None: @@ -70,6 +71,13 @@ def var2fixfortran(vars, a, fa=None, f90mode=None): vardef = '%s(%s)' % (vardef, ','.join(vars[a]['dimension'])) return vardef +def useiso_c_binding(rout): + useisoc = False + for key, value in rout['vars'].items(): + kind_value = value.get('kindselector', {}).get('kind') + if kind_value in isoc_kindmap: + return True + return useisoc def createfuncwrapper(rout, signature=0): assert isfunction(rout) @@ -117,6 +125,7 @@ def createfuncwrapper(rout, signature=0): l1 = l_tmpl.replace('@@@NAME@@@', newname) rl = None + useisoc = useiso_c_binding(rout) sargs = ', '.join(args) if f90mode: # gh-23598 fix warning @@ -129,8 +138,12 @@ def createfuncwrapper(rout, signature=0): (rout['modulename'], name, sargs)) if not signature: add('use %s, only : %s' % (rout['modulename'], fortranname)) + if useisoc: + add('use iso_c_binding') else: add('subroutine f2pywrap%s (%s)' % (name, sargs)) + if useisoc: + add('use iso_c_binding') if not need_interface: add('external %s' % (fortranname)) rl = l_tmpl.replace('@@@NAME@@@', '') + ' ' + fortranname @@ -218,14 +231,19 @@ def createsubrwrapper(rout, signature=0): args = rout['args'] + useisoc = useiso_c_binding(rout) sargs = ', '.join(args) if f90mode: add('subroutine f2pywrap_%s_%s (%s)' % (rout['modulename'], name, sargs)) + if useisoc: + add('use iso_c_binding') if not signature: add('use %s, only : %s' % (rout['modulename'], fortranname)) else: add('subroutine f2pywrap%s (%s)' % (name, sargs)) + if useisoc: + add('use iso_c_binding') if not need_interface: add('external %s' % (fortranname)) diff --git a/contrib/python/numpy/py3/numpy/f2py/setup.py b/contrib/python/numpy/py3/numpy/f2py/setup.py index 499609f966..98f1e9aaae 100644 --- a/contrib/python/numpy/py3/numpy/f2py/setup.py +++ b/contrib/python/numpy/py3/numpy/f2py/setup.py @@ -26,10 +26,13 @@ from __version__ import version def configuration(parent_package='', top_path=None): config = Configuration('f2py', parent_package, top_path) config.add_subpackage('tests') + config.add_subpackage('_backends') config.add_data_dir('tests/src') config.add_data_files( 'src/fortranobject.c', - 'src/fortranobject.h') + 'src/fortranobject.h', + 'backends/meson.build.template', + ) config.add_data_files('*.pyi') return config diff --git a/contrib/python/numpy/py3/numpy/f2py/src/fortranobject.c b/contrib/python/numpy/py3/numpy/f2py/src/fortranobject.c index add6e8b6ef..072392bb66 100644 --- a/contrib/python/numpy/py3/numpy/f2py/src/fortranobject.c +++ b/contrib/python/numpy/py3/numpy/f2py/src/fortranobject.c @@ -726,7 +726,8 @@ static int check_and_fix_dimensions(const PyArrayObject* arr, static int find_first_negative_dimension(const int rank, const npy_intp *dims) { - for (int i = 0; i < rank; ++i) { + int i; + for (i = 0; i < rank; ++i) { if (dims[i] < 0) { return i; } diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_common.f b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_common.f new file mode 100644 index 0000000000..5ffd865c83 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_common.f @@ -0,0 +1,8 @@ + BLOCK DATA PARAM_INI + COMMON /MYCOM/ MYDATA + DATA MYDATA /0/ + END + SUBROUTINE SUB1 + COMMON /MYCOM/ MYDATA + MYDATA = MYDATA + 1 + END diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_multiplier.f b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_multiplier.f new file mode 100644 index 0000000000..19ff8a83e9 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_multiplier.f @@ -0,0 +1,5 @@ + BLOCK DATA MYBLK + IMPLICIT DOUBLE PRECISION (A-H,O-Z) + COMMON /MYCOM/ IVAR1, IVAR2, IVAR3, IVAR4, EVAR5 + DATA IVAR1, IVAR2, IVAR3, IVAR4, EVAR5 /2*3,2*2,0.0D0/ + END diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_stmts.f90 b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_stmts.f90 new file mode 100644 index 0000000000..576c5e485b --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_stmts.f90 @@ -0,0 +1,20 @@ +! gh-23276 +module cmplxdat + implicit none + integer :: i, j + real :: x, y + real, dimension(2) :: z + real(kind=8) :: pi + complex(kind=8), target :: medium_ref_index + complex(kind=8), target :: ref_index_one, ref_index_two + complex(kind=8), dimension(2) :: my_array + real(kind=8), dimension(3) :: my_real_array = (/1.0d0, 2.0d0, 3.0d0/) + + data i, j / 2, 3 / + data x, y / 1.5, 2.0 / + data z / 3.5, 7.0 / + data medium_ref_index / (1.d0, 0.d0) / + data ref_index_one, ref_index_two / (13.0d0, 21.0d0), (-30.0d0, 43.0d0) / + data my_array / (1.0d0, 2.0d0), (-3.0d0, 4.0d0) / + data pi / 3.1415926535897932384626433832795028841971693993751058209749445923078164062d0 / +end module cmplxdat diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_with_comments.f b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_with_comments.f new file mode 100644 index 0000000000..4128f004e8 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/data_with_comments.f @@ -0,0 +1,8 @@ + BLOCK DATA PARAM_INI + COMMON /MYCOM/ MYTAB + INTEGER MYTAB(3) + DATA MYTAB/ + * 0, ! 1 and more commenty stuff + * 4, ! 2 + * 0 / + END diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/gh22648.pyf b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/gh22648.pyf new file mode 100644 index 0000000000..b3454f1863 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/crackfortran/gh22648.pyf @@ -0,0 +1,7 @@ +python module iri16py ! in + interface ! in :iri16py + block data ! in :iri16py:iridreg_modified.for + COMMON /fircom/ eden,tabhe,tabla,tabmo,tabza,tabfl + end block data + end interface +end python module iri16py diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/f2cmap/isoFortranEnvMap.f90 b/contrib/python/numpy/py3/numpy/f2py/tests/src/f2cmap/isoFortranEnvMap.f90 index 3f0e12c768..1e1dc1d405 100644 --- a/contrib/python/numpy/py3/numpy/f2py/tests/src/f2cmap/isoFortranEnvMap.f90 +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/f2cmap/isoFortranEnvMap.f90 @@ -4,6 +4,6 @@ integer(int64), intent(in) :: n real(real64), intent(in) :: x(n) real(real64), intent(out) :: res -Cf2py intent(hide) :: n +!f2py intent(hide) :: n res = sum(x) end diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/isocintrin/isoCtests.f90 b/contrib/python/numpy/py3/numpy/f2py/tests/src/isocintrin/isoCtests.f90 new file mode 100644 index 0000000000..42db6cccc1 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/isocintrin/isoCtests.f90 @@ -0,0 +1,17 @@ + module coddity + use iso_c_binding, only: c_double, c_int + implicit none + contains + subroutine c_add(a, b, c) bind(c, name="c_add") + real(c_double), intent(in) :: a, b + real(c_double), intent(out) :: c + c = a + b + end subroutine c_add + ! gh-9693 + function wat(x, y) result(z) bind(c) + integer(c_int), intent(in) :: x, y + integer(c_int) :: z + + z = x + 7 + end function wat + end module coddity diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/src/string/gh24008.f b/contrib/python/numpy/py3/numpy/f2py/tests/src/string/gh24008.f new file mode 100644 index 0000000000..ab64cf771f --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/src/string/gh24008.f @@ -0,0 +1,8 @@ + SUBROUTINE GREET(NAME, GREETING) + CHARACTER NAME*(*), GREETING*(*) + CHARACTER*(50) MESSAGE + + MESSAGE = 'Hello, ' // NAME // ', ' // GREETING +c$$$ PRINT *, MESSAGE + + END SUBROUTINE GREET diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/test_character.py b/contrib/python/numpy/py3/numpy/f2py/tests/test_character.py index 0bb0f42902..373262bf96 100644 --- a/contrib/python/numpy/py3/numpy/f2py/tests/test_character.py +++ b/contrib/python/numpy/py3/numpy/f2py/tests/test_character.py @@ -574,7 +574,6 @@ class TestMiscCharacter(util.F2PyTest): class TestStringScalarArr(util.F2PyTest): sources = [util.getpath("tests", "src", "string", "scalar_string.f90")] - @pytest.mark.slow def test_char(self): for out in (self.module.string_test.string, self.module.string_test.string77): @@ -583,7 +582,6 @@ class TestStringScalarArr(util.F2PyTest): expected = '|S8' assert out.dtype == expected - @pytest.mark.slow def test_char_arr(self): for out in (self.module.string_test.strarr, self.module.string_test.strarr77): @@ -591,3 +589,9 @@ class TestStringScalarArr(util.F2PyTest): assert out.shape == expected expected = '|S12' assert out.dtype == expected + +class TestStringAssumedLength(util.F2PyTest): + sources = [util.getpath("tests", "src", "string", "gh24008.f")] + + def test_gh24008(self): + self.module.greet("joe", "bob") diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/test_crackfortran.py b/contrib/python/numpy/py3/numpy/f2py/tests/test_crackfortran.py index c07ae036c0..c8d9ddb884 100644 --- a/contrib/python/numpy/py3/numpy/f2py/tests/test_crackfortran.py +++ b/contrib/python/numpy/py3/numpy/f2py/tests/test_crackfortran.py @@ -8,6 +8,8 @@ from numpy.f2py.crackfortran import markinnerspaces, nameargspattern from . import util from numpy.f2py import crackfortran import textwrap +import contextlib +import io class TestNoSpace(util.F2PyTest): @@ -338,3 +340,11 @@ class TestFortranGroupCounters(util.F2PyTest): crackfortran.crackfortran([str(fpath)]) except Exception as exc: assert False, f"'crackfortran.crackfortran' raised an exception {exc}" + + +class TestF77CommonBlockReader(): + def test_gh22648(self, tmp_path): + fpath = util.getpath("tests", "src", "crackfortran", "gh22648.pyf") + with contextlib.redirect_stdout(io.StringIO()) as stdout_f2py: + mod = crackfortran.crackfortran([str(fpath)]) + assert "Mismatch" not in stdout_f2py.getvalue() diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/test_data.py b/contrib/python/numpy/py3/numpy/f2py/tests/test_data.py new file mode 100644 index 0000000000..4e5604c006 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/test_data.py @@ -0,0 +1,70 @@ +import os +import pytest +import numpy as np + +from . import util +from numpy.f2py.crackfortran import crackfortran + + +class TestData(util.F2PyTest): + sources = [util.getpath("tests", "src", "crackfortran", "data_stmts.f90")] + + # For gh-23276 + def test_data_stmts(self): + assert self.module.cmplxdat.i == 2 + assert self.module.cmplxdat.j == 3 + assert self.module.cmplxdat.x == 1.5 + assert self.module.cmplxdat.y == 2.0 + assert self.module.cmplxdat.pi == 3.1415926535897932384626433832795028841971693993751058209749445923078164062 + assert self.module.cmplxdat.medium_ref_index == np.array(1.+0.j) + assert np.all(self.module.cmplxdat.z == np.array([3.5, 7.0])) + assert np.all(self.module.cmplxdat.my_array == np.array([ 1.+2.j, -3.+4.j])) + assert np.all(self.module.cmplxdat.my_real_array == np.array([ 1., 2., 3.])) + assert np.all(self.module.cmplxdat.ref_index_one == np.array([13.0 + 21.0j])) + assert np.all(self.module.cmplxdat.ref_index_two == np.array([-30.0 + 43.0j])) + + def test_crackedlines(self): + mod = crackfortran(self.sources) + assert mod[0]['vars']['x']['='] == '1.5' + assert mod[0]['vars']['y']['='] == '2.0' + assert mod[0]['vars']['pi']['='] == '3.1415926535897932384626433832795028841971693993751058209749445923078164062d0' + assert mod[0]['vars']['my_real_array']['='] == '(/1.0d0, 2.0d0, 3.0d0/)' + assert mod[0]['vars']['ref_index_one']['='] == '(13.0d0, 21.0d0)' + assert mod[0]['vars']['ref_index_two']['='] == '(-30.0d0, 43.0d0)' + assert mod[0]['vars']['my_array']['='] == '(/(1.0d0, 2.0d0), (-3.0d0, 4.0d0)/)' + assert mod[0]['vars']['z']['='] == '(/3.5, 7.0/)' + +class TestDataF77(util.F2PyTest): + sources = [util.getpath("tests", "src", "crackfortran", "data_common.f")] + + # For gh-23276 + def test_data_stmts(self): + assert self.module.mycom.mydata == 0 + + def test_crackedlines(self): + mod = crackfortran(str(self.sources[0])) + print(mod[0]['vars']) + assert mod[0]['vars']['mydata']['='] == '0' + + +class TestDataMultiplierF77(util.F2PyTest): + sources = [util.getpath("tests", "src", "crackfortran", "data_multiplier.f")] + + # For gh-23276 + def test_data_stmts(self): + assert self.module.mycom.ivar1 == 3 + assert self.module.mycom.ivar2 == 3 + assert self.module.mycom.ivar3 == 2 + assert self.module.mycom.ivar4 == 2 + assert self.module.mycom.evar5 == 0 + + +class TestDataWithCommentsF77(util.F2PyTest): + sources = [util.getpath("tests", "src", "crackfortran", "data_with_comments.f")] + + # For gh-23276 + def test_data_stmts(self): + assert len(self.module.mycom.mytab) == 3 + assert self.module.mycom.mytab[0] == 0 + assert self.module.mycom.mytab[1] == 4 + assert self.module.mycom.mytab[2] == 0 diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/test_isoc.py b/contrib/python/numpy/py3/numpy/f2py/tests/test_isoc.py new file mode 100644 index 0000000000..7e189bd7b8 --- /dev/null +++ b/contrib/python/numpy/py3/numpy/f2py/tests/test_isoc.py @@ -0,0 +1,19 @@ +from . import util +import numpy as np + +class TestISOC(util.F2PyTest): + sources = [ + util.getpath("tests", "src", "isocintrin", "isoCtests.f90"), + ] + + # gh-24553 + def test_c_double(self): + out = self.module.coddity.c_add(1, 2) + exp_out = 3 + assert out == exp_out + + # gh-9693 + def test_bindc_function(self): + out = self.module.coddity.wat(1, 20) + exp_out = 8 + assert out == exp_out diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/test_return_integer.py b/contrib/python/numpy/py3/numpy/f2py/tests/test_return_integer.py index a43c677fd0..3b2f42e2bf 100644 --- a/contrib/python/numpy/py3/numpy/f2py/tests/test_return_integer.py +++ b/contrib/python/numpy/py3/numpy/f2py/tests/test_return_integer.py @@ -13,15 +13,13 @@ class TestReturnInteger(util.F2PyTest): assert t([123]) == 123 assert t((123, )) == 123 assert t(array(123)) == 123 - assert t(array([123])) == 123 - assert t(array([[123]])) == 123 - assert t(array([123], "b")) == 123 - assert t(array([123], "h")) == 123 - assert t(array([123], "i")) == 123 - assert t(array([123], "l")) == 123 - assert t(array([123], "B")) == 123 - assert t(array([123], "f")) == 123 - assert t(array([123], "d")) == 123 + assert t(array(123, "b")) == 123 + assert t(array(123, "h")) == 123 + assert t(array(123, "i")) == 123 + assert t(array(123, "l")) == 123 + assert t(array(123, "B")) == 123 + assert t(array(123, "f")) == 123 + assert t(array(123, "d")) == 123 # pytest.raises(ValueError, t, array([123],'S3')) pytest.raises(ValueError, t, "abc") diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/test_return_real.py b/contrib/python/numpy/py3/numpy/f2py/tests/test_return_real.py index 9e76c151e8..a15d6475a9 100644 --- a/contrib/python/numpy/py3/numpy/f2py/tests/test_return_real.py +++ b/contrib/python/numpy/py3/numpy/f2py/tests/test_return_real.py @@ -20,15 +20,13 @@ class TestReturnReal(util.F2PyTest): assert abs(t([234]) - 234) <= err assert abs(t((234, )) - 234.0) <= err assert abs(t(array(234)) - 234.0) <= err - assert abs(t(array([234])) - 234.0) <= err - assert abs(t(array([[234]])) - 234.0) <= err - assert abs(t(array([234]).astype("b")) + 22) <= err - assert abs(t(array([234], "h")) - 234.0) <= err - assert abs(t(array([234], "i")) - 234.0) <= err - assert abs(t(array([234], "l")) - 234.0) <= err - assert abs(t(array([234], "B")) - 234.0) <= err - assert abs(t(array([234], "f")) - 234.0) <= err - assert abs(t(array([234], "d")) - 234.0) <= err + assert abs(t(array(234).astype("b")) + 22) <= err + assert abs(t(array(234, "h")) - 234.0) <= err + assert abs(t(array(234, "i")) - 234.0) <= err + assert abs(t(array(234, "l")) - 234.0) <= err + assert abs(t(array(234, "B")) - 234.0) <= err + assert abs(t(array(234, "f")) - 234.0) <= err + assert abs(t(array(234, "d")) - 234.0) <= err if tname in ["t0", "t4", "s0", "s4"]: assert t(1e200) == t(1e300) # inf diff --git a/contrib/python/numpy/py3/numpy/f2py/tests/util.py b/contrib/python/numpy/py3/numpy/f2py/tests/util.py index 26fa7e49d1..75b257cdb8 100644 --- a/contrib/python/numpy/py3/numpy/f2py/tests/util.py +++ b/contrib/python/numpy/py3/numpy/f2py/tests/util.py @@ -20,7 +20,7 @@ import contextlib import numpy from pathlib import Path -from numpy.compat import asbytes, asstr +from numpy._utils import asunicode from numpy.testing import temppath, IS_WASM from importlib import import_module @@ -144,7 +144,7 @@ def build_module(source_files, options=[], skip=[], only=[], module_name=None): out, err = p.communicate() if p.returncode != 0: raise RuntimeError("Running f2py failed: %s\n%s" % - (cmd[4:], asstr(out))) + (cmd[4:], asunicode(out))) finally: os.chdir(cwd) @@ -318,7 +318,7 @@ if __name__ == "__main__": script = os.path.join(d, get_temp_module_name() + ".py") dst_sources.append(script) with open(script, "wb") as f: - f.write(asbytes(code)) + f.write(code.encode('latin1')) # Build cwd = os.getcwd() diff --git a/contrib/python/numpy/py3/numpy/f2py/ya.make b/contrib/python/numpy/py3/numpy/f2py/ya.make index 91f8fe47d4..13d0c761af 100644 --- a/contrib/python/numpy/py3/numpy/f2py/ya.make +++ b/contrib/python/numpy/py3/numpy/f2py/ya.make @@ -9,9 +9,13 @@ PEERDIR( PY_SRCS( NAMESPACE numpy.f2py __init__.py - __init__.pyi __main__.py __version__.py + _backends/__init__.py + _backends/_backend.py + _backends/_distutils.py + _backends/_meson.py + _isocbind.py auxfuncs.py capi_maps.py cb_rules.py diff --git a/contrib/python/numpy/py3/numpy/lib/__init__.py b/contrib/python/numpy/py3/numpy/lib/__init__.py index d3cc9fee4a..cbab200e09 100644 --- a/contrib/python/numpy/py3/numpy/lib/__init__.py +++ b/contrib/python/numpy/py3/numpy/lib/__init__.py @@ -12,8 +12,6 @@ useful to have in the main name-space. """ -from numpy.version import version as __version__ - # Public submodules # Note: recfunctions and (maybe) format are public too, but not imported from . import mixins diff --git a/contrib/python/numpy/py3/numpy/lib/arraysetops.pyi b/contrib/python/numpy/py3/numpy/lib/arraysetops.pyi index aa1310a321..7075c334ea 100644 --- a/contrib/python/numpy/py3/numpy/lib/arraysetops.pyi +++ b/contrib/python/numpy/py3/numpy/lib/arraysetops.pyi @@ -333,6 +333,8 @@ def isin( test_elements: ArrayLike, assume_unique: bool = ..., invert: bool = ..., + *, + kind: None | str = ..., ) -> NDArray[bool_]: ... @overload diff --git a/contrib/python/numpy/py3/numpy/lib/shape_base.pyi b/contrib/python/numpy/py3/numpy/lib/shape_base.pyi index 1b718da221..7cd9608b42 100644 --- a/contrib/python/numpy/py3/numpy/lib/shape_base.pyi +++ b/contrib/python/numpy/py3/numpy/lib/shape_base.pyi @@ -1,6 +1,12 @@ +import sys from collections.abc import Callable, Sequence from typing import TypeVar, Any, overload, SupportsIndex, Protocol +if sys.version_info >= (3, 10): + from typing import ParamSpec, Concatenate +else: + from typing_extensions import ParamSpec, Concatenate + from numpy import ( generic, integer, @@ -28,6 +34,7 @@ from numpy._typing import ( from numpy.core.shape_base import vstack +_P = ParamSpec("_P") _SCT = TypeVar("_SCT", bound=generic) # The signatures of `__array_wrap__` and `__array_prepare__` are the same; @@ -73,23 +80,21 @@ def put_along_axis( axis: None | int, ) -> None: ... -# TODO: Use PEP 612 `ParamSpec` once mypy supports `Concatenate` -# xref python/mypy#8645 @overload def apply_along_axis( - func1d: Callable[..., _ArrayLike[_SCT]], + func1d: Callable[Concatenate[NDArray[Any], _P], _ArrayLike[_SCT]], axis: SupportsIndex, arr: ArrayLike, - *args: Any, - **kwargs: Any, + *args: _P.args, + **kwargs: _P.kwargs, ) -> NDArray[_SCT]: ... @overload def apply_along_axis( - func1d: Callable[..., ArrayLike], + func1d: Callable[Concatenate[NDArray[Any], _P], ArrayLike], axis: SupportsIndex, arr: ArrayLike, - *args: Any, - **kwargs: Any, + *args: _P.args, + **kwargs: _P.kwargs, ) -> NDArray[Any]: ... def apply_over_axes( diff --git a/contrib/python/numpy/py3/numpy/lib/tests/test_format.py b/contrib/python/numpy/py3/numpy/lib/tests/test_format.py index da6c89f676..4ea79327a4 100644 --- a/contrib/python/numpy/py3/numpy/lib/tests/test_format.py +++ b/contrib/python/numpy/py3/numpy/lib/tests/test_format.py @@ -529,6 +529,7 @@ def test_load_padded_dtype(tmpdir, dt): assert_array_equal(arr, arr1) +@pytest.mark.skipif(sys.version_info >= (3, 12), reason="see gh-23988") @pytest.mark.xfail(IS_WASM, reason="Emscripten NODEFS has a buggy dup") def test_python2_python3_interoperability(): fname = 'win64python2.npy' diff --git a/contrib/python/numpy/py3/numpy/lib/tests/test_histograms.py b/contrib/python/numpy/py3/numpy/lib/tests/test_histograms.py index 38b3d3dcbf..8c55f16db9 100644 --- a/contrib/python/numpy/py3/numpy/lib/tests/test_histograms.py +++ b/contrib/python/numpy/py3/numpy/lib/tests/test_histograms.py @@ -398,8 +398,9 @@ class TestHistogram: edges = histogram_bin_edges(arr, bins='auto', range=(0, 1)) assert_array_equal(edges, e) - @requires_memory(free_bytes=1e10) - @pytest.mark.slow + # @requires_memory(free_bytes=1e10) + # @pytest.mark.slow + @pytest.mark.skip(reason="Bad memory reports lead to OOM in ci testing") def test_big_arrays(self): sample = np.zeros([100000000, 3]) xbins = 400 diff --git a/contrib/python/numpy/py3/numpy/linalg/meson.build b/contrib/python/numpy/py3/numpy/linalg/meson.build index d290e5b393..ec0afaab03 100644 --- a/contrib/python/numpy/py3/numpy/linalg/meson.build +++ b/contrib/python/numpy/py3/numpy/linalg/meson.build @@ -1,35 +1,39 @@ -lapack_lite_sources = [ - 'lapack_lite/f2c.c', - 'lapack_lite/f2c_c_lapack.c', - 'lapack_lite/f2c_d_lapack.c', - 'lapack_lite/f2c_s_lapack.c', - 'lapack_lite/f2c_z_lapack.c', - 'lapack_lite/f2c_blas.c', - 'lapack_lite/f2c_config.c', - 'lapack_lite/f2c_lapack.c', - 'lapack_lite/python_xerbla.c', -] +# Note that `python_xerbla.c` was excluded on Windows in setup.py; +# unclear why and it seems needed, so unconditionally used here. +python_xerbla_sources = ['lapack_lite/python_xerbla.c'] -# TODO: ILP64 support - -lapack_lite_module_src = ['lapack_litemodule.c'] +lapack_lite_sources = [] if not have_lapack - warning('LAPACK was not found, NumPy is using an unoptimized, naive build from sources!') - lapack_lite_module_src += lapack_lite_sources + lapack_lite_sources = [ + 'lapack_lite/f2c.c', + 'lapack_lite/f2c_c_lapack.c', + 'lapack_lite/f2c_d_lapack.c', + 'lapack_lite/f2c_s_lapack.c', + 'lapack_lite/f2c_z_lapack.c', + 'lapack_lite/f2c_blas.c', + 'lapack_lite/f2c_config.c', + 'lapack_lite/f2c_lapack.c', + ] endif py.extension_module('lapack_lite', - lapack_lite_module_src, + [ + 'lapack_litemodule.c', + python_xerbla_sources, + lapack_lite_sources, + ], dependencies: [np_core_dep, blas_dep, lapack_dep], install: true, subdir: 'numpy/linalg', ) -_umath_linalg_src = ['umath_linalg.cpp'] + lapack_lite_sources - py.extension_module('_umath_linalg', - _umath_linalg_src, - dependencies: np_core_dep, + [ + 'umath_linalg.cpp', + python_xerbla_sources, + lapack_lite_sources, + ], + dependencies: [np_core_dep, blas_dep, lapack_dep], link_with: npymath_lib, install: true, subdir: 'numpy/linalg', diff --git a/contrib/python/numpy/py3/numpy/linalg/setup.py b/contrib/python/numpy/py3/numpy/linalg/setup.py index 6f72635ab6..e357e294f7 100644 --- a/contrib/python/numpy/py3/numpy/linalg/setup.py +++ b/contrib/python/numpy/py3/numpy/linalg/setup.py @@ -51,7 +51,8 @@ def configuration(parent_package='', top_path=None): # but use the "64_" convention here. info['define_macros'] = [ ('HAVE_BLAS_ILP64', None), - ('BLAS_SYMBOL_SUFFIX', '64_') + ('BLAS_SYMBOL_SUFFIX', '64_'), + ('OPENBLAS_ILP64_NAMING_SCHEME', None), ] self.set_info(**info) diff --git a/contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py b/contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py index 8ba6420bda..a86adfcdd7 100644 --- a/contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py +++ b/contrib/python/numpy/py3/numpy/linalg/tests/test_linalg.py @@ -21,6 +21,13 @@ from numpy.testing import ( assert_almost_equal, assert_allclose, suppress_warnings, assert_raises_regex, HAS_LAPACK64, IS_WASM ) +try: + import numpy.linalg.lapack_lite +except ImportError: + # May be broken when numpy was built without BLAS/LAPACK present + # If so, ensure we don't break the whole test suite - the `lapack_lite` + # submodule should be removed, it's only used in two tests in this file. + pass def consistent_subclass(out, in_): diff --git a/contrib/python/numpy/py3/numpy/linalg/umath_linalg.cpp b/contrib/python/numpy/py3/numpy/linalg/umath_linalg.cpp index a82cec8f16..0c0b35e9c0 100644 --- a/contrib/python/numpy/py3/numpy/linalg/umath_linalg.cpp +++ b/contrib/python/numpy/py3/numpy/linalg/umath_linalg.cpp @@ -4597,5 +4597,11 @@ PyMODINIT_FUNC PyInit__umath_linalg(void) return NULL; } +#ifdef HAVE_BLAS_ILP64 + PyDict_SetItemString(d, "_ilp64", Py_True); +#else + PyDict_SetItemString(d, "_ilp64", Py_False); +#endif + return m; } diff --git a/contrib/python/numpy/py3/numpy/ma/core.py b/contrib/python/numpy/py3/numpy/ma/core.py index 2fe3268852..16f74e89e9 100644 --- a/contrib/python/numpy/py3/numpy/ma/core.py +++ b/contrib/python/numpy/py3/numpy/ma/core.py @@ -4127,6 +4127,9 @@ class MaskedArray(ndarray): # Now take care of the mask; the merged mask should have an item # masked if all fields were masked (in one and/or other). mask = (mask == np.ones((), mask.dtype)) + # Ensure we can compare masks below if other was not masked. + if omask is np.False_: + omask = np.zeros((), smask.dtype) else: # For regular arrays, just use the data as they come. @@ -4137,12 +4140,14 @@ class MaskedArray(ndarray): if isinstance(check, (np.bool_, bool)): return masked if mask else check - if mask is not nomask and compare in (operator.eq, operator.ne): - # Adjust elements that were masked, which should be treated - # as equal if masked in both, unequal if masked in one. - # Note that this works automatically for structured arrays too. - # Ignore this for operations other than `==` and `!=` - check = np.where(mask, compare(smask, omask), check) + if mask is not nomask: + if compare in (operator.eq, operator.ne): + # Adjust elements that were masked, which should be treated + # as equal if masked in both, unequal if masked in one. + # Note that this works automatically for structured arrays too. + # Ignore this for operations other than `==` and `!=` + check = np.where(mask, compare(smask, omask), check) + if mask.shape != check.shape: # Guarantee consistency of the shape, making a copy since the # the mask may need to get written to later. diff --git a/contrib/python/numpy/py3/numpy/ma/tests/test_core.py b/contrib/python/numpy/py3/numpy/ma/tests/test_core.py index 6ab1d7e4f1..08ddc46c24 100644 --- a/contrib/python/numpy/py3/numpy/ma/tests/test_core.py +++ b/contrib/python/numpy/py3/numpy/ma/tests/test_core.py @@ -1310,8 +1310,8 @@ class TestMaskedArrayArithmetic: m1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0] xm = masked_array(x, mask=m1) xm.set_fill_value(1e+20) - float_dtypes = [np.half, np.single, np.double, - np.longdouble, np.cfloat, np.cdouble, np.clongdouble] + float_dtypes = [np.float16, np.float32, np.float64, np.longdouble, + np.complex64, np.complex128, np.clongdouble] for float_dtype in float_dtypes: assert_equal(masked_array(x, mask=m1, dtype=float_dtype).max(), float_dtype(a10)) @@ -1614,6 +1614,23 @@ class TestMaskedArrayArithmetic: assert_equal(test.mask, [[False, False], [False, True]]) assert_(test.fill_value == True) + def test_eq_ne_structured_with_non_masked(self): + a = array([(1, 1), (2, 2), (3, 4)], + mask=[(0, 1), (0, 0), (1, 1)], dtype='i4,i4') + eq = a == a.data + ne = a.data != a + # Test the obvious. + assert_(np.all(eq)) + assert_(not np.any(ne)) + # Expect the mask set only for items with all fields masked. + expected_mask = a.mask == np.ones((), a.mask.dtype) + assert_array_equal(eq.mask, expected_mask) + assert_array_equal(ne.mask, expected_mask) + # The masked element will indicated not equal, because the + # masks did not match. + assert_equal(eq.data, [True, True, False]) + assert_array_equal(eq.data, ~ne.data) + def test_eq_ne_structured_extra(self): # ensure simple examples are symmetric and make sense. # from https://github.com/numpy/numpy/pull/8590#discussion_r101126465 @@ -1745,6 +1762,23 @@ class TestMaskedArrayArithmetic: assert_equal(test.mask, [True, False]) assert_(test.fill_value == True) + @pytest.mark.parametrize("op", [operator.eq, operator.lt]) + def test_eq_broadcast_with_unmasked(self, op): + a = array([0, 1], mask=[0, 1]) + b = np.arange(10).reshape(5, 2) + result = op(a, b) + assert_(result.mask.shape == b.shape) + assert_equal(result.mask, np.zeros(b.shape, bool) | a.mask) + + @pytest.mark.parametrize("op", [operator.eq, operator.gt]) + def test_comp_no_mask_not_broadcast(self, op): + # Regression test for failing doctest in MaskedArray.nonzero + # after gh-24556. + a = array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) + result = op(a, 3) + assert_(not result.mask.shape) + assert_(result.mask is nomask) + @pytest.mark.parametrize('dt1', num_dts, ids=num_ids) @pytest.mark.parametrize('dt2', num_dts, ids=num_ids) @pytest.mark.parametrize('fill', [None, 1]) @@ -3444,7 +3478,7 @@ class TestMaskedArrayMethods: raveled = x.ravel(order) assert (raveled.filled(0) == 0).all() - # NOTE: Can be wrong if arr order is neither C nor F and `order="K"` + # NOTE: Can be wrong if arr order is neither C nor F and `order="K"` assert_array_equal(arr.ravel(order), x.ravel(order)._data) def test_reshape(self): diff --git a/contrib/python/numpy/py3/numpy/meson.build b/contrib/python/numpy/py3/numpy/meson.build index c9a4970a8a..a8f810c8e5 100644 --- a/contrib/python/numpy/py3/numpy/meson.build +++ b/contrib/python/numpy/py3/numpy/meson.build @@ -1,5 +1,6 @@ # We need -lm for all C code (assuming it uses math functions, which is safe to -# assume for numpy). +# assume for NumPy). For C++ it isn't needed, because libstdc++/libc++ is +# guaranteed to depend on it. m_dep = cc.find_library('m', required : false) mlib_linkflag = '' if m_dep.found() @@ -9,15 +10,20 @@ endif # Platform detection is_windows = host_machine.system() == 'windows' -is_mingw = is_windows and cc.get_id() == 'gcc' +is_mingw = is_windows and cc.get_define('__MINGW32__') != '' if is_mingw - # For mingw-w64, link statically against the UCRT. - gcc_link_args = ['-lucrt', '-static'] - add_project_link_arguments(gcc_link_args, language: ['c', 'cpp']) - # Force gcc to float64 long doubles for compatibility with MSVC - # builds, for C only. - add_project_arguments('-mlong-double-64', language: 'c') + is_mingw_built_python = run_command( + py, ['-c', 'import sysconfig; print(sysconfig.get_platform())'], + check: true).stdout().strip().startswith('mingw') + if not is_mingw_built_python + # For mingw-w64, link statically against the UCRT. + gcc_link_args = ['-lucrt', '-static'] + add_project_link_arguments(gcc_link_args, language: ['c', 'cpp']) + # Force gcc to float64 long doubles for compatibility with MSVC + # builds, for C only. + add_project_arguments('-mlong-double-64', language: 'c') + endif # Make fprintf("%zd") work (see https://github.com/rgommers/scipy/issues/118) add_project_arguments('-D__USE_MINGW_ANSI_STDIO=1', language: ['c', 'cpp']) endif @@ -47,72 +53,18 @@ else ] endif - -# TODO: 64-bit BLAS and LAPACK -# -# Note that this works as long as BLAS and LAPACK are detected properly via -# pkg-config. By default we look for OpenBLAS, other libraries can be configured via -# `meson configure -Dblas=blas -Dlapack=lapack` (example to build with Netlib -# BLAS and LAPACK). -# For MKL and for auto-detecting one of multiple libs, we'll need a custom -# dependency in Meson (like is done for scalapack) - see -# https://github.com/mesonbuild/meson/issues/2835 blas_name = get_option('blas') lapack_name = get_option('lapack') -# pkg-config uses a lower-case name while CMake uses a capitalized name, so try -# that too to make the fallback detection with CMake work -if blas_name == 'openblas' - blas = dependency(['openblas', 'OpenBLAS'], required: false) -else - blas = dependency(blas_name, required: false) -endif -have_blas = blas.found() -cblas = [] -if have_blas - # Netlib BLAS has a separate `libcblas.so` which we use directly in the g77 - # ABI wrappers, so detect it and error out if we cannot find it. OpenBLAS can - # be built without CBLAS too (see gh-23909, done by Arch Linux until - # recently) - # In the future, this should be done automatically for: - # `dependency('blas', modules: cblas)` - # see https://github.com/mesonbuild/meson/pull/10921. - have_cblas = false - if cc.links(''' - #include <cblas.h> - int main(int argc, const char *argv[]) - { - double a[4] = {1,2,3,4}; - double b[4] = {5,6,7,8}; - return cblas_ddot(4, a, 1, b, 1) > 10; - } - ''', - dependencies: blas, - name: 'CBLAS', - ) - have_cblas = true - else - cblas = dependency('cblas', required: false) - if cblas.found() - have_cblas = true - endif - endif -endif - -if lapack_name == 'openblas' - lapack_name = ['openblas', 'OpenBLAS'] -endif -lapack_dep = dependency(lapack_name, required: false) -have_lapack = lapack_dep.found() - -dependency_map = { - 'BLAS': blas, - 'LAPACK': lapack_dep, -} +allow_noblas = get_option('allow-noblas') +# This is currently injected directly into CFLAGS/CXXFLAGS for wheel builds +# (see cibuildwheel settings in pyproject.toml), but used by CI jobs already +blas_symbol_suffix = get_option('blas-symbol-suffix') use_ilp64 = get_option('use-ilp64') if not use_ilp64 - # For now, keep supporting this environment variable too (same as in setup.py) - # `false is the default for the CLI flag, so check if env var was set + # TODO: clean this up + # For now, keep supporting the `NPY_USE_BLAS_ILP64` environment variable too + # `false` is the default for the CLI flag, so check if env var was set use_ilp64 = run_command(py, [ '-c', @@ -122,31 +74,136 @@ if not use_ilp64 ).stdout().strip() == '1' endif -# BLAS and LAPACK are optional dependencies for NumPy. We can only use a BLAS -# which provides a CBLAS interface. -# TODO: add ILP64 support -if have_blas - c_args_blas = [] # note: used for C and C++ via `blas_dep` below - if have_cblas - c_args_blas += ['-DHAVE_CBLAS'] +if use_ilp64 + blas_interface = ['interface: ilp64'] +else + blas_interface = ['interface: lp64'] +endif + +# MKL-specific options +_threading_opt = get_option('mkl-threading') +if _threading_opt == 'auto' + # Switch default to iomp once conda-forge missing openmp.pc issue is fixed + mkl_opts = ['threading: seq'] +else + mkl_opts = ['threading: ' + _threading_opt] +endif +blas_opts = {'mkl': mkl_opts} +mkl_version_req = '>=2023.0' # see gh-24824 +mkl_may_use_sdl = not use_ilp64 and _threading_opt in ['auto', 'iomp'] + +# Note that we can only use a BLAS which provides a CBLAS interface. So disable +# BLAS completely if CBLAS is not found. + +# First try scipy-openblas, and if found don't look for cblas or lapack, we +# know what's inside the scipy-openblas wheels already. +if blas_name == 'openblas' or blas_name == 'auto' + blas = dependency('scipy-openblas', method: 'pkg-config', required: false) + if blas.found() + blas_name = 'scipy-openblas' + endif +endif +if blas_name == 'auto' + foreach _name : get_option('blas-order') + if _name == 'mkl' + blas = dependency('mkl', + modules: ['cblas'] + blas_interface + mkl_opts, + required: false, # may be required, but we need to emit a custom error message + version: mkl_version_req, + ) + # Insert a second try with MKL, because we may be rejecting older versions + # or missing it because no pkg-config installed. If so, we need to retry + # with MKL SDL, and drop the version constraint (this always worked). + if not blas.found() and mkl_may_use_sdl + blas = dependency('mkl', modules: ['cblas', 'sdl: true'], required: false) + endif + else + if _name == 'flexiblas' and use_ilp64 + _name = 'flexiblas64' + endif + blas = dependency(_name, modules: ['cblas'] + blas_interface, required: false) + endif + if blas.found() + break + endif + endforeach +else + if blas_name == 'mkl' + blas = dependency('mkl', + modules: ['cblas'] + blas_interface + mkl_opts, + required: false, + version: mkl_version_req, + ) + # Same deal as above - try again for MKL + if not blas.found() and mkl_may_use_sdl + blas = dependency('mkl', modules: ['cblas', 'sdl: true'], required: false) + endif + else + blas = dependency(blas_name, modules: ['cblas'] + blas_interface, required: false) endif +endif + +have_blas = blas.found() +if have_blas + _args_blas = ['-DHAVE_CBLAS'] # note: used for C and C++ via `blas_dep` below if use_ilp64 - c_args_blas += ['-DHAVE_BLAS_ILP64'] + _args_blas += ['-DHAVE_BLAS_ILP64'] + if 'openblas' in blas.name() + _args_blas += ['-DOPENBLAS_ILP64_NAMING_SCHEME'] + endif + endif + if blas_symbol_suffix == 'auto' + if blas_name == 'scipy-openblas' and use_ilp64 + blas_symbol_suffix = '64_' + else + blas_symbol_suffix = blas.get_variable('symbol_suffix', default_value: '') + endif + message(f'BLAS symbol suffix: @blas_symbol_suffix@') endif - # This is currently injected directly into CFLAGS/CXXFLAGS for wheel builds - # (see cibuildwheel settings in pyproject.toml) - blas_symbol_suffix = get_option('blas-symbol-suffix') if blas_symbol_suffix != '' - c_args_blas += ['-DBLAS_SYMBOL_SUFFIX=' + blas_symbol_suffix] + _args_blas += ['-DBLAS_SYMBOL_SUFFIX=' + blas_symbol_suffix] endif blas_dep = declare_dependency( - dependencies: [blas, cblas], - compile_args: c_args_blas, + dependencies: [blas], + compile_args: _args_blas, ) else - blas_dep = [] + if allow_noblas + blas_dep = [] + else + error('No BLAS library detected! Install one, or use the ' + \ + '`allow-noblas` build option (note, this may be up to 100x slower ' + \ + 'for some linear algebra operations).') + endif +endif + +if 'mkl' in blas.name() or blas.name() == 'accelerate' or blas_name == 'scipy-openblas' + # For these libraries we know that they contain LAPACK, and it's desirable to + # use that - no need to run the full detection twice. + lapack = blas +else + if lapack_name == 'auto' + foreach _name : get_option('lapack-order') + lapack = dependency(_name, modules: ['lapack'] + blas_interface, required: false) + if lapack.found() + break + endif + endforeach + else + lapack = dependency(lapack_name, modules: ['lapack'] + blas_interface, required: false) + endif +endif + +have_lapack = lapack.found() +if not have_lapack and not allow_noblas + error('No LAPACK library detected! Install one, or use the ' + \ + '`allow-noblas` build option (note, this may be up to 100x slower ' + \ + 'for some linear algebra operations).') +else + lapack_dep = declare_dependency(dependencies: [lapack, blas_dep]) endif + # Copy the main __init__.py|pxd files to the build dir (needed for Cython) __init__py = fs.copyfile('__init__.py') __init__pxd = fs.copyfile('__init__.pxd') @@ -162,7 +219,6 @@ python_sources = [ '_globals.py', '_pytesttester.py', '_pytesttester.pyi', - '_version.py', 'conftest.py', 'ctypeslib.py', 'ctypeslib.pyi', @@ -171,10 +227,13 @@ python_sources = [ 'dtypes.py', 'dtypes.pyi', 'matlib.py', - 'py.typed', - 'version.py' + 'py.typed' ] +if blas_name == 'scipy-openblas' + python_sources += ['_distributor_init_local.py'] +endif + py.install_sources( python_sources, subdir: 'numpy' @@ -187,15 +246,12 @@ src_file = generator(src_file_cli, ) tempita_cli = find_program('_build_utils/tempita.py') -tempita = generator(tempita_cli, - arguments : ['@INPUT@', '--outfile', '@OUTPUT@'], - output : '@BASENAME@' -) pure_subdirs = [ '_pyinstaller', '_typing', '_utils', + '_core', 'array_api', 'compat', 'doc', @@ -206,7 +262,7 @@ pure_subdirs = [ 'polynomial', 'testing', 'tests', - 'typing', + 'typing' ] if py.version().version_compare('<3.12') pure_subdirs += 'distutils' @@ -214,6 +270,30 @@ endif np_dir = py.get_install_dir() / 'numpy' +# Generate version.py for sdist +meson.add_dist_script( + ['_build_utils/gitversion.py', '--meson-dist', '--write', + 'numpy/version.py'] +) +if not fs.exists('version.py') + generate_version = custom_target( + 'generate-version', + install: true, + build_always_stale: true, + build_by_default: true, + output: 'version.py', + input: '_build_utils/gitversion.py', + command: [py, '@INPUT@', '--write', '@OUTPUT@'], + install_dir: np_dir + ) +else + # When building from sdist, version.py exists and should be included + py.install_sources( + ['version.py'], + subdir : 'numpy' + ) +endif + foreach subdir: pure_subdirs install_subdir(subdir, install_dir: np_dir) endforeach @@ -261,20 +341,31 @@ conf_data.set('CROSS_COMPILED', meson.is_cross_build()) conf_data.set('PYTHON_PATH', py.full_path()) conf_data.set('PYTHON_VERSION', py.language_version()) -# Dependencies information +# BLAS/LAPACK dependency info. Ensure we report dependencies correctly for +# `np.show_config()`; needs some special handling for the case BLAS was found +# but CBLAS not (and hence BLAS was also disabled) +dependency_map = { + 'LAPACK': lapack_dep, +} +if have_blas + dependency_map += {'BLAS': blas} +else + conf_data.set('BLAS_NAME', blas_name) + conf_data.set('BLAS_FOUND', false) +endif + + foreach name, dep : dependency_map conf_data.set(name + '_NAME', dep.name()) conf_data.set(name + '_FOUND', dep.found()) if dep.found() conf_data.set(name + '_VERSION', dep.version()) conf_data.set(name + '_TYPE_NAME', dep.type_name()) - if dep.type_name() == 'pkgconfig' - # CMake detection yields less info, so we need to leave it blank there - conf_data.set(name + '_INCLUDEDIR', dep.get_variable('includedir')) - conf_data.set(name + '_LIBDIR', dep.get_variable('libdir')) - conf_data.set(name + '_OPENBLAS_CONFIG', dep.get_variable('openblas_config')) - conf_data.set(name + '_PCFILEDIR', dep.get_variable('pcfiledir')) - endif + # get_variable() results may be missing for a variety of reasons + conf_data.set(name + '_INCLUDEDIR', dep.get_variable('includedir', default_value: 'unknown')) + conf_data.set(name + '_LIBDIR', dep.get_variable('libdir', default_value: 'unknown')) + conf_data.set(name + '_OPENBLAS_CONFIG', dep.get_variable('openblas_config', default_value: 'unknown')) + conf_data.set(name + '_PCFILEDIR', dep.get_variable('pcfiledir', default_value: 'unknown')) endif endforeach diff --git a/contrib/python/numpy/py3/numpy/random/_examples/cython/setup.py b/contrib/python/numpy/py3/numpy/random/_examples/cython/setup.py deleted file mode 100644 index e70a1fddca..0000000000 --- a/contrib/python/numpy/py3/numpy/random/_examples/cython/setup.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python3 -""" -Build the Cython demonstrations of low-level access to NumPy random - -Usage: python setup.py build_ext -i -""" -from os.path import dirname, join, abspath - -from setuptools import setup -from setuptools.extension import Extension - -import numpy as np -from Cython.Build import cythonize - - -path = dirname(__file__) -src_dir = join(dirname(path), '..', 'src') -defs = [('NPY_NO_DEPRECATED_API', 0)] -inc_path = np.get_include() -# Add paths for npyrandom and npymath libraries: -lib_path = [ - abspath(join(np.get_include(), '..', '..', 'random', 'lib')), - abspath(join(np.get_include(), '..', 'lib')) -] - -extending = Extension("extending", - sources=[join('.', 'extending.pyx')], - include_dirs=[ - np.get_include(), - join(path, '..', '..') - ], - define_macros=defs, - ) -distributions = Extension("extending_distributions", - sources=[join('.', 'extending_distributions.pyx')], - include_dirs=[inc_path], - library_dirs=lib_path, - libraries=['npyrandom', 'npymath'], - define_macros=defs, - ) - -extensions = [extending, distributions] - -setup( - ext_modules=cythonize(extensions) -) diff --git a/contrib/python/numpy/py3/numpy/random/_generator.pyx b/contrib/python/numpy/py3/numpy/random/_generator.pyx index a30d116c21..1bdba33565 100644 --- a/contrib/python/numpy/py3/numpy/random/_generator.pyx +++ b/contrib/python/numpy/py3/numpy/random/_generator.pyx @@ -1,5 +1,5 @@ #!python -#cython: wraparound=False, nonecheck=False, boundscheck=False, cdivision=True, language_level=3 +#cython: wraparound=False, nonecheck=False, boundscheck=False, cdivision=True, language_level=3, binding=False import operator import warnings from collections.abc import Sequence @@ -63,7 +63,7 @@ cdef int64_t _safe_sum_nonneg_int64(size_t num_colors, int64_t *colors): cdef inline void _shuffle_raw_wrap(bitgen_t *bitgen, np.npy_intp n, np.npy_intp first, np.npy_intp itemsize, np.npy_intp stride, - char* data, char* buf) nogil: + char* data, char* buf) noexcept nogil: # We trick gcc into providing a specialized implementation for # the most common case, yielding a ~33% performance improvement. # Note that apparently, only one branch can ever be specialized. @@ -76,7 +76,7 @@ cdef inline void _shuffle_raw_wrap(bitgen_t *bitgen, np.npy_intp n, cdef inline void _shuffle_raw(bitgen_t *bitgen, np.npy_intp n, np.npy_intp first, np.npy_intp itemsize, np.npy_intp stride, - char* data, char* buf) nogil: + char* data, char* buf) noexcept nogil: """ Parameters ---------- @@ -107,7 +107,7 @@ cdef inline void _shuffle_raw(bitgen_t *bitgen, np.npy_intp n, cdef inline void _shuffle_int(bitgen_t *bitgen, np.npy_intp n, - np.npy_intp first, int64_t* data) nogil: + np.npy_intp first, int64_t* data) noexcept nogil: """ Parameters ---------- @@ -277,7 +277,7 @@ cdef class Generator: >>> entropy = 0x3034c61a9ae04ff8cb62ab8ec2c4b501 >>> rng = np.random.default_rng(entropy) - Create two new generators for example for parallel executation: + Create two new generators for example for parallel execution: >>> child_rng1, child_rng2 = rng.spawn(2) @@ -3477,7 +3477,7 @@ cdef class Generator: # answer = 0.003 ... pretty unlikely! """ - DEF HYPERGEOM_MAX = 10**9 + cdef double HYPERGEOM_MAX = 10**9 cdef bint is_scalar = True cdef np.ndarray ongood, onbad, onsample cdef int64_t lngood, lnbad, lnsample @@ -4408,6 +4408,7 @@ cdef class Generator: np.NPY_ARRAY_ALIGNED | np.NPY_ARRAY_C_CONTIGUOUS) if np.any(np.less(alpha_arr, 0)): raise ValueError('alpha < 0') + alpha_data = <double*>np.PyArray_DATA(alpha_arr) if size is None: @@ -4467,17 +4468,23 @@ cdef class Generator: csum += alpha_data[j] alpha_csum_data[j] = csum - with self.lock, nogil: - while i < totsize: - acc = 1. - for j in range(k - 1): - v = random_beta(&self._bitgen, alpha_data[j], - alpha_csum_data[j + 1]) - val_data[i + j] = acc * v - acc *= (1. - v) - val_data[i + k - 1] = acc - i = i + k - + # If csum == 0, then all the values in alpha are 0, and there is + # nothing to do, because diric was created with np.zeros(). + if csum > 0: + with self.lock, nogil: + while i < totsize: + acc = 1. + for j in range(k - 1): + v = random_beta(&self._bitgen, alpha_data[j], + alpha_csum_data[j + 1]) + val_data[i + j] = acc * v + acc *= (1. - v) + if alpha_csum_data[j + 1] == 0: + # v must be 1, so acc is now 0. All + # remaining elements will be left at 0. + break + val_data[i + k - 1] = acc + i = i + k else: # Standard case: Unit normalisation of a vector of gamma random # variates diff --git a/contrib/python/numpy/py3/numpy/random/_mt19937.pyx b/contrib/python/numpy/py3/numpy/random/_mt19937.pyx index 8b991254aa..c3f9206a1e 100644 --- a/contrib/python/numpy/py3/numpy/random/_mt19937.pyx +++ b/contrib/python/numpy/py3/numpy/random/_mt19937.pyx @@ -1,3 +1,5 @@ +#cython: binding=False + import operator import numpy as np diff --git a/contrib/python/numpy/py3/numpy/random/_pcg64.pyx b/contrib/python/numpy/py3/numpy/random/_pcg64.pyx index f7891aa85b..75ffdddb7e 100644 --- a/contrib/python/numpy/py3/numpy/random/_pcg64.pyx +++ b/contrib/python/numpy/py3/numpy/random/_pcg64.pyx @@ -1,3 +1,5 @@ +#cython: binding=False + import numpy as np cimport numpy as np diff --git a/contrib/python/numpy/py3/numpy/random/_philox.pyx b/contrib/python/numpy/py3/numpy/random/_philox.pyx index e5353460c8..291f8224ac 100644 --- a/contrib/python/numpy/py3/numpy/random/_philox.pyx +++ b/contrib/python/numpy/py3/numpy/random/_philox.pyx @@ -1,3 +1,5 @@ +#cython: binding=False + from cpython.pycapsule cimport PyCapsule_New import numpy as np @@ -11,7 +13,7 @@ __all__ = ['Philox'] np.import_array() -DEF PHILOX_BUFFER_SIZE=4 +cdef int PHILOX_BUFFER_SIZE=4 cdef extern from 'src/philox/philox.h': struct s_r123array2x64: @@ -30,7 +32,7 @@ cdef extern from 'src/philox/philox.h': philox4x64_ctr_t *ctr philox4x64_key_t *key int buffer_pos - uint64_t buffer[PHILOX_BUFFER_SIZE] + uint64_t *buffer int has_uint32 uint32_t uinteger @@ -193,11 +195,13 @@ cdef class Philox(BitGenerator): self._bitgen.next_raw = &philox_uint64 cdef _reset_state_variables(self): - self.rng_state.has_uint32 = 0 - self.rng_state.uinteger = 0 - self.rng_state.buffer_pos = PHILOX_BUFFER_SIZE + cdef philox_state *rng_state = &self.rng_state + + rng_state[0].has_uint32 = 0 + rng_state[0].uinteger = 0 + rng_state[0].buffer_pos = PHILOX_BUFFER_SIZE for i in range(PHILOX_BUFFER_SIZE): - self.rng_state.buffer[i] = 0 + rng_state[0].buffer[i] = 0 @property def state(self): diff --git a/contrib/python/numpy/py3/numpy/random/_sfc64.pyx b/contrib/python/numpy/py3/numpy/random/_sfc64.pyx index 419045c1d3..2393979df6 100644 --- a/contrib/python/numpy/py3/numpy/random/_sfc64.pyx +++ b/contrib/python/numpy/py3/numpy/random/_sfc64.pyx @@ -1,3 +1,5 @@ +#cython: binding=False + import numpy as np cimport numpy as np diff --git a/contrib/python/numpy/py3/numpy/random/bit_generator.pyx b/contrib/python/numpy/py3/numpy/random/bit_generator.pyx index 83441747a3..9028cb65bf 100644 --- a/contrib/python/numpy/py3/numpy/random/bit_generator.pyx +++ b/contrib/python/numpy/py3/numpy/random/bit_generator.pyx @@ -1,3 +1,5 @@ +#cython: binding=False + """ BitGenerator base class and SeedSequence used to seed the BitGenerators. diff --git a/contrib/python/numpy/py3/numpy/random/meson.build b/contrib/python/numpy/py3/numpy/random/meson.build index c582428f96..1802cf4ef5 100644 --- a/contrib/python/numpy/py3/numpy/random/meson.build +++ b/contrib/python/numpy/py3/numpy/random/meson.build @@ -11,7 +11,6 @@ npyrandom_sources = [ npyrandom_lib = static_library('npyrandom', npyrandom_sources, c_args: staticlib_cflags, - # include_directories: '../core/include', dependencies: [py_dep, np_core_dep], install: true, install_dir: np_dir / 'random/lib', @@ -52,23 +51,26 @@ if host_machine.system() == 'cygwin' c_args_random += ['-Wl,--export-all-symbols'] endif -# name, sources, extra link libs, extra c_args +# name, sources, extra c_args, extra static libs to link random_pyx_sources = [ - ['_bounded_integers', _bounded_integers_pyx, [], npymath_lib], - ['_common', '_common.pyx', [], []], - ['_mt19937', ['_mt19937.pyx', 'src/mt19937/mt19937.c', 'src/mt19937/mt19937-jump.c'], [], []], - ['_philox', ['_philox.pyx', 'src/philox/philox.c'], [], []], - ['_pcg64', ['_pcg64.pyx', 'src/pcg64/pcg64.c'], ['-U__GNUC_GNU_INLINE__'], []], - ['_sfc64', ['_sfc64.pyx', 'src/sfc64/sfc64.c'], [], []], - ['bit_generator', 'bit_generator.pyx', [], []], + ['_bounded_integers', _bounded_integers_pyx, [], [npyrandom_lib, npymath_lib]], + ['_common', '_common.pyx', [], [npyrandom_lib]], + ['_mt19937', ['_mt19937.pyx', 'src/mt19937/mt19937.c', 'src/mt19937/mt19937-jump.c'], + [], [npyrandom_lib] + ], + ['_philox', ['_philox.pyx', 'src/philox/philox.c'], [], [npyrandom_lib]], + ['_pcg64', ['_pcg64.pyx', 'src/pcg64/pcg64.c'], ['-U__GNUC_GNU_INLINE__'], [npyrandom_lib]], + ['_sfc64', ['_sfc64.pyx', 'src/sfc64/sfc64.c'], [], [npyrandom_lib]], + ['bit_generator', 'bit_generator.pyx', [], [npyrandom_lib]], # The `fs.copyfile` usage here is needed because these two .pyx files import # from _bounded_integers,and its pxd file is only present in the build directory - ['_generator', fs.copyfile('_generator.pyx'), [], npymath_lib], + ['_generator', fs.copyfile('_generator.pyx'), [], [npyrandom_lib, npymath_lib]], ['mtrand', [ fs.copyfile('mtrand.pyx'), 'src/distributions/distributions.c', 'src/legacy/legacy-distributions.c' - ], ['-DNP_RANDOM_LEGACY=1'], npymath_lib, + ], + ['-DNP_RANDOM_LEGACY=1'], [npymath_lib], ], ] foreach gen: random_pyx_sources @@ -77,7 +79,7 @@ foreach gen: random_pyx_sources c_args: [c_args_random, gen[2]], include_directories: 'src', dependencies: np_core_dep, - link_with: [npyrandom_lib, gen[3]], + link_with: gen[3], install: true, subdir: 'numpy/random', ) @@ -153,7 +155,6 @@ py.install_sources( '_examples/cython/extending.pyx', '_examples/cython/extending_distributions.pyx', '_examples/cython/meson.build', - '_examples/cython/setup.py', ], subdir: 'numpy/random/_examples/cython' ) diff --git a/contrib/python/numpy/py3/numpy/random/mtrand.pyi b/contrib/python/numpy/py3/numpy/random/mtrand.pyi index 271cb97874..b5f600652b 100644 --- a/contrib/python/numpy/py3/numpy/random/mtrand.pyi +++ b/contrib/python/numpy/py3/numpy/random/mtrand.pyi @@ -1,3 +1,4 @@ +import builtins from collections.abc import Callable from typing import Any, Union, overload, Literal @@ -224,7 +225,7 @@ class RandomState: size: None | _ShapeLike = ..., dtype: dtype[uint] | type[uint] | _UIntCodes | _SupportsDType[dtype[uint]] = ..., ) -> ndarray[Any, dtype[uint]]: ... - def bytes(self, length: int) -> bytes: ... + def bytes(self, length: int) -> builtins.bytes: ... @overload def choice( self, diff --git a/contrib/python/numpy/py3/numpy/random/mtrand.pyx b/contrib/python/numpy/py3/numpy/random/mtrand.pyx index d14d081644..9ffaa572d8 100644 --- a/contrib/python/numpy/py3/numpy/random/mtrand.pyx +++ b/contrib/python/numpy/py3/numpy/random/mtrand.pyx @@ -1,5 +1,5 @@ #!python -#cython: wraparound=False, nonecheck=False, boundscheck=False, cdivision=True, language_level=3 +#cython: wraparound=False, nonecheck=False, boundscheck=False, cdivision=True, language_level=3, binding=False import operator import warnings from collections.abc import Sequence @@ -4253,7 +4253,7 @@ cdef class RandomState: x.shape = tuple(final_shape) return x - def multinomial(self, np.npy_intp n, object pvals, size=None): + def multinomial(self, long n, object pvals, size=None): """ multinomial(n, pvals, size=None) diff --git a/contrib/python/numpy/py3/numpy/random/src/distributions/distributions.c b/contrib/python/numpy/py3/numpy/random/src/distributions/distributions.c index cebeb07cf9..1241329151 100644 --- a/contrib/python/numpy/py3/numpy/random/src/distributions/distributions.c +++ b/contrib/python/numpy/py3/numpy/random/src/distributions/distributions.c @@ -403,11 +403,29 @@ float random_gamma_f(bitgen_t *bitgen_state, float shape, float scale) { return scale * random_standard_gamma_f(bitgen_state, shape); } +#define BETA_TINY_THRESHOLD 3e-103 + +/* + * Note: random_beta assumes that a != 0 and b != 0. + */ double random_beta(bitgen_t *bitgen_state, double a, double b) { double Ga, Gb; if ((a <= 1.0) && (b <= 1.0)) { double U, V, X, Y, XpY; + + if (a < BETA_TINY_THRESHOLD && b < BETA_TINY_THRESHOLD) { + /* + * When a and b are this small, the probability that the + * sample would be a double precision float that is not + * 0 or 1 is less than approx. 1e-100. So we use the + * proportion a/(a + b) and a single uniform sample to + * generate the result. + */ + U = next_double(bitgen_state); + return (a + b)*U < a; + } + /* Use Johnk's algorithm */ while (1) { @@ -417,8 +435,8 @@ double random_beta(bitgen_t *bitgen_state, double a, double b) { Y = pow(V, 1.0 / b); XpY = X + Y; /* Reject if both U and V are 0.0, which is approx 1 in 10^106 */ - if ((XpY <= 1.0) && (XpY > 0.0)) { - if (X + Y > 0) { + if ((XpY <= 1.0) && (U + V > 0.0)) { + if (XpY > 0) { return X / XpY; } else { double logX = log(U) / a; diff --git a/contrib/python/numpy/py3/numpy/random/src/mt19937/randomkit.h b/contrib/python/numpy/py3/numpy/random/src/mt19937/randomkit.h index abb082cb2e..5b933af2b2 100644 --- a/contrib/python/numpy/py3/numpy/random/src/mt19937/randomkit.h +++ b/contrib/python/numpy/py3/numpy/random/src/mt19937/randomkit.h @@ -177,7 +177,7 @@ extern void rk_random_uint8(npy_uint8 off, npy_uint8 rng, npy_intp cnt, /* * Fills an array with cnt random npy_bool between off and off + rng - * inclusive. It is assumed tha npy_bool as the same size as npy_uint8. + * inclusive. It is assumed that npy_bool is the same size as npy_uint8. */ extern void rk_random_bool(npy_bool off, npy_bool rng, npy_intp cnt, npy_bool *out, rk_state *state); diff --git a/contrib/python/numpy/py3/numpy/random/src/pcg64/pcg64.orig.h b/contrib/python/numpy/py3/numpy/random/src/pcg64/pcg64.orig.h index 74be91f31a..a1b31bf889 100644 --- a/contrib/python/numpy/py3/numpy/random/src/pcg64/pcg64.orig.h +++ b/contrib/python/numpy/py3/numpy/random/src/pcg64/pcg64.orig.h @@ -766,7 +766,7 @@ inline void pcg_setseq_128_srandom_r(struct pcg_state_setseq_128 *rng, * such as raw LCGs do better using a technique based on division.) * Empricical tests show that division is preferable to modulus for * reducting the range of an RNG. It's faster, and sometimes it can - * even be statistically prefereable. + * even be statistically preferable. */ /* Generation functions for XSH RS */ diff --git a/contrib/python/numpy/py3/numpy/random/tests/test_extending.py b/contrib/python/numpy/py3/numpy/random/tests/test_extending.py index 5ace080f1b..2783d1cdd9 100644 --- a/contrib/python/numpy/py3/numpy/random/tests/test_extending.py +++ b/contrib/python/numpy/py3/numpy/random/tests/test_extending.py @@ -1,13 +1,18 @@ +from importlib.util import spec_from_file_location, module_from_spec import os +import pathlib import pytest import shutil import subprocess import sys +import sysconfig +import textwrap import warnings + import numpy as np -from numpy.distutils.misc_util import exec_mod_from_location from numpy.testing import IS_WASM + try: import cffi except ImportError: @@ -38,30 +43,44 @@ else: # other fixes in the 0.29 series that are needed even for earlier # Python versions. # Note: keep in sync with the one in pyproject.toml - required_version = '0.29.30' + required_version = '0.29.35' if _pep440.parse(cython_version) < _pep440.Version(required_version): # too old or wrong cython, skip the test cython = None +@pytest.mark.skipif( + sys.platform == "win32" and sys.maxsize < 2**32, + reason="Failing in 32-bit Windows wheel build job, skip for now" +) @pytest.mark.skipif(IS_WASM, reason="Can't start subprocess") @pytest.mark.skipif(cython is None, reason="requires cython") @pytest.mark.slow def test_cython(tmp_path): + import glob + # build the examples in a temporary directory srcdir = os.path.join(os.path.dirname(__file__), '..') shutil.copytree(srcdir, tmp_path / 'random') - # build the examples and "install" them into a temporary directory build_dir = tmp_path / 'random' / '_examples' / 'cython' - subprocess.check_call([sys.executable, 'setup.py', 'build', 'install', - '--prefix', str(tmp_path / 'installdir'), - '--single-version-externally-managed', - '--record', str(tmp_path/ 'tmp_install_log.txt'), - ], - cwd=str(build_dir), - ) + target_dir = build_dir / "build" + os.makedirs(target_dir, exist_ok=True) + if sys.platform == "win32": + subprocess.check_call(["meson", "setup", + "--buildtype=release", + "--vsenv", str(build_dir)], + cwd=target_dir, + ) + else: + subprocess.check_call(["meson", "setup", str(build_dir)], + cwd=target_dir + ) + subprocess.check_call(["meson", "compile", "-vv"], cwd=target_dir) + # gh-16162: make sure numpy's __init__.pxd was used for cython # not really part of this test, but it is a convenient place to check - with open(build_dir / 'extending.c') as fid: + + g = glob.glob(str(target_dir / "*" / "extending.pyx.c")) + with open(g[0]) as fid: txt_to_find = 'NumPy API declarations from "numpy/__init__' for i, line in enumerate(fid): if txt_to_find in line: @@ -69,21 +88,21 @@ def test_cython(tmp_path): else: assert False, ("Could not find '{}' in C file, " "wrong pxd used".format(txt_to_find)) - # get the path to the so's - so1 = so2 = None - with open(tmp_path /'tmp_install_log.txt') as fid: - for line in fid: - if 'extending.' in line: - so1 = line.strip() - if 'extending_distributions' in line: - so2 = line.strip() - assert so1 is not None - assert so2 is not None - # import the so's without adding the directory to sys.path - exec_mod_from_location('extending', so1) - extending_distributions = exec_mod_from_location( - 'extending_distributions', so2) + # import without adding the directory to sys.path + suffix = sysconfig.get_config_var('EXT_SUFFIX') + + def load(modname): + so = (target_dir / modname).with_suffix(suffix) + spec = spec_from_file_location(modname, so) + mod = module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + # test that the module can be imported + load("extending") + load("extending_cpp") # actually test the cython c-extension + extending_distributions = load("extending_distributions") from numpy.random import PCG64 values = extending_distributions.uniforms_ex(PCG64(0), 10, 'd') assert values.shape == (10,) diff --git a/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937.py b/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937.py index 5c4c2cbf92..e744f5ba61 100644 --- a/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937.py +++ b/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937.py @@ -35,6 +35,7 @@ JUMP_TEST_DATA = [ }, ] + @pytest.fixture(scope='module', params=[True, False]) def endpoint(request): return request.param @@ -145,6 +146,7 @@ class TestMultinomial: with pytest.raises(ValueError, match=match): random.multinomial(1, pvals) + class TestMultivariateHypergeometric: def setup_method(self): @@ -644,7 +646,7 @@ class TestIntegers: sample = self.rfunc(lbnd, ubnd, endpoint=endpoint, dtype=dt) assert_equal(sample.dtype, dt) - for dt in (bool, int, np.compat.long): + for dt in (bool, int): lbnd = 0 if dt is bool else np.iinfo(dt).min ubnd = 2 if dt is bool else np.iinfo(dt).max + 1 ubnd = ubnd - 1 if endpoint else ubnd @@ -1238,6 +1240,25 @@ class TestRandomDist: sample_mean = sample.mean(axis=0) assert_allclose(sample_mean, exact_mean, rtol=1e-3) + # This set of parameters includes inputs with alpha.max() >= 0.1 and + # alpha.max() < 0.1 to exercise both generation methods within the + # dirichlet code. + @pytest.mark.parametrize( + 'alpha', + [[5, 9, 0, 8], + [0.5, 0, 0, 0], + [1, 5, 0, 0, 1.5, 0, 0, 0], + [0.01, 0.03, 0, 0.005], + [1e-5, 0, 0, 0], + [0.002, 0.015, 0, 0, 0.04, 0, 0, 0], + [0.0], + [0, 0, 0]], + ) + def test_dirichlet_multiple_zeros_in_alpha(self, alpha): + alpha = np.array(alpha) + y = random.dirichlet(alpha) + assert_equal(y[alpha == 0], 0.0) + def test_exponential(self): random = Generator(MT19937(self.seed)) actual = random.exponential(1.1234, size=(3, 2)) @@ -1467,7 +1488,7 @@ class TestRandomDist: mu, np.empty((3, 2))) assert_raises(ValueError, random.multivariate_normal, mu, np.eye(3)) - + @pytest.mark.parametrize('mean, cov', [([0], [[1+1j]]), ([0j], [[1]])]) def test_multivariate_normal_disallow_complex(self, mean, cov): random = Generator(MT19937(self.seed)) @@ -1847,7 +1868,6 @@ class TestBroadcast: def setup_method(self): self.seed = 123456789 - def test_uniform(self): random = Generator(MT19937(self.seed)) low = [0] diff --git a/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937_regressions.py b/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937_regressions.py index 7c2b6867c0..f16af2b293 100644 --- a/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937_regressions.py +++ b/contrib/python/numpy/py3/numpy/random/tests/test_generator_mt19937_regressions.py @@ -75,6 +75,17 @@ class TestRegression: x = self.mt19937.beta(0.0001, 0.0001, size=100) assert_(not np.any(np.isnan(x)), 'Nans in mt19937.beta') + def test_beta_very_small_parameters(self): + # gh-24203: beta would hang with very small parameters. + self.mt19937.beta(1e-49, 1e-40) + + def test_beta_ridiculously_small_parameters(self): + # gh-24266: beta would generate nan when the parameters + # were subnormal or a small multiple of the smallest normal. + tiny = np.finfo(1.0).tiny + x = self.mt19937.beta(tiny/32, tiny/40, size=50) + assert not np.any(np.isnan(x)) + def test_choice_sum_of_probs_tolerance(self): # The sum of probs should be 1.0 with some tolerance. # For low precision dtypes the tolerance was too tight. diff --git a/contrib/python/numpy/py3/numpy/random/tests/test_random.py b/contrib/python/numpy/py3/numpy/random/tests/test_random.py index 0f4e7925a5..e64ace7119 100644 --- a/contrib/python/numpy/py3/numpy/random/tests/test_random.py +++ b/contrib/python/numpy/py3/numpy/random/tests/test_random.py @@ -276,7 +276,7 @@ class TestRandint: sample = self.rfunc(lbnd, ubnd, dtype=dt) assert_equal(sample.dtype, np.dtype(dt)) - for dt in (bool, int, np.compat.long): + for dt in (bool, int): lbnd = 0 if dt is bool else np.iinfo(dt).min ubnd = 2 if dt is bool else np.iinfo(dt).max + 1 diff --git a/contrib/python/numpy/py3/numpy/random/tests/test_randomstate.py b/contrib/python/numpy/py3/numpy/random/tests/test_randomstate.py index 3a29610989..c77bfce883 100644 --- a/contrib/python/numpy/py3/numpy/random/tests/test_randomstate.py +++ b/contrib/python/numpy/py3/numpy/random/tests/test_randomstate.py @@ -183,6 +183,9 @@ class TestMultinomial: with pytest.raises(ValueError, match=match): random.multinomial(1, pvals) + def test_multinomial_n_float(self): + # Non-index integer types should gracefully truncate floats + random.multinomial(100.5, [0.2, 0.8]) class TestSetState: def setup_method(self): @@ -422,7 +425,7 @@ class TestRandint: sample = self.rfunc(lbnd, ubnd, dtype=dt) assert_equal(sample.dtype, np.dtype(dt)) - for dt in (bool, int, np.compat.long): + for dt in (bool, int): lbnd = 0 if dt is bool else np.iinfo(dt).min ubnd = 2 if dt is bool else np.iinfo(dt).max + 1 @@ -812,10 +815,6 @@ class TestRandomDist: alpha = np.array([5.4e-01, -1.0e-16]) assert_raises(ValueError, random.dirichlet, alpha) - def test_dirichlet_zero_alpha(self): - y = random.default_rng().dirichlet([5, 9, 0, 8]) - assert_equal(y[2], 0) - def test_dirichlet_alpha_non_contiguous(self): a = np.array([51.72840233779265162, -1.0, 39.74494232180943953]) alpha = a[::2] @@ -2061,6 +2060,7 @@ def test_randomstate_ctor_old_style_pickle(): assert_equal(state_a['has_gauss'], state_b['has_gauss']) assert_equal(state_a['gauss'], state_b['gauss']) + def test_hot_swap(restore_singleton_bitgen): # GH 21808 def_bg = np.random.default_rng(0) diff --git a/contrib/python/numpy/py3/numpy/setup.py b/contrib/python/numpy/py3/numpy/setup.py index b6f879bcca..536224a811 100644 --- a/contrib/python/numpy/py3/numpy/setup.py +++ b/contrib/python/numpy/py3/numpy/setup.py @@ -7,6 +7,7 @@ def configuration(parent_package='',top_path=None): config.add_subpackage('array_api') config.add_subpackage('compat') config.add_subpackage('core') + config.add_subpackage('_core') config.add_subpackage('distutils') config.add_subpackage('doc') config.add_subpackage('f2py') diff --git a/contrib/python/numpy/py3/numpy/testing/_private/extbuild.py b/contrib/python/numpy/py3/numpy/testing/_private/extbuild.py index 9b4e95366d..541f551151 100644 --- a/contrib/python/numpy/py3/numpy/testing/_private/extbuild.py +++ b/contrib/python/numpy/py3/numpy/testing/_private/extbuild.py @@ -6,8 +6,10 @@ See build_and_import_extensions for usage hints import os import pathlib +import subprocess import sys import sysconfig +import textwrap __all__ = ['build_and_import_extension', 'compile_extension_module'] @@ -51,8 +53,6 @@ def build_and_import_extension( >>> assert not mod.test_bytes(u'abc') >>> assert mod.test_bytes(b'abc') """ - from distutils.errors import CompileError - body = prologue + _make_methods(functions, modname) init = """PyObject *mod = PyModule_Create(&moduledef); """ @@ -67,7 +67,7 @@ def build_and_import_extension( try: mod_so = compile_extension_module( modname, build_dir, include_dirs, source_string) - except CompileError as e: + except Exception as e: # shorten the exception chain raise RuntimeError(f"could not compile in {build_dir}:") from e import importlib.util @@ -186,9 +186,9 @@ def _c_compile(cfile, outputfilename, include_dirs=[], libraries=[], elif sys.platform.startswith('linux'): compile_extra = [ "-O0", "-g", "-Werror=implicit-function-declaration", "-fPIC"] - link_extra = None + link_extra = [] else: - compile_extra = link_extra = None + compile_extra = link_extra = [] pass if sys.platform == 'win32': link_extra = link_extra + ['/DEBUG'] # generate .pdb file @@ -202,49 +202,46 @@ def _c_compile(cfile, outputfilename, include_dirs=[], libraries=[], library_dirs.append(s + 'lib') outputfilename = outputfilename.with_suffix(get_so_suffix()) - saved_environ = os.environ.copy() - try: - build( - cfile, outputfilename, - compile_extra, link_extra, - include_dirs, libraries, library_dirs) - finally: - # workaround for a distutils bugs where some env vars can - # become longer and longer every time it is used - for key, value in saved_environ.items(): - if os.environ.get(key) != value: - os.environ[key] = value + build( + cfile, outputfilename, + compile_extra, link_extra, + include_dirs, libraries, library_dirs) return outputfilename def build(cfile, outputfilename, compile_extra, link_extra, include_dirs, libraries, library_dirs): - "cd into the directory where the cfile is, use distutils to build" - from numpy.distutils.ccompiler import new_compiler - - compiler = new_compiler(force=1, verbose=2) - compiler.customize('') - objects = [] - - old = os.getcwd() - os.chdir(cfile.parent) - try: - res = compiler.compile( - [str(cfile.name)], - include_dirs=include_dirs, - extra_preargs=compile_extra + "use meson to build" + + build_dir = cfile.parent / "build" + os.makedirs(build_dir, exist_ok=True) + so_name = outputfilename.parts[-1] + with open(cfile.parent / "meson.build", "wt") as fid: + includes = ['-I' + d for d in include_dirs] + link_dirs = ['-L' + d for d in library_dirs] + fid.write(textwrap.dedent(f"""\ + project('foo', 'c') + shared_module('{so_name}', '{cfile.parts[-1]}', + c_args: {includes} + {compile_extra}, + link_args: {link_dirs} + {link_extra}, + link_with: {libraries}, + name_prefix: '', + name_suffix: 'dummy', ) - objects += [str(cfile.parent / r) for r in res] - finally: - os.chdir(old) - - compiler.link_shared_object( - objects, str(outputfilename), - libraries=libraries, - extra_preargs=link_extra, - library_dirs=library_dirs) - - + """)) + if sys.platform == "win32": + subprocess.check_call(["meson", "setup", + "--buildtype=release", + "--vsenv", ".."], + cwd=build_dir, + ) + else: + subprocess.check_call(["meson", "setup", "--vsenv", ".."], + cwd=build_dir + ) + subprocess.check_call(["meson", "compile"], cwd=build_dir) + os.rename(str(build_dir / so_name) + ".dummy", cfile.parent / so_name) + def get_so_suffix(): ret = sysconfig.get_config_var('EXT_SUFFIX') assert ret diff --git a/contrib/python/numpy/py3/numpy/testing/_private/utils.py b/contrib/python/numpy/py3/numpy/testing/_private/utils.py index 3c3d3412a2..28dd656c4a 100644 --- a/contrib/python/numpy/py3/numpy/testing/_private/utils.py +++ b/contrib/python/numpy/py3/numpy/testing/_private/utils.py @@ -22,7 +22,7 @@ import numpy as np from numpy.core import ( intp, float32, empty, arange, array_repr, ndarray, isnat, array) from numpy import isfinite, isnan, isinf -import numpy.linalg.lapack_lite +import numpy.linalg._umath_linalg from io import StringIO @@ -54,7 +54,7 @@ IS_WASM = platform.machine() in ["wasm32", "wasm64"] IS_PYPY = sys.implementation.name == 'pypy' IS_PYSTON = hasattr(sys, "pyston_version_info") HAS_REFCOUNT = getattr(sys, 'getrefcount', None) is not None and not IS_PYSTON -HAS_LAPACK64 = numpy.linalg.lapack_lite._ilp64 +HAS_LAPACK64 = numpy.linalg._umath_linalg._ilp64 _OLD_PROMOTION = lambda: np._get_promotion_state() == 'legacy' diff --git a/contrib/python/numpy/py3/numpy/testing/_private/utils.pyi b/contrib/python/numpy/py3/numpy/testing/_private/utils.pyi index 6e051e9141..6baefd83bd 100644 --- a/contrib/python/numpy/py3/numpy/testing/_private/utils.pyi +++ b/contrib/python/numpy/py3/numpy/testing/_private/utils.pyi @@ -20,7 +20,10 @@ from typing import ( Final, SupportsIndex, ) -from typing_extensions import ParamSpec +if sys.version_info >= (3, 10): + from typing import ParamSpec +else: + from typing_extensions import ParamSpec from numpy import generic, dtype, number, object_, bool_, _FloatValue from numpy._typing import ( diff --git a/contrib/python/numpy/py3/numpy/tests/test_ctypeslib.py b/contrib/python/numpy/py3/numpy/tests/test_ctypeslib.py index 1ea0837008..965e547e7c 100644 --- a/contrib/python/numpy/py3/numpy/tests/test_ctypeslib.py +++ b/contrib/python/numpy/py3/numpy/tests/test_ctypeslib.py @@ -1,11 +1,12 @@ import sys -import pytest +import sysconfig import weakref from pathlib import Path +import pytest + import numpy as np from numpy.ctypeslib import ndpointer, load_library, as_array -from numpy.distutils.misc_util import get_shared_lib_extension from numpy.testing import assert_, assert_array_equal, assert_raises, assert_equal try: @@ -52,12 +53,9 @@ class TestLoadLibrary: # Regression for #801: load_library with a full library name # (including extension) does not work. try: - try: - so = get_shared_lib_extension(is_python_ext=True) - # Should succeed - load_library('_multiarray_umath%s' % so, np.core._multiarray_umath.__file__) - except ImportError: - print("No distutils available, skipping test.") + so_ext = sysconfig.get_config_var('EXT_SUFFIX') + load_library('_multiarray_umath%s' % so_ext, + np.core._multiarray_umath.__file__) except ImportError as e: msg = ("ctypes is not available on this python: skipping the test" " (import error was: %s)" % str(e)) @@ -215,6 +213,10 @@ class TestAsArray: # shape argument is required assert_raises(TypeError, as_array, p) + @pytest.mark.skipif( + sys.version_info == (3, 12, 0, "candidate", 1), + reason="Broken in 3.12.0rc1, see gh-24399", + ) def test_struct_array_pointer(self): from ctypes import c_int16, Structure, pointer diff --git a/contrib/python/numpy/py3/numpy/tests/test_numpy_version.py b/contrib/python/numpy/py3/numpy/tests/test_numpy_version.py index bccbcb8e9c..61643426c8 100644 --- a/contrib/python/numpy/py3/numpy/tests/test_numpy_version.py +++ b/contrib/python/numpy/py3/numpy/tests/test_numpy_version.py @@ -24,12 +24,9 @@ from numpy.testing import assert_ def test_valid_numpy_version(): # Verify that the numpy version is a valid one (no .post suffix or other # nonsense). See gh-6431 for an issue caused by an invalid version. - version_pattern = r"^[0-9]+\.[0-9]+\.[0-9]+(a[0-9]|b[0-9]|rc[0-9]|)" - dev_suffix = r"(\.dev0|)(\+[0-9]*\.g[0-9a-f]+|)" - if np.version.release: - res = re.match(version_pattern + '$', np.__version__) - else: - res = re.match(version_pattern + dev_suffix + '$', np.__version__) + version_pattern = r"^[0-9]+\.[0-9]+\.[0-9]+(a[0-9]|b[0-9]|rc[0-9])?" + dev_suffix = r"(\.dev[0-9]+(\+git[0-9]+\.[0-9a-f]+)?)?" + res = re.match(version_pattern + dev_suffix + '$', np.__version__) assert_(res is not None, np.__version__) diff --git a/contrib/python/numpy/py3/numpy/tests/test_public_api.py b/contrib/python/numpy/py3/numpy/tests/test_public_api.py index 856167aee2..522a240fbf 100644 --- a/contrib/python/numpy/py3/numpy/tests/test_public_api.py +++ b/contrib/python/numpy/py3/numpy/tests/test_public_api.py @@ -129,12 +129,6 @@ PUBLIC_MODULES = ['numpy.' + s for s in [ "array_api", "array_api.linalg", "ctypeslib", - "distutils", - "distutils.cpuinfo", - "distutils.exec_command", - "distutils.misc_util", - "distutils.log", - "distutils.system_info", "doc", "doc.constants", "doc.ufuncs", @@ -165,8 +159,20 @@ PUBLIC_MODULES = ['numpy.' + s for s in [ "testing.overrides", "typing", "typing.mypy_plugin", - "version", + "version" # Should be removed for NumPy 2.0 ]] +if sys.version_info < (3, 12): + PUBLIC_MODULES += [ + 'numpy.' + s for s in [ + "distutils", + "distutils.cpuinfo", + "distutils.exec_command", + "distutils.misc_util", + "distutils.log", + "distutils.system_info", + ] + ] + PUBLIC_ALIASED_MODULES = [ @@ -195,62 +201,6 @@ PRIVATE_BUT_PRESENT_MODULES = ['numpy.' + s for s in [ "core.records", "core.shape_base", "core.umath", - "core.umath_tests", - "distutils.armccompiler", - "distutils.fujitsuccompiler", - "distutils.ccompiler", - 'distutils.ccompiler_opt', - "distutils.command", - "distutils.command.autodist", - "distutils.command.bdist_rpm", - "distutils.command.build", - "distutils.command.build_clib", - "distutils.command.build_ext", - "distutils.command.build_py", - "distutils.command.build_scripts", - "distutils.command.build_src", - "distutils.command.config", - "distutils.command.config_compiler", - "distutils.command.develop", - "distutils.command.egg_info", - "distutils.command.install", - "distutils.command.install_clib", - "distutils.command.install_data", - "distutils.command.install_headers", - "distutils.command.sdist", - "distutils.conv_template", - "distutils.core", - "distutils.extension", - "distutils.fcompiler", - "distutils.fcompiler.absoft", - "distutils.fcompiler.arm", - "distutils.fcompiler.compaq", - "distutils.fcompiler.environment", - "distutils.fcompiler.g95", - "distutils.fcompiler.gnu", - "distutils.fcompiler.hpux", - "distutils.fcompiler.ibm", - "distutils.fcompiler.intel", - "distutils.fcompiler.lahey", - "distutils.fcompiler.mips", - "distutils.fcompiler.nag", - "distutils.fcompiler.none", - "distutils.fcompiler.pathf95", - "distutils.fcompiler.pg", - "distutils.fcompiler.nv", - "distutils.fcompiler.sun", - "distutils.fcompiler.vast", - "distutils.fcompiler.fujitsu", - "distutils.from_template", - "distutils.intelccompiler", - "distutils.lib2def", - "distutils.line_endings", - "distutils.mingw32ccompiler", - "distutils.msvccompiler", - "distutils.npy_pkg_config", - "distutils.numpy_distribution", - "distutils.pathccompiler", - "distutils.unixccompiler", #"f2py.auxfuncs", #"f2py.capi_maps", #"f2py.cb_rules", @@ -292,6 +242,66 @@ PRIVATE_BUT_PRESENT_MODULES = ['numpy.' + s for s in [ "random.bit_generator", "testing.print_coercion_tables", ]] +if sys.version_info < (3, 12): + PRIVATE_BUT_PRESENT_MODULES += [ + 'numpy.' + s for s in [ + "distutils.armccompiler", + "distutils.fujitsuccompiler", + "distutils.ccompiler", + 'distutils.ccompiler_opt', + "distutils.command", + "distutils.command.autodist", + "distutils.command.bdist_rpm", + "distutils.command.build", + "distutils.command.build_clib", + "distutils.command.build_ext", + "distutils.command.build_py", + "distutils.command.build_scripts", + "distutils.command.build_src", + "distutils.command.config", + "distutils.command.config_compiler", + "distutils.command.develop", + "distutils.command.egg_info", + "distutils.command.install", + "distutils.command.install_clib", + "distutils.command.install_data", + "distutils.command.install_headers", + "distutils.command.sdist", + "distutils.conv_template", + "distutils.core", + "distutils.extension", + "distutils.fcompiler", + "distutils.fcompiler.absoft", + "distutils.fcompiler.arm", + "distutils.fcompiler.compaq", + "distutils.fcompiler.environment", + "distutils.fcompiler.g95", + "distutils.fcompiler.gnu", + "distutils.fcompiler.hpux", + "distutils.fcompiler.ibm", + "distutils.fcompiler.intel", + "distutils.fcompiler.lahey", + "distutils.fcompiler.mips", + "distutils.fcompiler.nag", + "distutils.fcompiler.none", + "distutils.fcompiler.pathf95", + "distutils.fcompiler.pg", + "distutils.fcompiler.nv", + "distutils.fcompiler.sun", + "distutils.fcompiler.vast", + "distutils.fcompiler.fujitsu", + "distutils.from_template", + "distutils.intelccompiler", + "distutils.lib2def", + "distutils.line_endings", + "distutils.mingw32ccompiler", + "distutils.msvccompiler", + "distutils.npy_pkg_config", + "distutils.numpy_distribution", + "distutils.pathccompiler", + "distutils.unixccompiler", + ] + ] def is_unexpected(name): @@ -325,10 +335,14 @@ SKIP_LIST = [ "numpy.core.code_generators.verify_c_api_version", "numpy.core.cversions", "numpy.core.generate_numpy_api", - "numpy.distutils.msvc9compiler", + "numpy.core.umath_tests", ] +if sys.version_info < (3, 12): + SKIP_LIST += ["numpy.distutils.msvc9compiler"] +# suppressing warnings from deprecated modules +@pytest.mark.filterwarnings("ignore:.*np.compat.*:DeprecationWarning") def test_all_modules_are_expected(): """ Test that we don't add anything that looks like a new public module by @@ -353,9 +367,6 @@ def test_all_modules_are_expected(): # below SKIP_LIST_2 = [ 'numpy.math', - 'numpy.distutils.log.sys', - 'numpy.distutils.log.logging', - 'numpy.distutils.log.warnings', 'numpy.doc.constants.re', 'numpy.doc.constants.textwrap', 'numpy.lib.emath', @@ -371,6 +382,12 @@ SKIP_LIST_2 = [ 'numpy.matlib.ctypeslib', 'numpy.matlib.ma', ] +if sys.version_info < (3, 12): + SKIP_LIST_2 += [ + 'numpy.distutils.log.sys', + 'numpy.distutils.log.logging', + 'numpy.distutils.log.warnings', + ] def test_all_modules_are_expected_2(): @@ -474,11 +491,7 @@ def test_api_importable(): @pytest.mark.xfail( - hasattr(np.__config__, "_built_with_meson"), - reason = "Meson does not yet support entry points via pyproject.toml", -) -@pytest.mark.xfail( - sysconfig.get_config_var("Py_DEBUG") is not None, + sysconfig.get_config_var("Py_DEBUG") not in (None, 0, "0"), reason=( "NumPy possibly built with `USE_DEBUG=True ./tools/travis-test.sh`, " "which does not expose the `array_api` entry point. " @@ -490,6 +503,11 @@ def test_array_api_entry_point(): Entry point for Array API implementation can be found with importlib and returns the numpy.array_api namespace. """ + # For a development install that did not go through meson-python, + # the entrypoint will not have been installed. So ensure this test fails + # only if numpy is inside site-packages. + numpy_in_sitepackages = sysconfig.get_path('platlib') in np.__file__ + eps = importlib.metadata.entry_points() try: xp_eps = eps.select(group="array_api") @@ -499,12 +517,19 @@ def test_array_api_entry_point(): # Array API entry points so that running this test in <=3.9 will # still work - see https://github.com/numpy/numpy/pull/19800. xp_eps = eps.get("array_api", []) - assert len(xp_eps) > 0, "No entry points for 'array_api' found" + if len(xp_eps) == 0: + if numpy_in_sitepackages: + msg = "No entry points for 'array_api' found" + raise AssertionError(msg) from None + return try: ep = next(ep for ep in xp_eps if ep.name == "numpy") except StopIteration: - raise AssertionError("'numpy' not in array_api entry points") from None + if numpy_in_sitepackages: + msg = "'numpy' not in array_api entry points" + raise AssertionError(msg) from None + return xp = ep.load() msg = ( diff --git a/contrib/python/numpy/py3/numpy/typing/mypy_plugin.py b/contrib/python/numpy/py3/numpy/typing/mypy_plugin.py index 1ffe74fa97..8ec9637016 100644 --- a/contrib/python/numpy/py3/numpy/typing/mypy_plugin.py +++ b/contrib/python/numpy/py3/numpy/typing/mypy_plugin.py @@ -75,8 +75,7 @@ def _get_precision_dict() -> dict[str, str]: def _get_extended_precision_list() -> list[str]: - extended_types = [np.ulonglong, np.longlong, np.longdouble, np.clongdouble] - extended_names = { + extended_names = [ "uint128", "uint256", "int128", @@ -89,8 +88,8 @@ def _get_extended_precision_list() -> list[str]: "complex192", "complex256", "complex512", - } - return [i.__name__ for i in extended_types if i.__name__ in extended_names] + ] + return [i for i in extended_names if hasattr(np, i)] def _get_c_intp_name() -> str: diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/fail/lib_polynomial.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/fail/lib_polynomial.pyi index ca02d7bde6..e51b6b58e3 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/fail/lib_polynomial.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/fail/lib_polynomial.pyi @@ -8,6 +8,11 @@ AR_U: npt.NDArray[np.str_] poly_obj: np.poly1d +np.polymul(AR_f8, AR_U) # E: incompatible type +np.polydiv(AR_f8, AR_U) # E: incompatible type + +5**poly_obj # E: No overload variant + np.polyint(AR_U) # E: incompatible type np.polyint(AR_f8, m=1j) # E: No overload variant @@ -22,8 +27,3 @@ np.polyfit(AR_f8, AR_f8, 1, cov="bob") # E: No overload variant np.polyval(AR_f8, AR_U) # E: incompatible type np.polyadd(AR_f8, AR_U) # E: incompatible type np.polysub(AR_f8, AR_U) # E: incompatible type -np.polymul(AR_f8, AR_U) # E: incompatible type -np.polydiv(AR_f8, AR_U) # E: incompatible type - -5**poly_obj # E: No overload variant -hash(poly_obj) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/fail/modules.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/fail/modules.pyi index 59e724f22b..c86627e0c8 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/fail/modules.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/fail/modules.pyi @@ -6,7 +6,7 @@ np.bob # E: Module has no attribute # Stdlib modules in the namespace by accident np.warnings # E: Module has no attribute np.sys # E: Module has no attribute -np.os # E: Module has no attribute +np.os # E: Module "numpy" does not explicitly export np.math # E: Module has no attribute # Public sub-modules that are not imported to their parent module by default; diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/fail/npyio.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/fail/npyio.pyi index c91b4c9cb8..1749a6847e 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/fail/npyio.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/fail/npyio.pyi @@ -13,13 +13,10 @@ AR_i8: npt.NDArray[np.int64] np.load(str_file) # E: incompatible type np.save(bytes_path, AR_i8) # E: incompatible type -np.save(str_file, AR_i8) # E: incompatible type np.savez(bytes_path, AR_i8) # E: incompatible type -np.savez(str_file, AR_i8) # E: incompatible type np.savez_compressed(bytes_path, AR_i8) # E: incompatible type -np.savez_compressed(str_file, AR_i8) # E: incompatible type np.loadtxt(bytes_path) # E: incompatible type diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/misc/extended_precision.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/misc/extended_precision.pyi index 1e495e4f3c..78d8d93c65 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/misc/extended_precision.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/misc/extended_precision.pyi @@ -1,17 +1,25 @@ +import sys + import numpy as np +from numpy._typing import _80Bit, _96Bit, _128Bit, _256Bit + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type -reveal_type(np.uint128()) -reveal_type(np.uint256()) +assert_type(np.uint128(), np.unsignedinteger[_128Bit]) +assert_type(np.uint256(), np.unsignedinteger[_256Bit]) -reveal_type(np.int128()) -reveal_type(np.int256()) +assert_type(np.int128(), np.signedinteger[_128Bit]) +assert_type(np.int256(), np.signedinteger[_256Bit]) -reveal_type(np.float80()) -reveal_type(np.float96()) -reveal_type(np.float128()) -reveal_type(np.float256()) +assert_type(np.float80(), np.floating[_80Bit]) +assert_type(np.float96(), np.floating[_96Bit]) +assert_type(np.float128(), np.floating[_128Bit]) +assert_type(np.float256(), np.floating[_256Bit]) -reveal_type(np.complex160()) -reveal_type(np.complex192()) -reveal_type(np.complex256()) -reveal_type(np.complex512()) +assert_type(np.complex160(), np.complexfloating[_80Bit, _80Bit]) +assert_type(np.complex192(), np.complexfloating[_96Bit, _96Bit]) +assert_type(np.complex256(), np.complexfloating[_128Bit, _128Bit]) +assert_type(np.complex512(), np.complexfloating[_256Bit, _256Bit]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/mypy.ini b/contrib/python/numpy/py3/numpy/typing/tests/data/mypy.ini index baad759bbd..1cc16e0396 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/mypy.ini +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/mypy.ini @@ -2,9 +2,4 @@ plugins = numpy.typing.mypy_plugin show_absolute_path = True implicit_reexport = False - -[mypy-numpy] -ignore_errors = True - -[mypy-numpy.*] -ignore_errors = True +pretty = True diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/pass/lib_utils.py b/contrib/python/numpy/py3/numpy/typing/tests/data/pass/lib_utils.py index 65640c2887..53a3e17432 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/pass/lib_utils.py +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/pass/lib_utils.py @@ -7,7 +7,10 @@ import numpy as np FILE = StringIO() AR = np.arange(10, dtype=np.float64) -def func(a: int) -> bool: ... + +def func(a: int) -> bool: + return True + np.deprecate(func) np.deprecate() diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/pass/modules.py b/contrib/python/numpy/py3/numpy/typing/tests/data/pass/modules.py index 9261874d56..f2d779e20e 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/pass/modules.py +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/pass/modules.py @@ -29,7 +29,6 @@ np.polynomial.polynomial np.__path__ np.__version__ -np.__git_version__ np.__all__ np.char.__all__ diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/pass/ufunc_config.py b/contrib/python/numpy/py3/numpy/typing/tests/data/pass/ufunc_config.py index 2d13142457..58dd3e550a 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/pass/ufunc_config.py +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/pass/ufunc_config.py @@ -2,18 +2,32 @@ import numpy as np -def func1(a: str, b: int) -> None: ... -def func2(a: str, b: int, c: float = ...) -> None: ... -def func3(a: str, b: int) -> int: ... + +def func1(a: str, b: int) -> None: + return None + + +def func2(a: str, b: int, c: float = 1.0) -> None: + return None + + +def func3(a: str, b: int) -> int: + return 0 + class Write1: - def write(self, a: str) -> None: ... + def write(self, a: str) -> None: + return None + class Write2: - def write(self, a: str, b: int = ...) -> None: ... + def write(self, a: str, b: int = 1) -> None: + return None + class Write3: - def write(self, a: str) -> int: ... + def write(self, a: str) -> int: + return 0 _err_default = np.geterr() diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arithmetic.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arithmetic.pyi index 0ca5e97729..6291fda6ce 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arithmetic.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arithmetic.pyi @@ -1,7 +1,14 @@ +import sys from typing import Any import numpy as np -from numpy._typing import NDArray, _128Bit +import numpy.typing as npt +from numpy._typing import _32Bit,_64Bit, _128Bit + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type # Can't directly import `np.float128` as it is not available on all platforms f16: np.floating[_128Bit] @@ -26,15 +33,15 @@ c = complex() f = float() i = int() -AR_b: np.ndarray[Any, np.dtype[np.bool_]] -AR_u: np.ndarray[Any, np.dtype[np.uint32]] -AR_i: np.ndarray[Any, np.dtype[np.int64]] -AR_f: np.ndarray[Any, np.dtype[np.float64]] -AR_c: np.ndarray[Any, np.dtype[np.complex128]] -AR_m: np.ndarray[Any, np.dtype[np.timedelta64]] -AR_M: np.ndarray[Any, np.dtype[np.datetime64]] -AR_O: np.ndarray[Any, np.dtype[np.object_]] -AR_number: NDArray[np.number[Any]] +AR_b: npt.NDArray[np.bool_] +AR_u: npt.NDArray[np.uint32] +AR_i: npt.NDArray[np.int64] +AR_f: npt.NDArray[np.float64] +AR_c: npt.NDArray[np.complex128] +AR_m: npt.NDArray[np.timedelta64] +AR_M: npt.NDArray[np.datetime64] +AR_O: npt.NDArray[np.object_] +AR_number: npt.NDArray[np.number[Any]] AR_LIKE_b: list[bool] AR_LIKE_u: list[np.uint32] @@ -47,480 +54,463 @@ AR_LIKE_O: list[np.object_] # Array subtraction -reveal_type(AR_number - AR_number) # E: ndarray[Any, dtype[number[Any]]] - -reveal_type(AR_b - AR_LIKE_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_b - AR_LIKE_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_b - AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_b - AR_LIKE_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_b - AR_LIKE_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_b - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_u - AR_b) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_LIKE_i - AR_b) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_f - AR_b) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_c - AR_b) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_m - AR_b) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_M - AR_b) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_LIKE_O - AR_b) # E: Any - -reveal_type(AR_u - AR_LIKE_b) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_u - AR_LIKE_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_u - AR_LIKE_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_u - AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_u - AR_LIKE_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_u - AR_LIKE_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_u - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b - AR_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_LIKE_u - AR_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_LIKE_i - AR_u) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_f - AR_u) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_c - AR_u) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_m - AR_u) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_M - AR_u) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_LIKE_O - AR_u) # E: Any - -reveal_type(AR_i - AR_LIKE_b) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_i - AR_LIKE_u) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_i - AR_LIKE_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_i - AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_i - AR_LIKE_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_i - AR_LIKE_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_i - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b - AR_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_u - AR_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_i - AR_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_f - AR_i) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_c - AR_i) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_m - AR_i) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_M - AR_i) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_LIKE_O - AR_i) # E: Any - -reveal_type(AR_f - AR_LIKE_b) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f - AR_LIKE_u) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f - AR_LIKE_i) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f - AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f - AR_LIKE_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_f - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b - AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_u - AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_i - AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_f - AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_c - AR_f) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_O - AR_f) # E: Any - -reveal_type(AR_c - AR_LIKE_b) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_c - AR_LIKE_u) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_c - AR_LIKE_i) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_c - AR_LIKE_f) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_c - AR_LIKE_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_c - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b - AR_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_u - AR_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_i - AR_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_f - AR_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_c - AR_c) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(AR_LIKE_O - AR_c) # E: Any - -reveal_type(AR_m - AR_LIKE_b) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_m - AR_LIKE_u) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_m - AR_LIKE_i) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_m - AR_LIKE_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_m - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b - AR_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_u - AR_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_i - AR_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_m - AR_m) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_M - AR_m) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_LIKE_O - AR_m) # E: Any - -reveal_type(AR_M - AR_LIKE_b) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_M - AR_LIKE_u) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_M - AR_LIKE_i) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_M - AR_LIKE_m) # E: ndarray[Any, dtype[datetime64]] -reveal_type(AR_M - AR_LIKE_M) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_M - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_M - AR_M) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_O - AR_M) # E: Any - -reveal_type(AR_O - AR_LIKE_b) # E: Any -reveal_type(AR_O - AR_LIKE_u) # E: Any -reveal_type(AR_O - AR_LIKE_i) # E: Any -reveal_type(AR_O - AR_LIKE_f) # E: Any -reveal_type(AR_O - AR_LIKE_c) # E: Any -reveal_type(AR_O - AR_LIKE_m) # E: Any -reveal_type(AR_O - AR_LIKE_M) # E: Any -reveal_type(AR_O - AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b - AR_O) # E: Any -reveal_type(AR_LIKE_u - AR_O) # E: Any -reveal_type(AR_LIKE_i - AR_O) # E: Any -reveal_type(AR_LIKE_f - AR_O) # E: Any -reveal_type(AR_LIKE_c - AR_O) # E: Any -reveal_type(AR_LIKE_m - AR_O) # E: Any -reveal_type(AR_LIKE_M - AR_O) # E: Any -reveal_type(AR_LIKE_O - AR_O) # E: Any +assert_type(AR_number - AR_number, npt.NDArray[np.number[Any]]) + +assert_type(AR_b - AR_LIKE_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_b - AR_LIKE_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_b - AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_b - AR_LIKE_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_b - AR_LIKE_m, npt.NDArray[np.timedelta64]) +assert_type(AR_b - AR_LIKE_O, Any) + +assert_type(AR_LIKE_u - AR_b, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_LIKE_i - AR_b, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_f - AR_b, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_c - AR_b, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_m - AR_b, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_M - AR_b, npt.NDArray[np.datetime64]) +assert_type(AR_LIKE_O - AR_b, Any) + +assert_type(AR_u - AR_LIKE_b, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_u - AR_LIKE_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_u - AR_LIKE_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_u - AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_u - AR_LIKE_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_u - AR_LIKE_m, npt.NDArray[np.timedelta64]) +assert_type(AR_u - AR_LIKE_O, Any) + +assert_type(AR_LIKE_b - AR_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_LIKE_u - AR_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_LIKE_i - AR_u, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_f - AR_u, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_c - AR_u, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_m - AR_u, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_M - AR_u, npt.NDArray[np.datetime64]) +assert_type(AR_LIKE_O - AR_u, Any) + +assert_type(AR_i - AR_LIKE_b, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_i - AR_LIKE_u, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_i - AR_LIKE_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_i - AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_i - AR_LIKE_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_i - AR_LIKE_m, npt.NDArray[np.timedelta64]) +assert_type(AR_i - AR_LIKE_O, Any) + +assert_type(AR_LIKE_b - AR_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_u - AR_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_i - AR_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_f - AR_i, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_c - AR_i, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_m - AR_i, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_M - AR_i, npt.NDArray[np.datetime64]) +assert_type(AR_LIKE_O - AR_i, Any) + +assert_type(AR_f - AR_LIKE_b, npt.NDArray[np.floating[Any]]) +assert_type(AR_f - AR_LIKE_u, npt.NDArray[np.floating[Any]]) +assert_type(AR_f - AR_LIKE_i, npt.NDArray[np.floating[Any]]) +assert_type(AR_f - AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_f - AR_LIKE_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_f - AR_LIKE_O, Any) + +assert_type(AR_LIKE_b - AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_u - AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_i - AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_f - AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_c - AR_f, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_O - AR_f, Any) + +assert_type(AR_c - AR_LIKE_b, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_c - AR_LIKE_u, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_c - AR_LIKE_i, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_c - AR_LIKE_f, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_c - AR_LIKE_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_c - AR_LIKE_O, Any) + +assert_type(AR_LIKE_b - AR_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_u - AR_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_i - AR_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_f - AR_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_c - AR_c, npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(AR_LIKE_O - AR_c, Any) + +assert_type(AR_m - AR_LIKE_b, npt.NDArray[np.timedelta64]) +assert_type(AR_m - AR_LIKE_u, npt.NDArray[np.timedelta64]) +assert_type(AR_m - AR_LIKE_i, npt.NDArray[np.timedelta64]) +assert_type(AR_m - AR_LIKE_m, npt.NDArray[np.timedelta64]) +assert_type(AR_m - AR_LIKE_O, Any) + +assert_type(AR_LIKE_b - AR_m, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_u - AR_m, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_i - AR_m, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_m - AR_m, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_M - AR_m, npt.NDArray[np.datetime64]) +assert_type(AR_LIKE_O - AR_m, Any) + +assert_type(AR_M - AR_LIKE_b, npt.NDArray[np.datetime64]) +assert_type(AR_M - AR_LIKE_u, npt.NDArray[np.datetime64]) +assert_type(AR_M - AR_LIKE_i, npt.NDArray[np.datetime64]) +assert_type(AR_M - AR_LIKE_m, npt.NDArray[np.datetime64]) +assert_type(AR_M - AR_LIKE_M, npt.NDArray[np.timedelta64]) +assert_type(AR_M - AR_LIKE_O, Any) + +assert_type(AR_LIKE_M - AR_M, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_O - AR_M, Any) + +assert_type(AR_O - AR_LIKE_b, Any) +assert_type(AR_O - AR_LIKE_u, Any) +assert_type(AR_O - AR_LIKE_i, Any) +assert_type(AR_O - AR_LIKE_f, Any) +assert_type(AR_O - AR_LIKE_c, Any) +assert_type(AR_O - AR_LIKE_m, Any) +assert_type(AR_O - AR_LIKE_M, Any) +assert_type(AR_O - AR_LIKE_O, Any) + +assert_type(AR_LIKE_b - AR_O, Any) +assert_type(AR_LIKE_u - AR_O, Any) +assert_type(AR_LIKE_i - AR_O, Any) +assert_type(AR_LIKE_f - AR_O, Any) +assert_type(AR_LIKE_c - AR_O, Any) +assert_type(AR_LIKE_m - AR_O, Any) +assert_type(AR_LIKE_M - AR_O, Any) +assert_type(AR_LIKE_O - AR_O, Any) # Array floor division -reveal_type(AR_b // AR_LIKE_b) # E: ndarray[Any, dtype[{int8}]] -reveal_type(AR_b // AR_LIKE_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_b // AR_LIKE_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_b // AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_b // AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b // AR_b) # E: ndarray[Any, dtype[{int8}]] -reveal_type(AR_LIKE_u // AR_b) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_LIKE_i // AR_b) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_f // AR_b) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_O // AR_b) # E: Any - -reveal_type(AR_u // AR_LIKE_b) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_u // AR_LIKE_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_u // AR_LIKE_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_u // AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_u // AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b // AR_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_LIKE_u // AR_u) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(AR_LIKE_i // AR_u) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_f // AR_u) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_m // AR_u) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_O // AR_u) # E: Any - -reveal_type(AR_i // AR_LIKE_b) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_i // AR_LIKE_u) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_i // AR_LIKE_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_i // AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_i // AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b // AR_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_u // AR_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_i // AR_i) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(AR_LIKE_f // AR_i) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_m // AR_i) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_O // AR_i) # E: Any - -reveal_type(AR_f // AR_LIKE_b) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f // AR_LIKE_u) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f // AR_LIKE_i) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f // AR_LIKE_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_f // AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b // AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_u // AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_i // AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_f // AR_f) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(AR_LIKE_m // AR_f) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_LIKE_O // AR_f) # E: Any - -reveal_type(AR_m // AR_LIKE_u) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_m // AR_LIKE_i) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_m // AR_LIKE_f) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(AR_m // AR_LIKE_m) # E: ndarray[Any, dtype[{int64}]] -reveal_type(AR_m // AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_m // AR_m) # E: ndarray[Any, dtype[{int64}]] -reveal_type(AR_LIKE_O // AR_m) # E: Any - -reveal_type(AR_O // AR_LIKE_b) # E: Any -reveal_type(AR_O // AR_LIKE_u) # E: Any -reveal_type(AR_O // AR_LIKE_i) # E: Any -reveal_type(AR_O // AR_LIKE_f) # E: Any -reveal_type(AR_O // AR_LIKE_m) # E: Any -reveal_type(AR_O // AR_LIKE_M) # E: Any -reveal_type(AR_O // AR_LIKE_O) # E: Any - -reveal_type(AR_LIKE_b // AR_O) # E: Any -reveal_type(AR_LIKE_u // AR_O) # E: Any -reveal_type(AR_LIKE_i // AR_O) # E: Any -reveal_type(AR_LIKE_f // AR_O) # E: Any -reveal_type(AR_LIKE_m // AR_O) # E: Any -reveal_type(AR_LIKE_M // AR_O) # E: Any -reveal_type(AR_LIKE_O // AR_O) # E: Any +assert_type(AR_b // AR_LIKE_b, npt.NDArray[np.int8]) +assert_type(AR_b // AR_LIKE_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_b // AR_LIKE_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_b // AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_b // AR_LIKE_O, Any) + +assert_type(AR_LIKE_b // AR_b, npt.NDArray[np.int8]) +assert_type(AR_LIKE_u // AR_b, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_LIKE_i // AR_b, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_f // AR_b, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_O // AR_b, Any) + +assert_type(AR_u // AR_LIKE_b, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_u // AR_LIKE_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_u // AR_LIKE_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_u // AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_u // AR_LIKE_O, Any) + +assert_type(AR_LIKE_b // AR_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_LIKE_u // AR_u, npt.NDArray[np.unsignedinteger[Any]]) +assert_type(AR_LIKE_i // AR_u, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_f // AR_u, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_m // AR_u, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_O // AR_u, Any) + +assert_type(AR_i // AR_LIKE_b, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_i // AR_LIKE_u, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_i // AR_LIKE_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_i // AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_i // AR_LIKE_O, Any) + +assert_type(AR_LIKE_b // AR_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_u // AR_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_i // AR_i, npt.NDArray[np.signedinteger[Any]]) +assert_type(AR_LIKE_f // AR_i, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_m // AR_i, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_O // AR_i, Any) + +assert_type(AR_f // AR_LIKE_b, npt.NDArray[np.floating[Any]]) +assert_type(AR_f // AR_LIKE_u, npt.NDArray[np.floating[Any]]) +assert_type(AR_f // AR_LIKE_i, npt.NDArray[np.floating[Any]]) +assert_type(AR_f // AR_LIKE_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_f // AR_LIKE_O, Any) + +assert_type(AR_LIKE_b // AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_u // AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_i // AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_f // AR_f, npt.NDArray[np.floating[Any]]) +assert_type(AR_LIKE_m // AR_f, npt.NDArray[np.timedelta64]) +assert_type(AR_LIKE_O // AR_f, Any) + +assert_type(AR_m // AR_LIKE_u, npt.NDArray[np.timedelta64]) +assert_type(AR_m // AR_LIKE_i, npt.NDArray[np.timedelta64]) +assert_type(AR_m // AR_LIKE_f, npt.NDArray[np.timedelta64]) +assert_type(AR_m // AR_LIKE_m, npt.NDArray[np.int64]) +assert_type(AR_m // AR_LIKE_O, Any) + +assert_type(AR_LIKE_m // AR_m, npt.NDArray[np.int64]) +assert_type(AR_LIKE_O // AR_m, Any) + +assert_type(AR_O // AR_LIKE_b, Any) +assert_type(AR_O // AR_LIKE_u, Any) +assert_type(AR_O // AR_LIKE_i, Any) +assert_type(AR_O // AR_LIKE_f, Any) +assert_type(AR_O // AR_LIKE_m, Any) +assert_type(AR_O // AR_LIKE_M, Any) +assert_type(AR_O // AR_LIKE_O, Any) + +assert_type(AR_LIKE_b // AR_O, Any) +assert_type(AR_LIKE_u // AR_O, Any) +assert_type(AR_LIKE_i // AR_O, Any) +assert_type(AR_LIKE_f // AR_O, Any) +assert_type(AR_LIKE_m // AR_O, Any) +assert_type(AR_LIKE_M // AR_O, Any) +assert_type(AR_LIKE_O // AR_O, Any) # unary ops -reveal_type(-f16) # E: {float128} -reveal_type(-c16) # E: {complex128} -reveal_type(-c8) # E: {complex64} -reveal_type(-f8) # E: {float64} -reveal_type(-f4) # E: {float32} -reveal_type(-i8) # E: {int64} -reveal_type(-i4) # E: {int32} -reveal_type(-u8) # E: {uint64} -reveal_type(-u4) # E: {uint32} -reveal_type(-td) # E: timedelta64 -reveal_type(-AR_f) # E: Any - -reveal_type(+f16) # E: {float128} -reveal_type(+c16) # E: {complex128} -reveal_type(+c8) # E: {complex64} -reveal_type(+f8) # E: {float64} -reveal_type(+f4) # E: {float32} -reveal_type(+i8) # E: {int64} -reveal_type(+i4) # E: {int32} -reveal_type(+u8) # E: {uint64} -reveal_type(+u4) # E: {uint32} -reveal_type(+td) # E: timedelta64 -reveal_type(+AR_f) # E: Any - -reveal_type(abs(f16)) # E: {float128} -reveal_type(abs(c16)) # E: {float64} -reveal_type(abs(c8)) # E: {float32} -reveal_type(abs(f8)) # E: {float64} -reveal_type(abs(f4)) # E: {float32} -reveal_type(abs(i8)) # E: {int64} -reveal_type(abs(i4)) # E: {int32} -reveal_type(abs(u8)) # E: {uint64} -reveal_type(abs(u4)) # E: {uint32} -reveal_type(abs(td)) # E: timedelta64 -reveal_type(abs(b_)) # E: bool_ -reveal_type(abs(AR_f)) # E: Any +assert_type(-f16, np.floating[_128Bit]) +assert_type(-c16, np.complex128) +assert_type(-c8, np.complex64) +assert_type(-f8, np.float64) +assert_type(-f4, np.float32) +assert_type(-i8, np.int64) +assert_type(-i4, np.int32) +assert_type(-u8, np.uint64) +assert_type(-u4, np.uint32) +assert_type(-td, np.timedelta64) +assert_type(-AR_f, npt.NDArray[np.float64]) + +assert_type(+f16, np.floating[_128Bit]) +assert_type(+c16, np.complex128) +assert_type(+c8, np.complex64) +assert_type(+f8, np.float64) +assert_type(+f4, np.float32) +assert_type(+i8, np.int64) +assert_type(+i4, np.int32) +assert_type(+u8, np.uint64) +assert_type(+u4, np.uint32) +assert_type(+td, np.timedelta64) +assert_type(+AR_f, npt.NDArray[np.float64]) + +assert_type(abs(f16), np.floating[_128Bit]) +assert_type(abs(c16), np.float64) +assert_type(abs(c8), np.float32) +assert_type(abs(f8), np.float64) +assert_type(abs(f4), np.float32) +assert_type(abs(i8), np.int64) +assert_type(abs(i4), np.int32) +assert_type(abs(u8), np.uint64) +assert_type(abs(u4), np.uint32) +assert_type(abs(td), np.timedelta64) +assert_type(abs(b_), np.bool_) # Time structures -reveal_type(dt + td) # E: datetime64 -reveal_type(dt + i) # E: datetime64 -reveal_type(dt + i4) # E: datetime64 -reveal_type(dt + i8) # E: datetime64 -reveal_type(dt - dt) # E: timedelta64 -reveal_type(dt - i) # E: datetime64 -reveal_type(dt - i4) # E: datetime64 -reveal_type(dt - i8) # E: datetime64 - -reveal_type(td + td) # E: timedelta64 -reveal_type(td + i) # E: timedelta64 -reveal_type(td + i4) # E: timedelta64 -reveal_type(td + i8) # E: timedelta64 -reveal_type(td - td) # E: timedelta64 -reveal_type(td - i) # E: timedelta64 -reveal_type(td - i4) # E: timedelta64 -reveal_type(td - i8) # E: timedelta64 -reveal_type(td / f) # E: timedelta64 -reveal_type(td / f4) # E: timedelta64 -reveal_type(td / f8) # E: timedelta64 -reveal_type(td / td) # E: {float64} -reveal_type(td // td) # E: {int64} +assert_type(dt + td, np.datetime64) +assert_type(dt + i, np.datetime64) +assert_type(dt + i4, np.datetime64) +assert_type(dt + i8, np.datetime64) +assert_type(dt - dt, np.timedelta64) +assert_type(dt - i, np.datetime64) +assert_type(dt - i4, np.datetime64) +assert_type(dt - i8, np.datetime64) + +assert_type(td + td, np.timedelta64) +assert_type(td + i, np.timedelta64) +assert_type(td + i4, np.timedelta64) +assert_type(td + i8, np.timedelta64) +assert_type(td - td, np.timedelta64) +assert_type(td - i, np.timedelta64) +assert_type(td - i4, np.timedelta64) +assert_type(td - i8, np.timedelta64) +assert_type(td / f, np.timedelta64) +assert_type(td / f4, np.timedelta64) +assert_type(td / f8, np.timedelta64) +assert_type(td / td, np.float64) +assert_type(td // td, np.int64) # boolean -reveal_type(b_ / b) # E: {float64} -reveal_type(b_ / b_) # E: {float64} -reveal_type(b_ / i) # E: {float64} -reveal_type(b_ / i8) # E: {float64} -reveal_type(b_ / i4) # E: {float64} -reveal_type(b_ / u8) # E: {float64} -reveal_type(b_ / u4) # E: {float64} -reveal_type(b_ / f) # E: {float64} -reveal_type(b_ / f16) # E: {float128} -reveal_type(b_ / f8) # E: {float64} -reveal_type(b_ / f4) # E: {float32} -reveal_type(b_ / c) # E: {complex128} -reveal_type(b_ / c16) # E: {complex128} -reveal_type(b_ / c8) # E: {complex64} - -reveal_type(b / b_) # E: {float64} -reveal_type(b_ / b_) # E: {float64} -reveal_type(i / b_) # E: {float64} -reveal_type(i8 / b_) # E: {float64} -reveal_type(i4 / b_) # E: {float64} -reveal_type(u8 / b_) # E: {float64} -reveal_type(u4 / b_) # E: {float64} -reveal_type(f / b_) # E: {float64} -reveal_type(f16 / b_) # E: {float128} -reveal_type(f8 / b_) # E: {float64} -reveal_type(f4 / b_) # E: {float32} -reveal_type(c / b_) # E: {complex128} -reveal_type(c16 / b_) # E: {complex128} -reveal_type(c8 / b_) # E: {complex64} +assert_type(b_ / b, np.float64) +assert_type(b_ / b_, np.float64) +assert_type(b_ / i, np.float64) +assert_type(b_ / i8, np.float64) +assert_type(b_ / i4, np.float64) +assert_type(b_ / u8, np.float64) +assert_type(b_ / u4, np.float64) +assert_type(b_ / f, np.float64) +assert_type(b_ / f16, np.floating[_128Bit]) +assert_type(b_ / f8, np.float64) +assert_type(b_ / f4, np.float32) +assert_type(b_ / c, np.complex128) +assert_type(b_ / c16, np.complex128) +assert_type(b_ / c8, np.complex64) + +assert_type(b / b_, np.float64) +assert_type(b_ / b_, np.float64) +assert_type(i / b_, np.float64) +assert_type(i8 / b_, np.float64) +assert_type(i4 / b_, np.float64) +assert_type(u8 / b_, np.float64) +assert_type(u4 / b_, np.float64) +assert_type(f / b_, np.float64) +assert_type(f16 / b_, np.floating[_128Bit]) +assert_type(f8 / b_, np.float64) +assert_type(f4 / b_, np.float32) +assert_type(c / b_, np.complex128) +assert_type(c16 / b_, np.complex128) +assert_type(c8 / b_, np.complex64) # Complex -reveal_type(c16 + f16) # E: {complex256} -reveal_type(c16 + c16) # E: {complex128} -reveal_type(c16 + f8) # E: {complex128} -reveal_type(c16 + i8) # E: {complex128} -reveal_type(c16 + c8) # E: {complex128} -reveal_type(c16 + f4) # E: {complex128} -reveal_type(c16 + i4) # E: {complex128} -reveal_type(c16 + b_) # E: {complex128} -reveal_type(c16 + b) # E: {complex128} -reveal_type(c16 + c) # E: {complex128} -reveal_type(c16 + f) # E: {complex128} -reveal_type(c16 + i) # E: {complex128} -reveal_type(c16 + AR_f) # E: Any - -reveal_type(f16 + c16) # E: {complex256} -reveal_type(c16 + c16) # E: {complex128} -reveal_type(f8 + c16) # E: {complex128} -reveal_type(i8 + c16) # E: {complex128} -reveal_type(c8 + c16) # E: {complex128} -reveal_type(f4 + c16) # E: {complex128} -reveal_type(i4 + c16) # E: {complex128} -reveal_type(b_ + c16) # E: {complex128} -reveal_type(b + c16) # E: {complex128} -reveal_type(c + c16) # E: {complex128} -reveal_type(f + c16) # E: {complex128} -reveal_type(i + c16) # E: {complex128} -reveal_type(AR_f + c16) # E: Any - -reveal_type(c8 + f16) # E: {complex256} -reveal_type(c8 + c16) # E: {complex128} -reveal_type(c8 + f8) # E: {complex128} -reveal_type(c8 + i8) # E: {complex128} -reveal_type(c8 + c8) # E: {complex64} -reveal_type(c8 + f4) # E: {complex64} -reveal_type(c8 + i4) # E: {complex64} -reveal_type(c8 + b_) # E: {complex64} -reveal_type(c8 + b) # E: {complex64} -reveal_type(c8 + c) # E: {complex128} -reveal_type(c8 + f) # E: {complex128} -reveal_type(c8 + i) # E: complexfloating[{_NBitInt}, {_NBitInt}] -reveal_type(c8 + AR_f) # E: Any - -reveal_type(f16 + c8) # E: {complex256} -reveal_type(c16 + c8) # E: {complex128} -reveal_type(f8 + c8) # E: {complex128} -reveal_type(i8 + c8) # E: {complex128} -reveal_type(c8 + c8) # E: {complex64} -reveal_type(f4 + c8) # E: {complex64} -reveal_type(i4 + c8) # E: {complex64} -reveal_type(b_ + c8) # E: {complex64} -reveal_type(b + c8) # E: {complex64} -reveal_type(c + c8) # E: {complex128} -reveal_type(f + c8) # E: {complex128} -reveal_type(i + c8) # E: complexfloating[{_NBitInt}, {_NBitInt}] -reveal_type(AR_f + c8) # E: Any +assert_type(c16 + f16, np.complexfloating[_64Bit | _128Bit, _64Bit | _128Bit]) +assert_type(c16 + c16, np.complex128) +assert_type(c16 + f8, np.complex128) +assert_type(c16 + i8, np.complex128) +assert_type(c16 + c8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c16 + f4, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c16 + i4, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c16 + b_, np.complex128) +assert_type(c16 + b, np.complex128) +assert_type(c16 + c, np.complex128) +assert_type(c16 + f, np.complex128) +assert_type(c16 + AR_f, npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(f16 + c16, np.complexfloating[_64Bit | _128Bit, _64Bit | _128Bit]) +assert_type(c16 + c16, np.complex128) +assert_type(f8 + c16, np.complex128) +assert_type(i8 + c16, np.complex128) +assert_type(c8 + c16, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(f4 + c16, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(i4 + c16, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(b_ + c16, np.complex128) +assert_type(b + c16, np.complex128) +assert_type(c + c16, np.complex128) +assert_type(f + c16, np.complex128) +assert_type(AR_f + c16, npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(c8 + f16, np.complexfloating[_32Bit | _128Bit, _32Bit | _128Bit]) +assert_type(c8 + c16, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c8 + f8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c8 + i8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c8 + c8, np.complex64) +assert_type(c8 + f4, np.complex64) +assert_type(c8 + i4, np.complex64) +assert_type(c8 + b_, np.complex64) +assert_type(c8 + b, np.complex64) +assert_type(c8 + c, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c8 + f, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c8 + AR_f, npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(f16 + c8, np.complexfloating[_32Bit | _128Bit, _32Bit | _128Bit]) +assert_type(c16 + c8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(f8 + c8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(i8 + c8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(c8 + c8, np.complex64) +assert_type(f4 + c8, np.complex64) +assert_type(i4 + c8, np.complex64) +assert_type(b_ + c8, np.complex64) +assert_type(b + c8, np.complex64) +assert_type(c + c8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(f + c8, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(AR_f + c8, npt.NDArray[np.complexfloating[Any, Any]]) # Float -reveal_type(f8 + f16) # E: {float128} -reveal_type(f8 + f8) # E: {float64} -reveal_type(f8 + i8) # E: {float64} -reveal_type(f8 + f4) # E: {float64} -reveal_type(f8 + i4) # E: {float64} -reveal_type(f8 + b_) # E: {float64} -reveal_type(f8 + b) # E: {float64} -reveal_type(f8 + c) # E: {complex128} -reveal_type(f8 + f) # E: {float64} -reveal_type(f8 + i) # E: {float64} -reveal_type(f8 + AR_f) # E: Any - -reveal_type(f16 + f8) # E: {float128} -reveal_type(f8 + f8) # E: {float64} -reveal_type(i8 + f8) # E: {float64} -reveal_type(f4 + f8) # E: {float64} -reveal_type(i4 + f8) # E: {float64} -reveal_type(b_ + f8) # E: {float64} -reveal_type(b + f8) # E: {float64} -reveal_type(c + f8) # E: {complex128} -reveal_type(f + f8) # E: {float64} -reveal_type(i + f8) # E: {float64} -reveal_type(AR_f + f8) # E: Any - -reveal_type(f4 + f16) # E: {float128} -reveal_type(f4 + f8) # E: {float64} -reveal_type(f4 + i8) # E: {float64} -reveal_type(f4 + f4) # E: {float32} -reveal_type(f4 + i4) # E: {float32} -reveal_type(f4 + b_) # E: {float32} -reveal_type(f4 + b) # E: {float32} -reveal_type(f4 + c) # E: {complex128} -reveal_type(f4 + f) # E: {float64} -reveal_type(f4 + i) # E: floating[{_NBitInt}] -reveal_type(f4 + AR_f) # E: Any - -reveal_type(f16 + f4) # E: {float128} -reveal_type(f8 + f4) # E: {float64} -reveal_type(i8 + f4) # E: {float64} -reveal_type(f4 + f4) # E: {float32} -reveal_type(i4 + f4) # E: {float32} -reveal_type(b_ + f4) # E: {float32} -reveal_type(b + f4) # E: {float32} -reveal_type(c + f4) # E: {complex128} -reveal_type(f + f4) # E: {float64} -reveal_type(i + f4) # E: floating[{_NBitInt}] -reveal_type(AR_f + f4) # E: Any +assert_type(f8 + f16, np.floating[_64Bit | _128Bit]) +assert_type(f8 + f8, np.float64) +assert_type(f8 + i8, np.float64) +assert_type(f8 + f4, np.floating[_32Bit | _64Bit]) +assert_type(f8 + i4, np.floating[_32Bit | _64Bit]) +assert_type(f8 + b_, np.float64) +assert_type(f8 + b, np.float64) +assert_type(f8 + c, np.complex128) +assert_type(f8 + f, np.float64) +assert_type(f8 + AR_f, npt.NDArray[np.floating[Any]]) + +assert_type(f16 + f8, np.floating[_64Bit | _128Bit]) +assert_type(f8 + f8, np.float64) +assert_type(i8 + f8, np.float64) +assert_type(f4 + f8, np.floating[_32Bit | _64Bit]) +assert_type(i4 + f8, np.floating[_32Bit | _64Bit]) +assert_type(b_ + f8, np.float64) +assert_type(b + f8, np.float64) +assert_type(c + f8, np.complex128) +assert_type(f + f8, np.float64) +assert_type(AR_f + f8, npt.NDArray[np.floating[Any]]) + +assert_type(f4 + f16, np.floating[_32Bit | _128Bit]) +assert_type(f4 + f8, np.floating[_32Bit | _64Bit]) +assert_type(f4 + i8, np.floating[_32Bit | _64Bit]) +assert_type(f4 + f4, np.float32) +assert_type(f4 + i4, np.float32) +assert_type(f4 + b_, np.float32) +assert_type(f4 + b, np.float32) +assert_type(f4 + c, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(f4 + f, np.floating[_32Bit | _64Bit]) +assert_type(f4 + AR_f, npt.NDArray[np.floating[Any]]) + +assert_type(f16 + f4, np.floating[_32Bit | _128Bit]) +assert_type(f8 + f4, np.floating[_32Bit | _64Bit]) +assert_type(i8 + f4, np.floating[_32Bit | _64Bit]) +assert_type(f4 + f4, np.float32) +assert_type(i4 + f4, np.float32) +assert_type(b_ + f4, np.float32) +assert_type(b + f4, np.float32) +assert_type(c + f4, np.complexfloating[_32Bit | _64Bit, _32Bit | _64Bit]) +assert_type(f + f4, np.floating[_32Bit | _64Bit]) +assert_type(AR_f + f4, npt.NDArray[np.floating[Any]]) # Int -reveal_type(i8 + i8) # E: {int64} -reveal_type(i8 + u8) # E: Any -reveal_type(i8 + i4) # E: {int64} -reveal_type(i8 + u4) # E: Any -reveal_type(i8 + b_) # E: {int64} -reveal_type(i8 + b) # E: {int64} -reveal_type(i8 + c) # E: {complex128} -reveal_type(i8 + f) # E: {float64} -reveal_type(i8 + i) # E: {int64} -reveal_type(i8 + AR_f) # E: Any - -reveal_type(u8 + u8) # E: {uint64} -reveal_type(u8 + i4) # E: Any -reveal_type(u8 + u4) # E: {uint64} -reveal_type(u8 + b_) # E: {uint64} -reveal_type(u8 + b) # E: {uint64} -reveal_type(u8 + c) # E: {complex128} -reveal_type(u8 + f) # E: {float64} -reveal_type(u8 + i) # E: Any -reveal_type(u8 + AR_f) # E: Any - -reveal_type(i8 + i8) # E: {int64} -reveal_type(u8 + i8) # E: Any -reveal_type(i4 + i8) # E: {int64} -reveal_type(u4 + i8) # E: Any -reveal_type(b_ + i8) # E: {int64} -reveal_type(b + i8) # E: {int64} -reveal_type(c + i8) # E: {complex128} -reveal_type(f + i8) # E: {float64} -reveal_type(i + i8) # E: {int64} -reveal_type(AR_f + i8) # E: Any - -reveal_type(u8 + u8) # E: {uint64} -reveal_type(i4 + u8) # E: Any -reveal_type(u4 + u8) # E: {uint64} -reveal_type(b_ + u8) # E: {uint64} -reveal_type(b + u8) # E: {uint64} -reveal_type(c + u8) # E: {complex128} -reveal_type(f + u8) # E: {float64} -reveal_type(i + u8) # E: Any -reveal_type(AR_f + u8) # E: Any - -reveal_type(i4 + i8) # E: {int64} -reveal_type(i4 + i4) # E: {int32} -reveal_type(i4 + i) # E: {int_} -reveal_type(i4 + b_) # E: {int32} -reveal_type(i4 + b) # E: {int32} -reveal_type(i4 + AR_f) # E: Any - -reveal_type(u4 + i8) # E: Any -reveal_type(u4 + i4) # E: Any -reveal_type(u4 + u8) # E: {uint64} -reveal_type(u4 + u4) # E: {uint32} -reveal_type(u4 + i) # E: Any -reveal_type(u4 + b_) # E: {uint32} -reveal_type(u4 + b) # E: {uint32} -reveal_type(u4 + AR_f) # E: Any - -reveal_type(i8 + i4) # E: {int64} -reveal_type(i4 + i4) # E: {int32} -reveal_type(i + i4) # E: {int_} -reveal_type(b_ + i4) # E: {int32} -reveal_type(b + i4) # E: {int32} -reveal_type(AR_f + i4) # E: Any - -reveal_type(i8 + u4) # E: Any -reveal_type(i4 + u4) # E: Any -reveal_type(u8 + u4) # E: {uint64} -reveal_type(u4 + u4) # E: {uint32} -reveal_type(b_ + u4) # E: {uint32} -reveal_type(b + u4) # E: {uint32} -reveal_type(i + u4) # E: Any -reveal_type(AR_f + u4) # E: Any +assert_type(i8 + i8, np.int64) +assert_type(i8 + u8, Any) +assert_type(i8 + i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 + u4, Any) +assert_type(i8 + b_, np.int64) +assert_type(i8 + b, np.int64) +assert_type(i8 + c, np.complex128) +assert_type(i8 + f, np.float64) +assert_type(i8 + AR_f, npt.NDArray[np.floating[Any]]) + +assert_type(u8 + u8, np.uint64) +assert_type(u8 + i4, Any) +assert_type(u8 + u4, np.unsignedinteger[_32Bit | _64Bit]) +assert_type(u8 + b_, np.uint64) +assert_type(u8 + b, np.uint64) +assert_type(u8 + c, np.complex128) +assert_type(u8 + f, np.float64) +assert_type(u8 + AR_f, npt.NDArray[np.floating[Any]]) + +assert_type(i8 + i8, np.int64) +assert_type(u8 + i8, Any) +assert_type(i4 + i8, np.signedinteger[_32Bit | _64Bit]) +assert_type(u4 + i8, Any) +assert_type(b_ + i8, np.int64) +assert_type(b + i8, np.int64) +assert_type(c + i8, np.complex128) +assert_type(f + i8, np.float64) +assert_type(AR_f + i8, npt.NDArray[np.floating[Any]]) + +assert_type(u8 + u8, np.uint64) +assert_type(i4 + u8, Any) +assert_type(u4 + u8, np.unsignedinteger[_32Bit | _64Bit]) +assert_type(b_ + u8, np.uint64) +assert_type(b + u8, np.uint64) +assert_type(c + u8, np.complex128) +assert_type(f + u8, np.float64) +assert_type(AR_f + u8, npt.NDArray[np.floating[Any]]) + +assert_type(i4 + i8, np.signedinteger[_32Bit | _64Bit]) +assert_type(i4 + i4, np.int32) +assert_type(i4 + b_, np.int32) +assert_type(i4 + b, np.int32) +assert_type(i4 + AR_f, npt.NDArray[np.floating[Any]]) + +assert_type(u4 + i8, Any) +assert_type(u4 + i4, Any) +assert_type(u4 + u8, np.unsignedinteger[_32Bit | _64Bit]) +assert_type(u4 + u4, np.uint32) +assert_type(u4 + b_, np.uint32) +assert_type(u4 + b, np.uint32) +assert_type(u4 + AR_f, npt.NDArray[np.floating[Any]]) + +assert_type(i8 + i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i4 + i4, np.int32) +assert_type(b_ + i4, np.int32) +assert_type(b + i4, np.int32) +assert_type(AR_f + i4, npt.NDArray[np.floating[Any]]) + +assert_type(i8 + u4, Any) +assert_type(i4 + u4, Any) +assert_type(u8 + u4, np.unsignedinteger[_32Bit | _64Bit]) +assert_type(u4 + u4, np.uint32) +assert_type(b_ + u4, np.uint32) +assert_type(b + u4, np.uint32) +assert_type(AR_f + u4, npt.NDArray[np.floating[Any]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/array_constructors.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/array_constructors.pyi index 2ff20e9aee..0bfbc63093 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/array_constructors.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/array_constructors.pyi @@ -1,9 +1,16 @@ +import sys from typing import Any, TypeVar from pathlib import Path +from collections import deque import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + _SCT = TypeVar("_SCT", bound=np.generic, covariant=True) class SubClass(np.ndarray[Any, np.dtype[_SCT]]): ... @@ -16,190 +23,199 @@ C: list[int] def func(i: int, j: int, **kwargs: Any) -> SubClass[np.float64]: ... -reveal_type(np.empty_like(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.empty_like(B)) # E: SubClass[{float64}] -reveal_type(np.empty_like([1, 1.0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.empty_like(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.empty_like(A, dtype='c16')) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.array(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.array(B)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.array(B, subok=True)) # E: SubClass[{float64}] -reveal_type(np.array([1, 1.0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.array(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.array(A, dtype='c16')) # E: ndarray[Any, dtype[Any]] -reveal_type(np.array(A, like=A)) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.zeros([1, 5, 6])) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.zeros([1, 5, 6], dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.zeros([1, 5, 6], dtype='c16')) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.empty([1, 5, 6])) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.empty([1, 5, 6], dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.empty([1, 5, 6], dtype='c16')) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.concatenate(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.concatenate([A, A])) # E: Any -reveal_type(np.concatenate([[1], A])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.concatenate([[1], [1]])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.concatenate((A, A))) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.concatenate(([1], [1]))) # E: ndarray[Any, dtype[Any]] -reveal_type(np.concatenate([1, 1.0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.concatenate(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.concatenate(A, dtype='c16')) # E: ndarray[Any, dtype[Any]] -reveal_type(np.concatenate([1, 1.0], out=A)) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.asarray(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asarray(B)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asarray([1, 1.0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.asarray(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.asarray(A, dtype='c16')) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.asanyarray(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asanyarray(B)) # E: SubClass[{float64}] -reveal_type(np.asanyarray([1, 1.0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.asanyarray(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.asanyarray(A, dtype='c16')) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.ascontiguousarray(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.ascontiguousarray(B)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.ascontiguousarray([1, 1.0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.ascontiguousarray(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.ascontiguousarray(A, dtype='c16')) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.asfortranarray(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asfortranarray(B)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asfortranarray([1, 1.0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.asfortranarray(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.asfortranarray(A, dtype='c16')) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.fromstring("1 1 1", sep=" ")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fromstring(b"1 1 1", sep=" ")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fromstring("1 1 1", dtype=np.int64, sep=" ")) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.fromstring(b"1 1 1", dtype=np.int64, sep=" ")) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.fromstring("1 1 1", dtype="c16", sep=" ")) # E: ndarray[Any, dtype[Any]] -reveal_type(np.fromstring(b"1 1 1", dtype="c16", sep=" ")) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.fromfile("test.txt", sep=" ")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fromfile("test.txt", dtype=np.int64, sep=" ")) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.fromfile("test.txt", dtype="c16", sep=" ")) # E: ndarray[Any, dtype[Any]] +assert_type(np.empty_like(A), npt.NDArray[np.float64]) +assert_type(np.empty_like(B), SubClass[np.float64]) +assert_type(np.empty_like([1, 1.0]), npt.NDArray[Any]) +assert_type(np.empty_like(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.empty_like(A, dtype='c16'), npt.NDArray[Any]) + +assert_type(np.array(A), npt.NDArray[np.float64]) +assert_type(np.array(B), npt.NDArray[np.float64]) +assert_type(np.array(B, subok=True), SubClass[np.float64]) +assert_type(np.array([1, 1.0]), npt.NDArray[Any]) +assert_type(np.array(deque([1, 2, 3])), npt.NDArray[Any]) +assert_type(np.array(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.array(A, dtype='c16'), npt.NDArray[Any]) +assert_type(np.array(A, like=A), npt.NDArray[np.float64]) + +assert_type(np.zeros([1, 5, 6]), npt.NDArray[np.float64]) +assert_type(np.zeros([1, 5, 6], dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.zeros([1, 5, 6], dtype='c16'), npt.NDArray[Any]) + +assert_type(np.empty([1, 5, 6]), npt.NDArray[np.float64]) +assert_type(np.empty([1, 5, 6], dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.empty([1, 5, 6], dtype='c16'), npt.NDArray[Any]) + +assert_type(np.concatenate(A), npt.NDArray[np.float64]) +assert_type(np.concatenate([A, A]), Any) +assert_type(np.concatenate([[1], A]), npt.NDArray[Any]) +assert_type(np.concatenate([[1], [1]]), npt.NDArray[Any]) +assert_type(np.concatenate((A, A)), npt.NDArray[np.float64]) +assert_type(np.concatenate(([1], [1])), npt.NDArray[Any]) +assert_type(np.concatenate([1, 1.0]), npt.NDArray[Any]) +assert_type(np.concatenate(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.concatenate(A, dtype='c16'), npt.NDArray[Any]) +assert_type(np.concatenate([1, 1.0], out=A), npt.NDArray[np.float64]) + +assert_type(np.asarray(A), npt.NDArray[np.float64]) +assert_type(np.asarray(B), npt.NDArray[np.float64]) +assert_type(np.asarray([1, 1.0]), npt.NDArray[Any]) +assert_type(np.asarray(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.asarray(A, dtype='c16'), npt.NDArray[Any]) + +assert_type(np.asanyarray(A), npt.NDArray[np.float64]) +assert_type(np.asanyarray(B), SubClass[np.float64]) +assert_type(np.asanyarray([1, 1.0]), npt.NDArray[Any]) +assert_type(np.asanyarray(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.asanyarray(A, dtype='c16'), npt.NDArray[Any]) + +assert_type(np.ascontiguousarray(A), npt.NDArray[np.float64]) +assert_type(np.ascontiguousarray(B), npt.NDArray[np.float64]) +assert_type(np.ascontiguousarray([1, 1.0]), npt.NDArray[Any]) +assert_type(np.ascontiguousarray(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.ascontiguousarray(A, dtype='c16'), npt.NDArray[Any]) + +assert_type(np.asfortranarray(A), npt.NDArray[np.float64]) +assert_type(np.asfortranarray(B), npt.NDArray[np.float64]) +assert_type(np.asfortranarray([1, 1.0]), npt.NDArray[Any]) +assert_type(np.asfortranarray(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.asfortranarray(A, dtype='c16'), npt.NDArray[Any]) + +assert_type(np.fromstring("1 1 1", sep=" "), npt.NDArray[np.float64]) +assert_type(np.fromstring(b"1 1 1", sep=" "), npt.NDArray[np.float64]) +assert_type(np.fromstring("1 1 1", dtype=np.int64, sep=" "), npt.NDArray[np.int64]) +assert_type(np.fromstring(b"1 1 1", dtype=np.int64, sep=" "), npt.NDArray[np.int64]) +assert_type(np.fromstring("1 1 1", dtype="c16", sep=" "), npt.NDArray[Any]) +assert_type(np.fromstring(b"1 1 1", dtype="c16", sep=" "), npt.NDArray[Any]) + +assert_type(np.fromfile("test.txt", sep=" "), npt.NDArray[np.float64]) +assert_type(np.fromfile("test.txt", dtype=np.int64, sep=" "), npt.NDArray[np.int64]) +assert_type(np.fromfile("test.txt", dtype="c16", sep=" "), npt.NDArray[Any]) with open("test.txt") as f: - reveal_type(np.fromfile(f, sep=" ")) # E: ndarray[Any, dtype[{float64}]] - reveal_type(np.fromfile(b"test.txt", sep=" ")) # E: ndarray[Any, dtype[{float64}]] - reveal_type(np.fromfile(Path("test.txt"), sep=" ")) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.fromiter("12345", np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fromiter("12345", float)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.frombuffer(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.frombuffer(A, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.frombuffer(A, dtype="c16")) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.arange(False, True)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.arange(10)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.arange(0, 10, step=2)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.arange(10.0)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.arange(start=0, stop=10.0)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.arange(np.timedelta64(0))) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.arange(0, np.timedelta64(10))) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.arange(np.datetime64("0"), np.datetime64("10"))) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.arange(10, dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.arange(0, 10, step=2, dtype=np.int16)) # E: ndarray[Any, dtype[{int16}]] -reveal_type(np.arange(10, dtype=int)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.arange(0, 10, dtype="f8")) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.require(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.require(B)) # E: SubClass[{float64}] -reveal_type(np.require(B, requirements=None)) # E: SubClass[{float64}] -reveal_type(np.require(B, dtype=int)) # E: ndarray[Any, Any] -reveal_type(np.require(B, requirements="E")) # E: ndarray[Any, Any] -reveal_type(np.require(B, requirements=["ENSUREARRAY"])) # E: ndarray[Any, Any] -reveal_type(np.require(B, requirements={"F", "E"})) # E: ndarray[Any, Any] -reveal_type(np.require(B, requirements=["C", "OWNDATA"])) # E: SubClass[{float64}] -reveal_type(np.require(B, requirements="W")) # E: SubClass[{float64}] -reveal_type(np.require(B, requirements="A")) # E: SubClass[{float64}] -reveal_type(np.require(C)) # E: ndarray[Any, Any] - -reveal_type(np.linspace(0, 10)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linspace(0, 10j)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.linspace(0, 10, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.linspace(0, 10, dtype=int)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.linspace(0, 10, retstep=True)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], floating[Any]] -reveal_type(np.linspace(0j, 10, retstep=True)) # E: Tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], complexfloating[Any, Any]] -reveal_type(np.linspace(0, 10, retstep=True, dtype=np.int64)) # E: Tuple[ndarray[Any, dtype[{int64}]], {int64}] -reveal_type(np.linspace(0j, 10, retstep=True, dtype=int)) # E: Tuple[ndarray[Any, dtype[Any]], Any] - -reveal_type(np.logspace(0, 10)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.logspace(0, 10j)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.logspace(0, 10, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.logspace(0, 10, dtype=int)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.geomspace(0, 10)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.geomspace(0, 10j)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.geomspace(0, 10, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.geomspace(0, 10, dtype=int)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.zeros_like(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.zeros_like(C)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.zeros_like(A, dtype=float)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.zeros_like(B)) # E: SubClass[{float64}] -reveal_type(np.zeros_like(B, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] - -reveal_type(np.ones_like(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.ones_like(C)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.ones_like(A, dtype=float)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.ones_like(B)) # E: SubClass[{float64}] -reveal_type(np.ones_like(B, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] - -reveal_type(np.full_like(A, i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.full_like(C, i8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.full_like(A, i8, dtype=int)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.full_like(B, i8)) # E: SubClass[{float64}] -reveal_type(np.full_like(B, i8, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] - -reveal_type(np.ones(1)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.ones([1, 1, 1])) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.ones(5, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.ones(5, dtype=int)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.full(1, i8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.full([1, 1, 1], i8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.full(1, i8, dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.full(1, i8, dtype=float)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.indices([1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.indices([1, 2, 3], sparse=True)) # E: tuple[ndarray[Any, dtype[{int_}]], ...] - -reveal_type(np.fromfunction(func, (3, 5))) # E: SubClass[{float64}] - -reveal_type(np.identity(10)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.identity(10, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.identity(10, dtype=int)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.atleast_1d(A)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.atleast_1d(C)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.atleast_1d(A, A)) # E: list[ndarray[Any, dtype[Any]]] -reveal_type(np.atleast_1d(A, C)) # E: list[ndarray[Any, dtype[Any]]] -reveal_type(np.atleast_1d(C, C)) # E: list[ndarray[Any, dtype[Any]]] - -reveal_type(np.atleast_2d(A)) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.atleast_3d(A)) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.vstack([A, A])) # E: ndarray[Any, Any] -reveal_type(np.vstack([A, A], dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.vstack([A, C])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.vstack([C, C])) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.hstack([A, A])) # E: ndarray[Any, Any] -reveal_type(np.hstack([A, A], dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.stack([A, A])) # E: Any -reveal_type(np.stack([A, A], dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.stack([A, C])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.stack([C, C])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.stack([A, A], axis=0)) # E: Any -reveal_type(np.stack([A, A], out=B)) # E: SubClass[{float64}] - -reveal_type(np.block([[A, A], [A, A]])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.block(C)) # E: ndarray[Any, dtype[Any]] + assert_type(np.fromfile(f, sep=" "), npt.NDArray[np.float64]) + assert_type(np.fromfile(b"test.txt", sep=" "), npt.NDArray[np.float64]) + assert_type(np.fromfile(Path("test.txt"), sep=" "), npt.NDArray[np.float64]) + +assert_type(np.fromiter("12345", np.float64), npt.NDArray[np.float64]) +assert_type(np.fromiter("12345", float), npt.NDArray[Any]) + +assert_type(np.frombuffer(A), npt.NDArray[np.float64]) +assert_type(np.frombuffer(A, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.frombuffer(A, dtype="c16"), npt.NDArray[Any]) + +assert_type(np.arange(False, True), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.arange(10), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.arange(0, 10, step=2), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.arange(10.0), npt.NDArray[np.floating[Any]]) +assert_type(np.arange(start=0, stop=10.0), npt.NDArray[np.floating[Any]]) +assert_type(np.arange(np.timedelta64(0)), npt.NDArray[np.timedelta64]) +assert_type(np.arange(0, np.timedelta64(10)), npt.NDArray[np.timedelta64]) +assert_type(np.arange(np.datetime64("0"), np.datetime64("10")), npt.NDArray[np.datetime64]) +assert_type(np.arange(10, dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.arange(0, 10, step=2, dtype=np.int16), npt.NDArray[np.int16]) +assert_type(np.arange(10, dtype=int), npt.NDArray[Any]) +assert_type(np.arange(0, 10, dtype="f8"), npt.NDArray[Any]) + +assert_type(np.require(A), npt.NDArray[np.float64]) +assert_type(np.require(B), SubClass[np.float64]) +assert_type(np.require(B, requirements=None), SubClass[np.float64]) +assert_type(np.require(B, dtype=int), np.ndarray[Any, Any]) +assert_type(np.require(B, requirements="E"), np.ndarray[Any, Any]) +assert_type(np.require(B, requirements=["ENSUREARRAY"]), np.ndarray[Any, Any]) +assert_type(np.require(B, requirements={"F", "E"}), np.ndarray[Any, Any]) +assert_type(np.require(B, requirements=["C", "OWNDATA"]), SubClass[np.float64]) +assert_type(np.require(B, requirements="W"), SubClass[np.float64]) +assert_type(np.require(B, requirements="A"), SubClass[np.float64]) +assert_type(np.require(C), np.ndarray[Any, Any]) + +assert_type(np.linspace(0, 10), npt.NDArray[np.floating[Any]]) +assert_type(np.linspace(0, 10j), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.linspace(0, 10, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.linspace(0, 10, dtype=int), npt.NDArray[Any]) +assert_type(np.linspace(0, 10, retstep=True), tuple[npt.NDArray[np.floating[Any]], np.floating[Any]]) +assert_type(np.linspace(0j, 10, retstep=True), tuple[npt.NDArray[np.complexfloating[Any, Any]], np.complexfloating[Any, Any]]) +assert_type(np.linspace(0, 10, retstep=True, dtype=np.int64), tuple[npt.NDArray[np.int64], np.int64]) +assert_type(np.linspace(0j, 10, retstep=True, dtype=int), tuple[npt.NDArray[Any], Any]) + +assert_type(np.logspace(0, 10), npt.NDArray[np.floating[Any]]) +assert_type(np.logspace(0, 10j), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.logspace(0, 10, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.logspace(0, 10, dtype=int), npt.NDArray[Any]) + +assert_type(np.geomspace(0, 10), npt.NDArray[np.floating[Any]]) +assert_type(np.geomspace(0, 10j), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.geomspace(0, 10, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.geomspace(0, 10, dtype=int), npt.NDArray[Any]) + +assert_type(np.zeros_like(A), npt.NDArray[np.float64]) +assert_type(np.zeros_like(C), npt.NDArray[Any]) +assert_type(np.zeros_like(A, dtype=float), npt.NDArray[Any]) +assert_type(np.zeros_like(B), SubClass[np.float64]) +assert_type(np.zeros_like(B, dtype=np.int64), npt.NDArray[np.int64]) + +assert_type(np.ones_like(A), npt.NDArray[np.float64]) +assert_type(np.ones_like(C), npt.NDArray[Any]) +assert_type(np.ones_like(A, dtype=float), npt.NDArray[Any]) +assert_type(np.ones_like(B), SubClass[np.float64]) +assert_type(np.ones_like(B, dtype=np.int64), npt.NDArray[np.int64]) + +assert_type(np.full_like(A, i8), npt.NDArray[np.float64]) +assert_type(np.full_like(C, i8), npt.NDArray[Any]) +assert_type(np.full_like(A, i8, dtype=int), npt.NDArray[Any]) +assert_type(np.full_like(B, i8), SubClass[np.float64]) +assert_type(np.full_like(B, i8, dtype=np.int64), npt.NDArray[np.int64]) + +assert_type(np.ones(1), npt.NDArray[np.float64]) +assert_type(np.ones([1, 1, 1]), npt.NDArray[np.float64]) +assert_type(np.ones(5, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.ones(5, dtype=int), npt.NDArray[Any]) + +assert_type(np.full(1, i8), npt.NDArray[Any]) +assert_type(np.full([1, 1, 1], i8), npt.NDArray[Any]) +assert_type(np.full(1, i8, dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.full(1, i8, dtype=float), npt.NDArray[Any]) + +assert_type(np.indices([1, 2, 3]), npt.NDArray[np.int_]) +assert_type(np.indices([1, 2, 3], sparse=True), tuple[npt.NDArray[np.int_], ...]) + +assert_type(np.fromfunction(func, (3, 5)), SubClass[np.float64]) + +assert_type(np.identity(10), npt.NDArray[np.float64]) +assert_type(np.identity(10, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.identity(10, dtype=int), npt.NDArray[Any]) + +assert_type(np.atleast_1d(A), npt.NDArray[np.float64]) +assert_type(np.atleast_1d(C), npt.NDArray[Any]) +assert_type(np.atleast_1d(A, A), list[npt.NDArray[Any]]) +assert_type(np.atleast_1d(A, C), list[npt.NDArray[Any]]) +assert_type(np.atleast_1d(C, C), list[npt.NDArray[Any]]) + +assert_type(np.atleast_2d(A), npt.NDArray[np.float64]) + +assert_type(np.atleast_3d(A), npt.NDArray[np.float64]) + +assert_type(np.vstack([A, A]), np.ndarray[Any, Any]) +assert_type(np.vstack([A, A], dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.vstack([A, C]), npt.NDArray[Any]) +assert_type(np.vstack([C, C]), npt.NDArray[Any]) + +assert_type(np.hstack([A, A]), np.ndarray[Any, Any]) +assert_type(np.hstack([A, A], dtype=np.float64), npt.NDArray[np.float64]) + +assert_type(np.stack([A, A]), Any) +assert_type(np.stack([A, A], dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.stack([A, C]), npt.NDArray[Any]) +assert_type(np.stack([C, C]), npt.NDArray[Any]) +assert_type(np.stack([A, A], axis=0), Any) +assert_type(np.stack([A, A], out=B), SubClass[np.float64]) + +assert_type(np.block([[A, A], [A, A]]), npt.NDArray[Any]) +assert_type(np.block(C), npt.NDArray[Any]) + +if sys.version_info >= (3, 12): + from collections.abc import Buffer + + def create_array(obj: npt.ArrayLike) -> npt.NDArray[Any]: ... + + buffer: Buffer + assert_type(create_array(buffer), npt.NDArray[Any]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraypad.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraypad.pyi index a05d440346..f53613ba2f 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraypad.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraypad.pyi @@ -1,9 +1,15 @@ +import sys from collections.abc import Mapping from typing import Any, SupportsIndex import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + def mode_func( ar: npt.NDArray[np.number[Any]], width: tuple[int, int], @@ -15,8 +21,8 @@ AR_i8: npt.NDArray[np.int64] AR_f8: npt.NDArray[np.float64] AR_LIKE: list[int] -reveal_type(np.pad(AR_i8, (2, 3), "constant")) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.pad(AR_LIKE, (2, 3), "constant")) # E: ndarray[Any, dtype[Any]] +assert_type(np.pad(AR_i8, (2, 3), "constant"), npt.NDArray[np.int64]) +assert_type(np.pad(AR_LIKE, (2, 3), "constant"), npt.NDArray[Any]) -reveal_type(np.pad(AR_f8, (2, 3), mode_func)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.pad(AR_f8, (2, 3), mode_func, a=1, b=2)) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.pad(AR_f8, (2, 3), mode_func), npt.NDArray[np.float64]) +assert_type(np.pad(AR_f8, (2, 3), mode_func, a=1, b=2), npt.NDArray[np.float64]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayprint.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayprint.pyi index 6e65a8d8ad..8f41bd2fe8 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayprint.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayprint.pyi @@ -1,20 +1,30 @@ +import sys +import contextlib from collections.abc import Callable from typing import Any + import numpy as np +from numpy.core.arrayprint import _FormatOptions + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR: np.ndarray[Any, Any] func_float: Callable[[np.floating[Any]], str] func_int: Callable[[np.integer[Any]], str] -reveal_type(np.get_printoptions()) # E: TypedDict -reveal_type(np.array2string( # E: str - AR, formatter={'float_kind': func_float, 'int_kind': func_int} -)) -reveal_type(np.format_float_scientific(1.0)) # E: str -reveal_type(np.format_float_positional(1)) # E: str -reveal_type(np.array_repr(AR)) # E: str -reveal_type(np.array_str(AR)) # E: str +assert_type(np.get_printoptions(), _FormatOptions) +assert_type( + np.array2string(AR, formatter={'float_kind': func_float, 'int_kind': func_int}), + str, +) +assert_type(np.format_float_scientific(1.0), str) +assert_type(np.format_float_positional(1), str) +assert_type(np.array_repr(AR), str) +assert_type(np.array_str(AR), str) -reveal_type(np.printoptions()) # E: contextlib._GeneratorContextManager +assert_type(np.printoptions(), contextlib._GeneratorContextManager[_FormatOptions]) with np.printoptions() as dct: - reveal_type(dct) # E: TypedDict + assert_type(dct, _FormatOptions) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraysetops.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraysetops.pyi index 9deff8a8ea..877ea667d5 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraysetops.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arraysetops.pyi @@ -1,6 +1,14 @@ +import sys +from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_b: npt.NDArray[np.bool_] AR_i8: npt.NDArray[np.int64] AR_f8: npt.NDArray[np.float64] @@ -9,52 +17,52 @@ AR_O: npt.NDArray[np.object_] AR_LIKE_f8: list[float] -reveal_type(np.ediff1d(AR_b)) # E: ndarray[Any, dtype[{int8}]] -reveal_type(np.ediff1d(AR_i8, to_end=[1, 2, 3])) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.ediff1d(AR_M)) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.ediff1d(AR_O)) # E: ndarray[Any, dtype[object_]] -reveal_type(np.ediff1d(AR_LIKE_f8, to_begin=[1, 1.5])) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.intersect1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.intersect1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.intersect1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.intersect1d(AR_f8, AR_f8, return_indices=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] - -reveal_type(np.setxor1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.setxor1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.setxor1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.in1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.in1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.in1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.in1d(AR_f8, AR_LIKE_f8, invert=True)) # E: ndarray[Any, dtype[bool_]] - -reveal_type(np.isin(AR_i8, AR_i8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isin(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isin(AR_f8, AR_i8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isin(AR_f8, AR_LIKE_f8, invert=True)) # E: ndarray[Any, dtype[bool_]] - -reveal_type(np.union1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.union1d(AR_M, AR_M)) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.union1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.setdiff1d(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.setdiff1d(AR_M, AR_M, assume_unique=True)) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.setdiff1d(AR_f8, AR_i8)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.unique(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.unique(AR_LIKE_f8, axis=0)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.unique(AR_f8, return_index=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_LIKE_f8, return_index=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_f8, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_LIKE_f8, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_f8, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_LIKE_f8, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_f8, return_index=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_f8, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_LIKE_f8, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_f8, return_index=True, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True, return_counts=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] +assert_type(np.ediff1d(AR_b), npt.NDArray[np.int8]) +assert_type(np.ediff1d(AR_i8, to_end=[1, 2, 3]), npt.NDArray[np.int64]) +assert_type(np.ediff1d(AR_M), npt.NDArray[np.timedelta64]) +assert_type(np.ediff1d(AR_O), npt.NDArray[np.object_]) +assert_type(np.ediff1d(AR_LIKE_f8, to_begin=[1, 1.5]), npt.NDArray[Any]) + +assert_type(np.intersect1d(AR_i8, AR_i8), npt.NDArray[np.int64]) +assert_type(np.intersect1d(AR_M, AR_M, assume_unique=True), npt.NDArray[np.datetime64]) +assert_type(np.intersect1d(AR_f8, AR_i8), npt.NDArray[Any]) +assert_type(np.intersect1d(AR_f8, AR_f8, return_indices=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp], npt.NDArray[np.intp]]) + +assert_type(np.setxor1d(AR_i8, AR_i8), npt.NDArray[np.int64]) +assert_type(np.setxor1d(AR_M, AR_M, assume_unique=True), npt.NDArray[np.datetime64]) +assert_type(np.setxor1d(AR_f8, AR_i8), npt.NDArray[Any]) + +assert_type(np.in1d(AR_i8, AR_i8), npt.NDArray[np.bool_]) +assert_type(np.in1d(AR_M, AR_M, assume_unique=True), npt.NDArray[np.bool_]) +assert_type(np.in1d(AR_f8, AR_i8), npt.NDArray[np.bool_]) +assert_type(np.in1d(AR_f8, AR_LIKE_f8, invert=True), npt.NDArray[np.bool_]) + +assert_type(np.isin(AR_i8, AR_i8), npt.NDArray[np.bool_]) +assert_type(np.isin(AR_M, AR_M, assume_unique=True), npt.NDArray[np.bool_]) +assert_type(np.isin(AR_f8, AR_i8), npt.NDArray[np.bool_]) +assert_type(np.isin(AR_f8, AR_LIKE_f8, invert=True), npt.NDArray[np.bool_]) + +assert_type(np.union1d(AR_i8, AR_i8), npt.NDArray[np.int64]) +assert_type(np.union1d(AR_M, AR_M), npt.NDArray[np.datetime64]) +assert_type(np.union1d(AR_f8, AR_i8), npt.NDArray[Any]) + +assert_type(np.setdiff1d(AR_i8, AR_i8), npt.NDArray[np.int64]) +assert_type(np.setdiff1d(AR_M, AR_M, assume_unique=True), npt.NDArray[np.datetime64]) +assert_type(np.setdiff1d(AR_f8, AR_i8), npt.NDArray[Any]) + +assert_type(np.unique(AR_f8), npt.NDArray[np.float64]) +assert_type(np.unique(AR_LIKE_f8, axis=0), npt.NDArray[Any]) +assert_type(np.unique(AR_f8, return_index=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_LIKE_f8, return_index=True), tuple[npt.NDArray[Any], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_f8, return_inverse=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_LIKE_f8, return_inverse=True), tuple[npt.NDArray[Any], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_f8, return_counts=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_LIKE_f8, return_counts=True), tuple[npt.NDArray[Any], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_f8, return_index=True, return_inverse=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True), tuple[npt.NDArray[Any], npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_f8, return_index=True, return_counts=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_LIKE_f8, return_index=True, return_counts=True), tuple[npt.NDArray[Any], npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_f8, return_inverse=True, return_counts=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_LIKE_f8, return_inverse=True, return_counts=True), tuple[npt.NDArray[Any], npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_f8, return_index=True, return_inverse=True, return_counts=True), tuple[npt.NDArray[np.float64], npt.NDArray[np.intp], npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.unique(AR_LIKE_f8, return_index=True, return_inverse=True, return_counts=True), tuple[npt.NDArray[Any], npt.NDArray[np.intp], npt.NDArray[np.intp], npt.NDArray[np.intp]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayterator.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayterator.pyi index b6c26ddb70..7988b5c0c7 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayterator.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/arrayterator.pyi @@ -1,24 +1,33 @@ +import sys from typing import Any +from collections.abc import Generator + import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR_i8: np.ndarray[Any, np.dtype[np.int64]] ar_iter = np.lib.Arrayterator(AR_i8) -reveal_type(ar_iter.var) # E: ndarray[Any, dtype[{int64}]] -reveal_type(ar_iter.buf_size) # E: Union[None, builtins.int] -reveal_type(ar_iter.start) # E: builtins.list[builtins.int] -reveal_type(ar_iter.stop) # E: builtins.list[builtins.int] -reveal_type(ar_iter.step) # E: builtins.list[builtins.int] -reveal_type(ar_iter.shape) # E: builtins.tuple[builtins.int, ...] -reveal_type(ar_iter.flat) # E: typing.Generator[{int64}, None, None] +assert_type(ar_iter.var, npt.NDArray[np.int64]) +assert_type(ar_iter.buf_size, None | int) +assert_type(ar_iter.start, list[int]) +assert_type(ar_iter.stop, list[int]) +assert_type(ar_iter.step, list[int]) +assert_type(ar_iter.shape, tuple[int, ...]) +assert_type(ar_iter.flat, Generator[np.int64, None, None]) -reveal_type(ar_iter.__array__()) # E: ndarray[Any, dtype[{int64}]] +assert_type(ar_iter.__array__(), npt.NDArray[np.int64]) for i in ar_iter: - reveal_type(i) # E: ndarray[Any, dtype[{int64}]] + assert_type(i, npt.NDArray[np.int64]) -reveal_type(ar_iter[0]) # E: lib.arrayterator.Arrayterator[Any, dtype[{int64}]] -reveal_type(ar_iter[...]) # E: lib.arrayterator.Arrayterator[Any, dtype[{int64}]] -reveal_type(ar_iter[:]) # E: lib.arrayterator.Arrayterator[Any, dtype[{int64}]] -reveal_type(ar_iter[0, 0, 0]) # E: lib.arrayterator.Arrayterator[Any, dtype[{int64}]] -reveal_type(ar_iter[..., 0, :]) # E: lib.arrayterator.Arrayterator[Any, dtype[{int64}]] +assert_type(ar_iter[0], np.lib.Arrayterator[Any, np.dtype[np.int64]]) +assert_type(ar_iter[...], np.lib.Arrayterator[Any, np.dtype[np.int64]]) +assert_type(ar_iter[:], np.lib.Arrayterator[Any, np.dtype[np.int64]]) +assert_type(ar_iter[0, 0, 0], np.lib.Arrayterator[Any, np.dtype[np.int64]]) +assert_type(ar_iter[..., 0, :], np.lib.Arrayterator[Any, np.dtype[np.int64]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/bitwise_ops.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/bitwise_ops.pyi index f293ef65b5..4c51ab7154 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/bitwise_ops.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/bitwise_ops.pyi @@ -1,4 +1,14 @@ +import sys +from typing import Any + import numpy as np +import numpy.typing as npt +from numpy._typing import _64Bit, _32Bit + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type i8 = np.int64(1) u8 = np.uint64(1) @@ -15,117 +25,111 @@ AR = np.array([0, 1, 2], dtype=np.int32) AR.setflags(write=False) -reveal_type(i8 << i8) # E: {int64} -reveal_type(i8 >> i8) # E: {int64} -reveal_type(i8 | i8) # E: {int64} -reveal_type(i8 ^ i8) # E: {int64} -reveal_type(i8 & i8) # E: {int64} - -reveal_type(i8 << AR) # E: Any -reveal_type(i8 >> AR) # E: Any -reveal_type(i8 | AR) # E: Any -reveal_type(i8 ^ AR) # E: Any -reveal_type(i8 & AR) # E: Any - -reveal_type(i4 << i4) # E: {int32} -reveal_type(i4 >> i4) # E: {int32} -reveal_type(i4 | i4) # E: {int32} -reveal_type(i4 ^ i4) # E: {int32} -reveal_type(i4 & i4) # E: {int32} - -reveal_type(i8 << i4) # E: {int64} -reveal_type(i8 >> i4) # E: {int64} -reveal_type(i8 | i4) # E: {int64} -reveal_type(i8 ^ i4) # E: {int64} -reveal_type(i8 & i4) # E: {int64} - -reveal_type(i8 << i) # E: {int64} -reveal_type(i8 >> i) # E: {int64} -reveal_type(i8 | i) # E: {int64} -reveal_type(i8 ^ i) # E: {int64} -reveal_type(i8 & i) # E: {int64} - -reveal_type(i8 << b_) # E: {int64} -reveal_type(i8 >> b_) # E: {int64} -reveal_type(i8 | b_) # E: {int64} -reveal_type(i8 ^ b_) # E: {int64} -reveal_type(i8 & b_) # E: {int64} - -reveal_type(i8 << b) # E: {int64} -reveal_type(i8 >> b) # E: {int64} -reveal_type(i8 | b) # E: {int64} -reveal_type(i8 ^ b) # E: {int64} -reveal_type(i8 & b) # E: {int64} - -reveal_type(u8 << u8) # E: {uint64} -reveal_type(u8 >> u8) # E: {uint64} -reveal_type(u8 | u8) # E: {uint64} -reveal_type(u8 ^ u8) # E: {uint64} -reveal_type(u8 & u8) # E: {uint64} - -reveal_type(u8 << AR) # E: Any -reveal_type(u8 >> AR) # E: Any -reveal_type(u8 | AR) # E: Any -reveal_type(u8 ^ AR) # E: Any -reveal_type(u8 & AR) # E: Any - -reveal_type(u4 << u4) # E: {uint32} -reveal_type(u4 >> u4) # E: {uint32} -reveal_type(u4 | u4) # E: {uint32} -reveal_type(u4 ^ u4) # E: {uint32} -reveal_type(u4 & u4) # E: {uint32} - -reveal_type(u4 << i4) # E: signedinteger[Any] -reveal_type(u4 >> i4) # E: signedinteger[Any] -reveal_type(u4 | i4) # E: signedinteger[Any] -reveal_type(u4 ^ i4) # E: signedinteger[Any] -reveal_type(u4 & i4) # E: signedinteger[Any] - -reveal_type(u4 << i) # E: signedinteger[Any] -reveal_type(u4 >> i) # E: signedinteger[Any] -reveal_type(u4 | i) # E: signedinteger[Any] -reveal_type(u4 ^ i) # E: signedinteger[Any] -reveal_type(u4 & i) # E: signedinteger[Any] - -reveal_type(u8 << b_) # E: {uint64} -reveal_type(u8 >> b_) # E: {uint64} -reveal_type(u8 | b_) # E: {uint64} -reveal_type(u8 ^ b_) # E: {uint64} -reveal_type(u8 & b_) # E: {uint64} - -reveal_type(u8 << b) # E: {uint64} -reveal_type(u8 >> b) # E: {uint64} -reveal_type(u8 | b) # E: {uint64} -reveal_type(u8 ^ b) # E: {uint64} -reveal_type(u8 & b) # E: {uint64} - -reveal_type(b_ << b_) # E: {int8} -reveal_type(b_ >> b_) # E: {int8} -reveal_type(b_ | b_) # E: bool_ -reveal_type(b_ ^ b_) # E: bool_ -reveal_type(b_ & b_) # E: bool_ - -reveal_type(b_ << AR) # E: Any -reveal_type(b_ >> AR) # E: Any -reveal_type(b_ | AR) # E: Any -reveal_type(b_ ^ AR) # E: Any -reveal_type(b_ & AR) # E: Any - -reveal_type(b_ << b) # E: {int8} -reveal_type(b_ >> b) # E: {int8} -reveal_type(b_ | b) # E: bool_ -reveal_type(b_ ^ b) # E: bool_ -reveal_type(b_ & b) # E: bool_ - -reveal_type(b_ << i) # E: {int_} -reveal_type(b_ >> i) # E: {int_} -reveal_type(b_ | i) # E: {int_} -reveal_type(b_ ^ i) # E: {int_} -reveal_type(b_ & i) # E: {int_} - -reveal_type(~i8) # E: {int64} -reveal_type(~i4) # E: {int32} -reveal_type(~u8) # E: {uint64} -reveal_type(~u4) # E: {uint32} -reveal_type(~b_) # E: bool_ -reveal_type(~AR) # E: Any +assert_type(i8 << i8, np.int64) +assert_type(i8 >> i8, np.int64) +assert_type(i8 | i8, np.int64) +assert_type(i8 ^ i8, np.int64) +assert_type(i8 & i8, np.int64) + +assert_type(i8 << AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 >> AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 | AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 ^ AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(i8 & AR, npt.NDArray[np.signedinteger[Any]]) + +assert_type(i4 << i4, np.int32) +assert_type(i4 >> i4, np.int32) +assert_type(i4 | i4, np.int32) +assert_type(i4 ^ i4, np.int32) +assert_type(i4 & i4, np.int32) + +assert_type(i8 << i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 >> i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 | i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 ^ i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(i8 & i4, np.signedinteger[_32Bit | _64Bit]) + +assert_type(i8 << b_, np.int64) +assert_type(i8 >> b_, np.int64) +assert_type(i8 | b_, np.int64) +assert_type(i8 ^ b_, np.int64) +assert_type(i8 & b_, np.int64) + +assert_type(i8 << b, np.int64) +assert_type(i8 >> b, np.int64) +assert_type(i8 | b, np.int64) +assert_type(i8 ^ b, np.int64) +assert_type(i8 & b, np.int64) + +assert_type(u8 << u8, np.uint64) +assert_type(u8 >> u8, np.uint64) +assert_type(u8 | u8, np.uint64) +assert_type(u8 ^ u8, np.uint64) +assert_type(u8 & u8, np.uint64) + +assert_type(u8 << AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 >> AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 | AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 ^ AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(u8 & AR, npt.NDArray[np.signedinteger[Any]]) + +assert_type(u4 << u4, np.uint32) +assert_type(u4 >> u4, np.uint32) +assert_type(u4 | u4, np.uint32) +assert_type(u4 ^ u4, np.uint32) +assert_type(u4 & u4, np.uint32) + +assert_type(u4 << i4, np.signedinteger[Any]) +assert_type(u4 >> i4, np.signedinteger[Any]) +assert_type(u4 | i4, np.signedinteger[Any]) +assert_type(u4 ^ i4, np.signedinteger[Any]) +assert_type(u4 & i4, np.signedinteger[Any]) + +assert_type(u4 << i, np.signedinteger[Any]) +assert_type(u4 >> i, np.signedinteger[Any]) +assert_type(u4 | i, np.signedinteger[Any]) +assert_type(u4 ^ i, np.signedinteger[Any]) +assert_type(u4 & i, np.signedinteger[Any]) + +assert_type(u8 << b_, np.uint64) +assert_type(u8 >> b_, np.uint64) +assert_type(u8 | b_, np.uint64) +assert_type(u8 ^ b_, np.uint64) +assert_type(u8 & b_, np.uint64) + +assert_type(u8 << b, np.uint64) +assert_type(u8 >> b, np.uint64) +assert_type(u8 | b, np.uint64) +assert_type(u8 ^ b, np.uint64) +assert_type(u8 & b, np.uint64) + +assert_type(b_ << b_, np.int8) +assert_type(b_ >> b_, np.int8) +assert_type(b_ | b_, np.bool_) +assert_type(b_ ^ b_, np.bool_) +assert_type(b_ & b_, np.bool_) + +assert_type(b_ << AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ >> AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ | AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ ^ AR, npt.NDArray[np.signedinteger[Any]]) +assert_type(b_ & AR, npt.NDArray[np.signedinteger[Any]]) + +assert_type(b_ << b, np.int8) +assert_type(b_ >> b, np.int8) +assert_type(b_ | b, np.bool_) +assert_type(b_ ^ b, np.bool_) +assert_type(b_ & b, np.bool_) + +assert_type(b_ << i, np.int_) +assert_type(b_ >> i, np.int_) +assert_type(b_ | i, np.int_) +assert_type(b_ ^ i, np.int_) +assert_type(b_ & i, np.int_) + +assert_type(~i8, np.int64) +assert_type(~i4, np.int32) +assert_type(~u8, np.uint64) +assert_type(~u4, np.uint32) +assert_type(~b_, np.bool_) +assert_type(~AR, npt.NDArray[np.int32]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/char.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/char.pyi index 0563b34727..e15ed0801a 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/char.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/char.pyi @@ -1,147 +1,154 @@ +import sys +from typing import Any + import numpy as np import numpy.typing as npt -from collections.abc import Sequence + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR_U: npt.NDArray[np.str_] AR_S: npt.NDArray[np.bytes_] -reveal_type(np.char.equal(AR_U, AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.equal(AR_S, AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.equal(AR_U, AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.equal(AR_S, AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.not_equal(AR_U, AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.not_equal(AR_S, AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.not_equal(AR_U, AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.not_equal(AR_S, AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.greater_equal(AR_U, AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.greater_equal(AR_S, AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.greater_equal(AR_U, AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.greater_equal(AR_S, AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.less_equal(AR_U, AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.less_equal(AR_S, AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.less_equal(AR_U, AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.less_equal(AR_S, AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.greater(AR_U, AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.greater(AR_S, AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.greater(AR_U, AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.greater(AR_S, AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.less(AR_U, AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.less(AR_S, AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.less(AR_U, AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.less(AR_S, AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.multiply(AR_U, 5)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.multiply(AR_S, [5, 4, 3])) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.multiply(AR_U, 5), npt.NDArray[np.str_]) +assert_type(np.char.multiply(AR_S, [5, 4, 3]), npt.NDArray[np.bytes_]) -reveal_type(np.char.mod(AR_U, "test")) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.mod(AR_S, "test")) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.mod(AR_U, "test"), npt.NDArray[np.str_]) +assert_type(np.char.mod(AR_S, "test"), npt.NDArray[np.bytes_]) -reveal_type(np.char.capitalize(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.capitalize(AR_S)) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.capitalize(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.capitalize(AR_S), npt.NDArray[np.bytes_]) -reveal_type(np.char.center(AR_U, 5)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.center(AR_S, [2, 3, 4], b"a")) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.center(AR_U, 5), npt.NDArray[np.str_]) +assert_type(np.char.center(AR_S, [2, 3, 4], b"a"), npt.NDArray[np.bytes_]) -reveal_type(np.char.encode(AR_U)) # E: ndarray[Any, dtype[bytes_]] -reveal_type(np.char.decode(AR_S)) # E: ndarray[Any, dtype[str_]] +assert_type(np.char.encode(AR_U), npt.NDArray[np.bytes_]) +assert_type(np.char.decode(AR_S), npt.NDArray[np.str_]) -reveal_type(np.char.expandtabs(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.expandtabs(AR_S, tabsize=4)) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.expandtabs(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.expandtabs(AR_S, tabsize=4), npt.NDArray[np.bytes_]) -reveal_type(np.char.join(AR_U, "_")) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.join(AR_S, [b"_", b""])) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.join(AR_U, "_"), npt.NDArray[np.str_]) +assert_type(np.char.join(AR_S, [b"_", b""]), npt.NDArray[np.bytes_]) -reveal_type(np.char.ljust(AR_U, 5)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.ljust(AR_S, [4, 3, 1], fillchar=[b"a", b"b", b"c"])) # E: ndarray[Any, dtype[bytes_]] -reveal_type(np.char.rjust(AR_U, 5)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.rjust(AR_S, [4, 3, 1], fillchar=[b"a", b"b", b"c"])) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.ljust(AR_U, 5), npt.NDArray[np.str_]) +assert_type(np.char.ljust(AR_S, [4, 3, 1], fillchar=[b"a", b"b", b"c"]), npt.NDArray[np.bytes_]) +assert_type(np.char.rjust(AR_U, 5), npt.NDArray[np.str_]) +assert_type(np.char.rjust(AR_S, [4, 3, 1], fillchar=[b"a", b"b", b"c"]), npt.NDArray[np.bytes_]) -reveal_type(np.char.lstrip(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.lstrip(AR_S, chars=b"_")) # E: ndarray[Any, dtype[bytes_]] -reveal_type(np.char.rstrip(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.rstrip(AR_S, chars=b"_")) # E: ndarray[Any, dtype[bytes_]] -reveal_type(np.char.strip(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.strip(AR_S, chars=b"_")) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.lstrip(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.lstrip(AR_S, chars=b"_"), npt.NDArray[np.bytes_]) +assert_type(np.char.rstrip(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.rstrip(AR_S, chars=b"_"), npt.NDArray[np.bytes_]) +assert_type(np.char.strip(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.strip(AR_S, chars=b"_"), npt.NDArray[np.bytes_]) -reveal_type(np.char.partition(AR_U, "\n")) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.partition(AR_S, [b"a", b"b", b"c"])) # E: ndarray[Any, dtype[bytes_]] -reveal_type(np.char.rpartition(AR_U, "\n")) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.rpartition(AR_S, [b"a", b"b", b"c"])) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.partition(AR_U, "\n"), npt.NDArray[np.str_]) +assert_type(np.char.partition(AR_S, [b"a", b"b", b"c"]), npt.NDArray[np.bytes_]) +assert_type(np.char.rpartition(AR_U, "\n"), npt.NDArray[np.str_]) +assert_type(np.char.rpartition(AR_S, [b"a", b"b", b"c"]), npt.NDArray[np.bytes_]) -reveal_type(np.char.replace(AR_U, "_", "-")) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.replace(AR_S, [b"_", b""], [b"a", b"b"])) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.replace(AR_U, "_", "-"), npt.NDArray[np.str_]) +assert_type(np.char.replace(AR_S, [b"_", b""], [b"a", b"b"]), npt.NDArray[np.bytes_]) -reveal_type(np.char.split(AR_U, "_")) # E: ndarray[Any, dtype[object_]] -reveal_type(np.char.split(AR_S, maxsplit=[1, 2, 3])) # E: ndarray[Any, dtype[object_]] -reveal_type(np.char.rsplit(AR_U, "_")) # E: ndarray[Any, dtype[object_]] -reveal_type(np.char.rsplit(AR_S, maxsplit=[1, 2, 3])) # E: ndarray[Any, dtype[object_]] +assert_type(np.char.split(AR_U, "_"), npt.NDArray[np.object_]) +assert_type(np.char.split(AR_S, maxsplit=[1, 2, 3]), npt.NDArray[np.object_]) +assert_type(np.char.rsplit(AR_U, "_"), npt.NDArray[np.object_]) +assert_type(np.char.rsplit(AR_S, maxsplit=[1, 2, 3]), npt.NDArray[np.object_]) -reveal_type(np.char.splitlines(AR_U)) # E: ndarray[Any, dtype[object_]] -reveal_type(np.char.splitlines(AR_S, keepends=[True, True, False])) # E: ndarray[Any, dtype[object_]] +assert_type(np.char.splitlines(AR_U), npt.NDArray[np.object_]) +assert_type(np.char.splitlines(AR_S, keepends=[True, True, False]), npt.NDArray[np.object_]) -reveal_type(np.char.swapcase(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.swapcase(AR_S)) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.swapcase(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.swapcase(AR_S), npt.NDArray[np.bytes_]) -reveal_type(np.char.title(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.title(AR_S)) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.title(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.title(AR_S), npt.NDArray[np.bytes_]) -reveal_type(np.char.upper(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.upper(AR_S)) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.upper(AR_U), npt.NDArray[np.str_]) +assert_type(np.char.upper(AR_S), npt.NDArray[np.bytes_]) -reveal_type(np.char.zfill(AR_U, 5)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.char.zfill(AR_S, [2, 3, 4])) # E: ndarray[Any, dtype[bytes_]] +assert_type(np.char.zfill(AR_U, 5), npt.NDArray[np.str_]) +assert_type(np.char.zfill(AR_S, [2, 3, 4]), npt.NDArray[np.bytes_]) -reveal_type(np.char.count(AR_U, "a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.count(AR_S, [b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] +assert_type(np.char.count(AR_U, "a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(np.char.count(AR_S, [b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) -reveal_type(np.char.endswith(AR_U, "a", start=[1, 2, 3])) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.endswith(AR_S, [b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.startswith(AR_U, "a", start=[1, 2, 3])) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.startswith(AR_S, [b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.endswith(AR_U, "a", start=[1, 2, 3]), npt.NDArray[np.bool_]) +assert_type(np.char.endswith(AR_S, [b"a", b"b", b"c"], end=9), npt.NDArray[np.bool_]) +assert_type(np.char.startswith(AR_U, "a", start=[1, 2, 3]), npt.NDArray[np.bool_]) +assert_type(np.char.startswith(AR_S, [b"a", b"b", b"c"], end=9), npt.NDArray[np.bool_]) -reveal_type(np.char.find(AR_U, "a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.find(AR_S, [b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.rfind(AR_U, "a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.rfind(AR_S, [b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] +assert_type(np.char.find(AR_U, "a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(np.char.find(AR_S, [b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) +assert_type(np.char.rfind(AR_U, "a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(np.char.rfind(AR_S, [b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) -reveal_type(np.char.index(AR_U, "a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.index(AR_S, [b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.rindex(AR_U, "a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.rindex(AR_S, [b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] +assert_type(np.char.index(AR_U, "a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(np.char.index(AR_S, [b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) +assert_type(np.char.rindex(AR_U, "a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(np.char.rindex(AR_S, [b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) -reveal_type(np.char.isalpha(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.isalpha(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.isalpha(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.isalpha(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.isalnum(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.isalnum(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.isalnum(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.isalnum(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.isdecimal(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.isdecimal(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.isdecimal(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.isdecimal(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.isdigit(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.isdigit(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.isdigit(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.isdigit(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.islower(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.islower(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.islower(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.islower(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.isnumeric(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.isnumeric(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.isnumeric(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.isnumeric(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.isspace(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.isspace(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.isspace(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.isspace(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.istitle(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.istitle(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.istitle(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.istitle(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.isupper(AR_U)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.char.isupper(AR_S)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.char.isupper(AR_U), npt.NDArray[np.bool_]) +assert_type(np.char.isupper(AR_S), npt.NDArray[np.bool_]) -reveal_type(np.char.str_len(AR_U)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.char.str_len(AR_S)) # E: ndarray[Any, dtype[{int_}]] +assert_type(np.char.str_len(AR_U), npt.NDArray[np.int_]) +assert_type(np.char.str_len(AR_S), npt.NDArray[np.int_]) -reveal_type(np.char.array(AR_U)) # E: chararray[Any, dtype[str_]] -reveal_type(np.char.array(AR_S, order="K")) # E: chararray[Any, dtype[bytes_]] -reveal_type(np.char.array("bob", copy=True)) # E: chararray[Any, dtype[str_]] -reveal_type(np.char.array(b"bob", itemsize=5)) # E: chararray[Any, dtype[bytes_]] -reveal_type(np.char.array(1, unicode=False)) # E: chararray[Any, dtype[bytes_]] -reveal_type(np.char.array(1, unicode=True)) # E: chararray[Any, dtype[str_]] +assert_type(np.char.array(AR_U), np.chararray[Any, np.dtype[np.str_]]) +assert_type(np.char.array(AR_S, order="K"), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(np.char.array("bob", copy=True), np.chararray[Any, np.dtype[np.str_]]) +assert_type(np.char.array(b"bob", itemsize=5), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(np.char.array(1, unicode=False), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(np.char.array(1, unicode=True), np.chararray[Any, np.dtype[np.str_]]) -reveal_type(np.char.asarray(AR_U)) # E: chararray[Any, dtype[str_]] -reveal_type(np.char.asarray(AR_S, order="K")) # E: chararray[Any, dtype[bytes_]] -reveal_type(np.char.asarray("bob")) # E: chararray[Any, dtype[str_]] -reveal_type(np.char.asarray(b"bob", itemsize=5)) # E: chararray[Any, dtype[bytes_]] -reveal_type(np.char.asarray(1, unicode=False)) # E: chararray[Any, dtype[bytes_]] -reveal_type(np.char.asarray(1, unicode=True)) # E: chararray[Any, dtype[str_]] +assert_type(np.char.asarray(AR_U), np.chararray[Any, np.dtype[np.str_]]) +assert_type(np.char.asarray(AR_S, order="K"), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(np.char.asarray("bob"), np.chararray[Any, np.dtype[np.str_]]) +assert_type(np.char.asarray(b"bob", itemsize=5), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(np.char.asarray(1, unicode=False), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(np.char.asarray(1, unicode=True), np.chararray[Any, np.dtype[np.str_]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/chararray.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/chararray.pyi index 61906c8606..4bcbeda2e6 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/chararray.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/chararray.pyi @@ -1,132 +1,140 @@ -import numpy as np +import sys from typing import Any +import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_U: np.chararray[Any, np.dtype[np.str_]] AR_S: np.chararray[Any, np.dtype[np.bytes_]] -reveal_type(AR_U == AR_U) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S == AR_S) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U == AR_U, npt.NDArray[np.bool_]) +assert_type(AR_S == AR_S, npt.NDArray[np.bool_]) -reveal_type(AR_U != AR_U) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S != AR_S) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U != AR_U, npt.NDArray[np.bool_]) +assert_type(AR_S != AR_S, npt.NDArray[np.bool_]) -reveal_type(AR_U >= AR_U) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S >= AR_S) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U >= AR_U, npt.NDArray[np.bool_]) +assert_type(AR_S >= AR_S, npt.NDArray[np.bool_]) -reveal_type(AR_U <= AR_U) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S <= AR_S) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U <= AR_U, npt.NDArray[np.bool_]) +assert_type(AR_S <= AR_S, npt.NDArray[np.bool_]) -reveal_type(AR_U > AR_U) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S > AR_S) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U > AR_U, npt.NDArray[np.bool_]) +assert_type(AR_S > AR_S, npt.NDArray[np.bool_]) -reveal_type(AR_U < AR_U) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S < AR_S) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U < AR_U, npt.NDArray[np.bool_]) +assert_type(AR_S < AR_S, npt.NDArray[np.bool_]) -reveal_type(AR_U * 5) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S * [5]) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U * 5, np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S * [5], np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U % "test") # E: chararray[Any, dtype[str_]] -reveal_type(AR_S % b"test") # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U % "test", np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S % b"test", np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.capitalize()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.capitalize()) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.capitalize(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.capitalize(), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.center(5)) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.center([2, 3, 4], b"a")) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.center(5), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.center([2, 3, 4], b"a"), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.encode()) # E: chararray[Any, dtype[bytes_]] -reveal_type(AR_S.decode()) # E: chararray[Any, dtype[str_]] +assert_type(AR_U.encode(), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(AR_S.decode(), np.chararray[Any, np.dtype[np.str_]]) -reveal_type(AR_U.expandtabs()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.expandtabs(tabsize=4)) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.expandtabs(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.expandtabs(tabsize=4), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.join("_")) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.join([b"_", b""])) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.join("_"), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.join([b"_", b""]), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.ljust(5)) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.ljust([4, 3, 1], fillchar=[b"a", b"b", b"c"])) # E: chararray[Any, dtype[bytes_]] -reveal_type(AR_U.rjust(5)) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.rjust([4, 3, 1], fillchar=[b"a", b"b", b"c"])) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.ljust(5), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.ljust([4, 3, 1], fillchar=[b"a", b"b", b"c"]), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(AR_U.rjust(5), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.rjust([4, 3, 1], fillchar=[b"a", b"b", b"c"]), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.lstrip()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.lstrip(chars=b"_")) # E: chararray[Any, dtype[bytes_]] -reveal_type(AR_U.rstrip()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.rstrip(chars=b"_")) # E: chararray[Any, dtype[bytes_]] -reveal_type(AR_U.strip()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.strip(chars=b"_")) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.lstrip(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.lstrip(chars=b"_"), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(AR_U.rstrip(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.rstrip(chars=b"_"), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(AR_U.strip(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.strip(chars=b"_"), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.partition("\n")) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.partition([b"a", b"b", b"c"])) # E: chararray[Any, dtype[bytes_]] -reveal_type(AR_U.rpartition("\n")) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.rpartition([b"a", b"b", b"c"])) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.partition("\n"), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.partition([b"a", b"b", b"c"]), np.chararray[Any, np.dtype[np.bytes_]]) +assert_type(AR_U.rpartition("\n"), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.rpartition([b"a", b"b", b"c"]), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.replace("_", "-")) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.replace([b"_", b""], [b"a", b"b"])) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.replace("_", "-"), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.replace([b"_", b""], [b"a", b"b"]), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.split("_")) # E: ndarray[Any, dtype[object_]] -reveal_type(AR_S.split(maxsplit=[1, 2, 3])) # E: ndarray[Any, dtype[object_]] -reveal_type(AR_U.rsplit("_")) # E: ndarray[Any, dtype[object_]] -reveal_type(AR_S.rsplit(maxsplit=[1, 2, 3])) # E: ndarray[Any, dtype[object_]] +assert_type(AR_U.split("_"), npt.NDArray[np.object_]) +assert_type(AR_S.split(maxsplit=[1, 2, 3]), npt.NDArray[np.object_]) +assert_type(AR_U.rsplit("_"), npt.NDArray[np.object_]) +assert_type(AR_S.rsplit(maxsplit=[1, 2, 3]), npt.NDArray[np.object_]) -reveal_type(AR_U.splitlines()) # E: ndarray[Any, dtype[object_]] -reveal_type(AR_S.splitlines(keepends=[True, True, False])) # E: ndarray[Any, dtype[object_]] +assert_type(AR_U.splitlines(), npt.NDArray[np.object_]) +assert_type(AR_S.splitlines(keepends=[True, True, False]), npt.NDArray[np.object_]) -reveal_type(AR_U.swapcase()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.swapcase()) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.swapcase(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.swapcase(), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.title()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.title()) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.title(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.title(), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.upper()) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.upper()) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.upper(), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.upper(), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.zfill(5)) # E: chararray[Any, dtype[str_]] -reveal_type(AR_S.zfill([2, 3, 4])) # E: chararray[Any, dtype[bytes_]] +assert_type(AR_U.zfill(5), np.chararray[Any, np.dtype[np.str_]]) +assert_type(AR_S.zfill([2, 3, 4]), np.chararray[Any, np.dtype[np.bytes_]]) -reveal_type(AR_U.count("a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(AR_S.count([b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] +assert_type(AR_U.count("a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(AR_S.count([b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) -reveal_type(AR_U.endswith("a", start=[1, 2, 3])) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.endswith([b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_U.startswith("a", start=[1, 2, 3])) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.startswith([b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.endswith("a", start=[1, 2, 3]), npt.NDArray[np.bool_]) +assert_type(AR_S.endswith([b"a", b"b", b"c"], end=9), npt.NDArray[np.bool_]) +assert_type(AR_U.startswith("a", start=[1, 2, 3]), npt.NDArray[np.bool_]) +assert_type(AR_S.startswith([b"a", b"b", b"c"], end=9), npt.NDArray[np.bool_]) -reveal_type(AR_U.find("a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(AR_S.find([b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(AR_U.rfind("a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(AR_S.rfind([b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] +assert_type(AR_U.find("a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(AR_S.find([b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) +assert_type(AR_U.rfind("a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(AR_S.rfind([b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) -reveal_type(AR_U.index("a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(AR_S.index([b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(AR_U.rindex("a", start=[1, 2, 3])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(AR_S.rindex([b"a", b"b", b"c"], end=9)) # E: ndarray[Any, dtype[{int_}]] +assert_type(AR_U.index("a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(AR_S.index([b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) +assert_type(AR_U.rindex("a", start=[1, 2, 3]), npt.NDArray[np.int_]) +assert_type(AR_S.rindex([b"a", b"b", b"c"], end=9), npt.NDArray[np.int_]) -reveal_type(AR_U.isalpha()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.isalpha()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.isalpha(), npt.NDArray[np.bool_]) +assert_type(AR_S.isalpha(), npt.NDArray[np.bool_]) -reveal_type(AR_U.isalnum()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.isalnum()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.isalnum(), npt.NDArray[np.bool_]) +assert_type(AR_S.isalnum(), npt.NDArray[np.bool_]) -reveal_type(AR_U.isdecimal()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.isdecimal()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.isdecimal(), npt.NDArray[np.bool_]) +assert_type(AR_S.isdecimal(), npt.NDArray[np.bool_]) -reveal_type(AR_U.isdigit()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.isdigit()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.isdigit(), npt.NDArray[np.bool_]) +assert_type(AR_S.isdigit(), npt.NDArray[np.bool_]) -reveal_type(AR_U.islower()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.islower()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.islower(), npt.NDArray[np.bool_]) +assert_type(AR_S.islower(), npt.NDArray[np.bool_]) -reveal_type(AR_U.isnumeric()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.isnumeric()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.isnumeric(), npt.NDArray[np.bool_]) +assert_type(AR_S.isnumeric(), npt.NDArray[np.bool_]) -reveal_type(AR_U.isspace()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.isspace()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.isspace(), npt.NDArray[np.bool_]) +assert_type(AR_S.isspace(), npt.NDArray[np.bool_]) -reveal_type(AR_U.istitle()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.istitle()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.istitle(), npt.NDArray[np.bool_]) +assert_type(AR_S.istitle(), npt.NDArray[np.bool_]) -reveal_type(AR_U.isupper()) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR_S.isupper()) # E: ndarray[Any, dtype[bool_]] +assert_type(AR_U.isupper(), npt.NDArray[np.bool_]) +assert_type(AR_S.isupper(), npt.NDArray[np.bool_]) -reveal_type(AR_U.__array_finalize__(object())) # E: None -reveal_type(AR_S.__array_finalize__(object())) # E: None +assert_type(AR_U.__array_finalize__(object()), None) +assert_type(AR_S.__array_finalize__(object()), None) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/comparisons.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/comparisons.pyi index 9b32f40576..5765302a02 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/comparisons.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/comparisons.pyi @@ -1,6 +1,15 @@ -import numpy as np +import sys import fractions import decimal +from typing import Any + +import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type c16 = np.complex128() f8 = np.float64() @@ -29,233 +38,233 @@ SEQ = (0, 1, 2, 3, 4) # object-like comparisons -reveal_type(i8 > fractions.Fraction(1, 5)) # E: Any -reveal_type(i8 > [fractions.Fraction(1, 5)]) # E: Any -reveal_type(i8 > decimal.Decimal("1.5")) # E: Any -reveal_type(i8 > [decimal.Decimal("1.5")]) # E: Any +assert_type(i8 > fractions.Fraction(1, 5), Any) +assert_type(i8 > [fractions.Fraction(1, 5)], Any) +assert_type(i8 > decimal.Decimal("1.5"), Any) +assert_type(i8 > [decimal.Decimal("1.5")], Any) # Time structures -reveal_type(dt > dt) # E: bool_ +assert_type(dt > dt, np.bool_) -reveal_type(td > td) # E: bool_ -reveal_type(td > i) # E: bool_ -reveal_type(td > i4) # E: bool_ -reveal_type(td > i8) # E: bool_ +assert_type(td > td, np.bool_) +assert_type(td > i, np.bool_) +assert_type(td > i4, np.bool_) +assert_type(td > i8, np.bool_) -reveal_type(td > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(td > SEQ) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR > SEQ) # E: ndarray[Any, dtype[bool_]] -reveal_type(AR > td) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > td) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > AR) # E: ndarray[Any, dtype[bool_]] +assert_type(td > AR, npt.NDArray[np.bool_]) +assert_type(td > SEQ, npt.NDArray[np.bool_]) +assert_type(AR > SEQ, npt.NDArray[np.bool_]) +assert_type(AR > td, npt.NDArray[np.bool_]) +assert_type(SEQ > td, npt.NDArray[np.bool_]) +assert_type(SEQ > AR, npt.NDArray[np.bool_]) # boolean -reveal_type(b_ > b) # E: bool_ -reveal_type(b_ > b_) # E: bool_ -reveal_type(b_ > i) # E: bool_ -reveal_type(b_ > i8) # E: bool_ -reveal_type(b_ > i4) # E: bool_ -reveal_type(b_ > u8) # E: bool_ -reveal_type(b_ > u4) # E: bool_ -reveal_type(b_ > f) # E: bool_ -reveal_type(b_ > f8) # E: bool_ -reveal_type(b_ > f4) # E: bool_ -reveal_type(b_ > c) # E: bool_ -reveal_type(b_ > c16) # E: bool_ -reveal_type(b_ > c8) # E: bool_ -reveal_type(b_ > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(b_ > SEQ) # E: ndarray[Any, dtype[bool_]] +assert_type(b_ > b, np.bool_) +assert_type(b_ > b_, np.bool_) +assert_type(b_ > i, np.bool_) +assert_type(b_ > i8, np.bool_) +assert_type(b_ > i4, np.bool_) +assert_type(b_ > u8, np.bool_) +assert_type(b_ > u4, np.bool_) +assert_type(b_ > f, np.bool_) +assert_type(b_ > f8, np.bool_) +assert_type(b_ > f4, np.bool_) +assert_type(b_ > c, np.bool_) +assert_type(b_ > c16, np.bool_) +assert_type(b_ > c8, np.bool_) +assert_type(b_ > AR, npt.NDArray[np.bool_]) +assert_type(b_ > SEQ, npt.NDArray[np.bool_]) # Complex -reveal_type(c16 > c16) # E: bool_ -reveal_type(c16 > f8) # E: bool_ -reveal_type(c16 > i8) # E: bool_ -reveal_type(c16 > c8) # E: bool_ -reveal_type(c16 > f4) # E: bool_ -reveal_type(c16 > i4) # E: bool_ -reveal_type(c16 > b_) # E: bool_ -reveal_type(c16 > b) # E: bool_ -reveal_type(c16 > c) # E: bool_ -reveal_type(c16 > f) # E: bool_ -reveal_type(c16 > i) # E: bool_ -reveal_type(c16 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(c16 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(c16 > c16) # E: bool_ -reveal_type(f8 > c16) # E: bool_ -reveal_type(i8 > c16) # E: bool_ -reveal_type(c8 > c16) # E: bool_ -reveal_type(f4 > c16) # E: bool_ -reveal_type(i4 > c16) # E: bool_ -reveal_type(b_ > c16) # E: bool_ -reveal_type(b > c16) # E: bool_ -reveal_type(c > c16) # E: bool_ -reveal_type(f > c16) # E: bool_ -reveal_type(i > c16) # E: bool_ -reveal_type(AR > c16) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > c16) # E: ndarray[Any, dtype[bool_]] - -reveal_type(c8 > c16) # E: bool_ -reveal_type(c8 > f8) # E: bool_ -reveal_type(c8 > i8) # E: bool_ -reveal_type(c8 > c8) # E: bool_ -reveal_type(c8 > f4) # E: bool_ -reveal_type(c8 > i4) # E: bool_ -reveal_type(c8 > b_) # E: bool_ -reveal_type(c8 > b) # E: bool_ -reveal_type(c8 > c) # E: bool_ -reveal_type(c8 > f) # E: bool_ -reveal_type(c8 > i) # E: bool_ -reveal_type(c8 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(c8 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(c16 > c8) # E: bool_ -reveal_type(f8 > c8) # E: bool_ -reveal_type(i8 > c8) # E: bool_ -reveal_type(c8 > c8) # E: bool_ -reveal_type(f4 > c8) # E: bool_ -reveal_type(i4 > c8) # E: bool_ -reveal_type(b_ > c8) # E: bool_ -reveal_type(b > c8) # E: bool_ -reveal_type(c > c8) # E: bool_ -reveal_type(f > c8) # E: bool_ -reveal_type(i > c8) # E: bool_ -reveal_type(AR > c8) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > c8) # E: ndarray[Any, dtype[bool_]] +assert_type(c16 > c16, np.bool_) +assert_type(c16 > f8, np.bool_) +assert_type(c16 > i8, np.bool_) +assert_type(c16 > c8, np.bool_) +assert_type(c16 > f4, np.bool_) +assert_type(c16 > i4, np.bool_) +assert_type(c16 > b_, np.bool_) +assert_type(c16 > b, np.bool_) +assert_type(c16 > c, np.bool_) +assert_type(c16 > f, np.bool_) +assert_type(c16 > i, np.bool_) +assert_type(c16 > AR, npt.NDArray[np.bool_]) +assert_type(c16 > SEQ, npt.NDArray[np.bool_]) + +assert_type(c16 > c16, np.bool_) +assert_type(f8 > c16, np.bool_) +assert_type(i8 > c16, np.bool_) +assert_type(c8 > c16, np.bool_) +assert_type(f4 > c16, np.bool_) +assert_type(i4 > c16, np.bool_) +assert_type(b_ > c16, np.bool_) +assert_type(b > c16, np.bool_) +assert_type(c > c16, np.bool_) +assert_type(f > c16, np.bool_) +assert_type(i > c16, np.bool_) +assert_type(AR > c16, npt.NDArray[np.bool_]) +assert_type(SEQ > c16, npt.NDArray[np.bool_]) + +assert_type(c8 > c16, np.bool_) +assert_type(c8 > f8, np.bool_) +assert_type(c8 > i8, np.bool_) +assert_type(c8 > c8, np.bool_) +assert_type(c8 > f4, np.bool_) +assert_type(c8 > i4, np.bool_) +assert_type(c8 > b_, np.bool_) +assert_type(c8 > b, np.bool_) +assert_type(c8 > c, np.bool_) +assert_type(c8 > f, np.bool_) +assert_type(c8 > i, np.bool_) +assert_type(c8 > AR, npt.NDArray[np.bool_]) +assert_type(c8 > SEQ, npt.NDArray[np.bool_]) + +assert_type(c16 > c8, np.bool_) +assert_type(f8 > c8, np.bool_) +assert_type(i8 > c8, np.bool_) +assert_type(c8 > c8, np.bool_) +assert_type(f4 > c8, np.bool_) +assert_type(i4 > c8, np.bool_) +assert_type(b_ > c8, np.bool_) +assert_type(b > c8, np.bool_) +assert_type(c > c8, np.bool_) +assert_type(f > c8, np.bool_) +assert_type(i > c8, np.bool_) +assert_type(AR > c8, npt.NDArray[np.bool_]) +assert_type(SEQ > c8, npt.NDArray[np.bool_]) # Float -reveal_type(f8 > f8) # E: bool_ -reveal_type(f8 > i8) # E: bool_ -reveal_type(f8 > f4) # E: bool_ -reveal_type(f8 > i4) # E: bool_ -reveal_type(f8 > b_) # E: bool_ -reveal_type(f8 > b) # E: bool_ -reveal_type(f8 > c) # E: bool_ -reveal_type(f8 > f) # E: bool_ -reveal_type(f8 > i) # E: bool_ -reveal_type(f8 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(f8 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(f8 > f8) # E: bool_ -reveal_type(i8 > f8) # E: bool_ -reveal_type(f4 > f8) # E: bool_ -reveal_type(i4 > f8) # E: bool_ -reveal_type(b_ > f8) # E: bool_ -reveal_type(b > f8) # E: bool_ -reveal_type(c > f8) # E: bool_ -reveal_type(f > f8) # E: bool_ -reveal_type(i > f8) # E: bool_ -reveal_type(AR > f8) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > f8) # E: ndarray[Any, dtype[bool_]] - -reveal_type(f4 > f8) # E: bool_ -reveal_type(f4 > i8) # E: bool_ -reveal_type(f4 > f4) # E: bool_ -reveal_type(f4 > i4) # E: bool_ -reveal_type(f4 > b_) # E: bool_ -reveal_type(f4 > b) # E: bool_ -reveal_type(f4 > c) # E: bool_ -reveal_type(f4 > f) # E: bool_ -reveal_type(f4 > i) # E: bool_ -reveal_type(f4 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(f4 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(f8 > f4) # E: bool_ -reveal_type(i8 > f4) # E: bool_ -reveal_type(f4 > f4) # E: bool_ -reveal_type(i4 > f4) # E: bool_ -reveal_type(b_ > f4) # E: bool_ -reveal_type(b > f4) # E: bool_ -reveal_type(c > f4) # E: bool_ -reveal_type(f > f4) # E: bool_ -reveal_type(i > f4) # E: bool_ -reveal_type(AR > f4) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > f4) # E: ndarray[Any, dtype[bool_]] +assert_type(f8 > f8, np.bool_) +assert_type(f8 > i8, np.bool_) +assert_type(f8 > f4, np.bool_) +assert_type(f8 > i4, np.bool_) +assert_type(f8 > b_, np.bool_) +assert_type(f8 > b, np.bool_) +assert_type(f8 > c, np.bool_) +assert_type(f8 > f, np.bool_) +assert_type(f8 > i, np.bool_) +assert_type(f8 > AR, npt.NDArray[np.bool_]) +assert_type(f8 > SEQ, npt.NDArray[np.bool_]) + +assert_type(f8 > f8, np.bool_) +assert_type(i8 > f8, np.bool_) +assert_type(f4 > f8, np.bool_) +assert_type(i4 > f8, np.bool_) +assert_type(b_ > f8, np.bool_) +assert_type(b > f8, np.bool_) +assert_type(c > f8, np.bool_) +assert_type(f > f8, np.bool_) +assert_type(i > f8, np.bool_) +assert_type(AR > f8, npt.NDArray[np.bool_]) +assert_type(SEQ > f8, npt.NDArray[np.bool_]) + +assert_type(f4 > f8, np.bool_) +assert_type(f4 > i8, np.bool_) +assert_type(f4 > f4, np.bool_) +assert_type(f4 > i4, np.bool_) +assert_type(f4 > b_, np.bool_) +assert_type(f4 > b, np.bool_) +assert_type(f4 > c, np.bool_) +assert_type(f4 > f, np.bool_) +assert_type(f4 > i, np.bool_) +assert_type(f4 > AR, npt.NDArray[np.bool_]) +assert_type(f4 > SEQ, npt.NDArray[np.bool_]) + +assert_type(f8 > f4, np.bool_) +assert_type(i8 > f4, np.bool_) +assert_type(f4 > f4, np.bool_) +assert_type(i4 > f4, np.bool_) +assert_type(b_ > f4, np.bool_) +assert_type(b > f4, np.bool_) +assert_type(c > f4, np.bool_) +assert_type(f > f4, np.bool_) +assert_type(i > f4, np.bool_) +assert_type(AR > f4, npt.NDArray[np.bool_]) +assert_type(SEQ > f4, npt.NDArray[np.bool_]) # Int -reveal_type(i8 > i8) # E: bool_ -reveal_type(i8 > u8) # E: bool_ -reveal_type(i8 > i4) # E: bool_ -reveal_type(i8 > u4) # E: bool_ -reveal_type(i8 > b_) # E: bool_ -reveal_type(i8 > b) # E: bool_ -reveal_type(i8 > c) # E: bool_ -reveal_type(i8 > f) # E: bool_ -reveal_type(i8 > i) # E: bool_ -reveal_type(i8 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(i8 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(u8 > u8) # E: bool_ -reveal_type(u8 > i4) # E: bool_ -reveal_type(u8 > u4) # E: bool_ -reveal_type(u8 > b_) # E: bool_ -reveal_type(u8 > b) # E: bool_ -reveal_type(u8 > c) # E: bool_ -reveal_type(u8 > f) # E: bool_ -reveal_type(u8 > i) # E: bool_ -reveal_type(u8 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(u8 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(i8 > i8) # E: bool_ -reveal_type(u8 > i8) # E: bool_ -reveal_type(i4 > i8) # E: bool_ -reveal_type(u4 > i8) # E: bool_ -reveal_type(b_ > i8) # E: bool_ -reveal_type(b > i8) # E: bool_ -reveal_type(c > i8) # E: bool_ -reveal_type(f > i8) # E: bool_ -reveal_type(i > i8) # E: bool_ -reveal_type(AR > i8) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > i8) # E: ndarray[Any, dtype[bool_]] - -reveal_type(u8 > u8) # E: bool_ -reveal_type(i4 > u8) # E: bool_ -reveal_type(u4 > u8) # E: bool_ -reveal_type(b_ > u8) # E: bool_ -reveal_type(b > u8) # E: bool_ -reveal_type(c > u8) # E: bool_ -reveal_type(f > u8) # E: bool_ -reveal_type(i > u8) # E: bool_ -reveal_type(AR > u8) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > u8) # E: ndarray[Any, dtype[bool_]] - -reveal_type(i4 > i8) # E: bool_ -reveal_type(i4 > i4) # E: bool_ -reveal_type(i4 > i) # E: bool_ -reveal_type(i4 > b_) # E: bool_ -reveal_type(i4 > b) # E: bool_ -reveal_type(i4 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(i4 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(u4 > i8) # E: bool_ -reveal_type(u4 > i4) # E: bool_ -reveal_type(u4 > u8) # E: bool_ -reveal_type(u4 > u4) # E: bool_ -reveal_type(u4 > i) # E: bool_ -reveal_type(u4 > b_) # E: bool_ -reveal_type(u4 > b) # E: bool_ -reveal_type(u4 > AR) # E: ndarray[Any, dtype[bool_]] -reveal_type(u4 > SEQ) # E: ndarray[Any, dtype[bool_]] - -reveal_type(i8 > i4) # E: bool_ -reveal_type(i4 > i4) # E: bool_ -reveal_type(i > i4) # E: bool_ -reveal_type(b_ > i4) # E: bool_ -reveal_type(b > i4) # E: bool_ -reveal_type(AR > i4) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > i4) # E: ndarray[Any, dtype[bool_]] - -reveal_type(i8 > u4) # E: bool_ -reveal_type(i4 > u4) # E: bool_ -reveal_type(u8 > u4) # E: bool_ -reveal_type(u4 > u4) # E: bool_ -reveal_type(b_ > u4) # E: bool_ -reveal_type(b > u4) # E: bool_ -reveal_type(i > u4) # E: bool_ -reveal_type(AR > u4) # E: ndarray[Any, dtype[bool_]] -reveal_type(SEQ > u4) # E: ndarray[Any, dtype[bool_]] +assert_type(i8 > i8, np.bool_) +assert_type(i8 > u8, np.bool_) +assert_type(i8 > i4, np.bool_) +assert_type(i8 > u4, np.bool_) +assert_type(i8 > b_, np.bool_) +assert_type(i8 > b, np.bool_) +assert_type(i8 > c, np.bool_) +assert_type(i8 > f, np.bool_) +assert_type(i8 > i, np.bool_) +assert_type(i8 > AR, npt.NDArray[np.bool_]) +assert_type(i8 > SEQ, npt.NDArray[np.bool_]) + +assert_type(u8 > u8, np.bool_) +assert_type(u8 > i4, np.bool_) +assert_type(u8 > u4, np.bool_) +assert_type(u8 > b_, np.bool_) +assert_type(u8 > b, np.bool_) +assert_type(u8 > c, np.bool_) +assert_type(u8 > f, np.bool_) +assert_type(u8 > i, np.bool_) +assert_type(u8 > AR, npt.NDArray[np.bool_]) +assert_type(u8 > SEQ, npt.NDArray[np.bool_]) + +assert_type(i8 > i8, np.bool_) +assert_type(u8 > i8, np.bool_) +assert_type(i4 > i8, np.bool_) +assert_type(u4 > i8, np.bool_) +assert_type(b_ > i8, np.bool_) +assert_type(b > i8, np.bool_) +assert_type(c > i8, np.bool_) +assert_type(f > i8, np.bool_) +assert_type(i > i8, np.bool_) +assert_type(AR > i8, npt.NDArray[np.bool_]) +assert_type(SEQ > i8, npt.NDArray[np.bool_]) + +assert_type(u8 > u8, np.bool_) +assert_type(i4 > u8, np.bool_) +assert_type(u4 > u8, np.bool_) +assert_type(b_ > u8, np.bool_) +assert_type(b > u8, np.bool_) +assert_type(c > u8, np.bool_) +assert_type(f > u8, np.bool_) +assert_type(i > u8, np.bool_) +assert_type(AR > u8, npt.NDArray[np.bool_]) +assert_type(SEQ > u8, npt.NDArray[np.bool_]) + +assert_type(i4 > i8, np.bool_) +assert_type(i4 > i4, np.bool_) +assert_type(i4 > i, np.bool_) +assert_type(i4 > b_, np.bool_) +assert_type(i4 > b, np.bool_) +assert_type(i4 > AR, npt.NDArray[np.bool_]) +assert_type(i4 > SEQ, npt.NDArray[np.bool_]) + +assert_type(u4 > i8, np.bool_) +assert_type(u4 > i4, np.bool_) +assert_type(u4 > u8, np.bool_) +assert_type(u4 > u4, np.bool_) +assert_type(u4 > i, np.bool_) +assert_type(u4 > b_, np.bool_) +assert_type(u4 > b, np.bool_) +assert_type(u4 > AR, npt.NDArray[np.bool_]) +assert_type(u4 > SEQ, npt.NDArray[np.bool_]) + +assert_type(i8 > i4, np.bool_) +assert_type(i4 > i4, np.bool_) +assert_type(i > i4, np.bool_) +assert_type(b_ > i4, np.bool_) +assert_type(b > i4, np.bool_) +assert_type(AR > i4, npt.NDArray[np.bool_]) +assert_type(SEQ > i4, npt.NDArray[np.bool_]) + +assert_type(i8 > u4, np.bool_) +assert_type(i4 > u4, np.bool_) +assert_type(u8 > u4, np.bool_) +assert_type(u4 > u4, np.bool_) +assert_type(b_ > u4, np.bool_) +assert_type(b > u4, np.bool_) +assert_type(i > u4, np.bool_) +assert_type(AR > u4, npt.NDArray[np.bool_]) +assert_type(SEQ > u4, npt.NDArray[np.bool_]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/constants.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/constants.pyi index 37f54ccdab..ce2fcef1e2 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/constants.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/constants.pyi @@ -1,52 +1,61 @@ +import sys +from typing import Literal + import numpy as np +from numpy.core._type_aliases import _SCTypes + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type -reveal_type(np.Inf) # E: float -reveal_type(np.Infinity) # E: float -reveal_type(np.NAN) # E: float -reveal_type(np.NINF) # E: float -reveal_type(np.NZERO) # E: float -reveal_type(np.NaN) # E: float -reveal_type(np.PINF) # E: float -reveal_type(np.PZERO) # E: float -reveal_type(np.e) # E: float -reveal_type(np.euler_gamma) # E: float -reveal_type(np.inf) # E: float -reveal_type(np.infty) # E: float -reveal_type(np.nan) # E: float -reveal_type(np.pi) # E: float +assert_type(np.Inf, float) +assert_type(np.Infinity, float) +assert_type(np.NAN, float) +assert_type(np.NINF, float) +assert_type(np.NZERO, float) +assert_type(np.NaN, float) +assert_type(np.PINF, float) +assert_type(np.PZERO, float) +assert_type(np.e, float) +assert_type(np.euler_gamma, float) +assert_type(np.inf, float) +assert_type(np.infty, float) +assert_type(np.nan, float) +assert_type(np.pi, float) -reveal_type(np.ALLOW_THREADS) # E: int -reveal_type(np.BUFSIZE) # E: Literal[8192] -reveal_type(np.CLIP) # E: Literal[0] -reveal_type(np.ERR_CALL) # E: Literal[3] -reveal_type(np.ERR_DEFAULT) # E: Literal[521] -reveal_type(np.ERR_IGNORE) # E: Literal[0] -reveal_type(np.ERR_LOG) # E: Literal[5] -reveal_type(np.ERR_PRINT) # E: Literal[4] -reveal_type(np.ERR_RAISE) # E: Literal[2] -reveal_type(np.ERR_WARN) # E: Literal[1] -reveal_type(np.FLOATING_POINT_SUPPORT) # E: Literal[1] -reveal_type(np.FPE_DIVIDEBYZERO) # E: Literal[1] -reveal_type(np.FPE_INVALID) # E: Literal[8] -reveal_type(np.FPE_OVERFLOW) # E: Literal[2] -reveal_type(np.FPE_UNDERFLOW) # E: Literal[4] -reveal_type(np.MAXDIMS) # E: Literal[32] -reveal_type(np.MAY_SHARE_BOUNDS) # E: Literal[0] -reveal_type(np.MAY_SHARE_EXACT) # E: Literal[-1] -reveal_type(np.RAISE) # E: Literal[2] -reveal_type(np.SHIFT_DIVIDEBYZERO) # E: Literal[0] -reveal_type(np.SHIFT_INVALID) # E: Literal[9] -reveal_type(np.SHIFT_OVERFLOW) # E: Literal[3] -reveal_type(np.SHIFT_UNDERFLOW) # E: Literal[6] -reveal_type(np.UFUNC_BUFSIZE_DEFAULT) # E: Literal[8192] -reveal_type(np.WRAP) # E: Literal[1] -reveal_type(np.tracemalloc_domain) # E: Literal[389047] +assert_type(np.ALLOW_THREADS, int) +assert_type(np.BUFSIZE, Literal[8192]) +assert_type(np.CLIP, Literal[0]) +assert_type(np.ERR_CALL, Literal[3]) +assert_type(np.ERR_DEFAULT, Literal[521]) +assert_type(np.ERR_IGNORE, Literal[0]) +assert_type(np.ERR_LOG, Literal[5]) +assert_type(np.ERR_PRINT, Literal[4]) +assert_type(np.ERR_RAISE, Literal[2]) +assert_type(np.ERR_WARN, Literal[1]) +assert_type(np.FLOATING_POINT_SUPPORT, Literal[1]) +assert_type(np.FPE_DIVIDEBYZERO, Literal[1]) +assert_type(np.FPE_INVALID, Literal[8]) +assert_type(np.FPE_OVERFLOW, Literal[2]) +assert_type(np.FPE_UNDERFLOW, Literal[4]) +assert_type(np.MAXDIMS, Literal[32]) +assert_type(np.MAY_SHARE_BOUNDS, Literal[0]) +assert_type(np.MAY_SHARE_EXACT, Literal[-1]) +assert_type(np.RAISE, Literal[2]) +assert_type(np.SHIFT_DIVIDEBYZERO, Literal[0]) +assert_type(np.SHIFT_INVALID, Literal[9]) +assert_type(np.SHIFT_OVERFLOW, Literal[3]) +assert_type(np.SHIFT_UNDERFLOW, Literal[6]) +assert_type(np.UFUNC_BUFSIZE_DEFAULT, Literal[8192]) +assert_type(np.WRAP, Literal[1]) +assert_type(np.tracemalloc_domain, Literal[389047]) -reveal_type(np.little_endian) # E: bool -reveal_type(np.True_) # E: bool_ -reveal_type(np.False_) # E: bool_ +assert_type(np.little_endian, bool) +assert_type(np.True_, np.bool_) +assert_type(np.False_, np.bool_) -reveal_type(np.UFUNC_PYVALS_NAME) # E: Literal['UFUNC_PYVALS'] +assert_type(np.UFUNC_PYVALS_NAME, Literal["UFUNC_PYVALS"]) -reveal_type(np.sctypeDict) # E: dict -reveal_type(np.sctypes) # E: TypedDict +assert_type(np.sctypeDict, dict[int | str, type[np.generic]]) +assert_type(np.sctypes, _SCTypes) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ctypeslib.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ctypeslib.pyi index 2d30de3d15..a9712c074c 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ctypeslib.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ctypeslib.pyi @@ -1,8 +1,15 @@ -import ctypes +import sys +import ctypes as ct from typing import Any import numpy as np import numpy.typing as npt +from numpy import ctypeslib + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR_bool: npt.NDArray[np.bool_] AR_ubyte: npt.NDArray[np.ubyte] @@ -20,68 +27,69 @@ AR_double: npt.NDArray[np.double] AR_longdouble: npt.NDArray[np.longdouble] AR_void: npt.NDArray[np.void] -pointer: ctypes._Pointer[Any] +pointer: ct._Pointer[Any] + +assert_type(np.ctypeslib.c_intp(), ctypeslib.c_intp) + +assert_type(np.ctypeslib.ndpointer(), type[ctypeslib._ndptr[None]]) +assert_type(np.ctypeslib.ndpointer(dtype=np.float64), type[ctypeslib._ndptr[np.dtype[np.float64]]]) +assert_type(np.ctypeslib.ndpointer(dtype=float), type[ctypeslib._ndptr[np.dtype[Any]]]) +assert_type(np.ctypeslib.ndpointer(shape=(10, 3)), type[ctypeslib._ndptr[None]]) +assert_type(np.ctypeslib.ndpointer(np.int64, shape=(10, 3)), type[ctypeslib._concrete_ndptr[np.dtype[np.int64]]]) +assert_type(np.ctypeslib.ndpointer(int, shape=(1,)), type[np.ctypeslib._concrete_ndptr[np.dtype[Any]]]) -reveal_type(np.ctypeslib.c_intp()) # E: {c_intp} +assert_type(np.ctypeslib.as_ctypes_type(np.bool_), type[ct.c_bool]) +assert_type(np.ctypeslib.as_ctypes_type(np.ubyte), type[ct.c_ubyte]) +assert_type(np.ctypeslib.as_ctypes_type(np.ushort), type[ct.c_ushort]) +assert_type(np.ctypeslib.as_ctypes_type(np.uintc), type[ct.c_uint]) +assert_type(np.ctypeslib.as_ctypes_type(np.byte), type[ct.c_byte]) +assert_type(np.ctypeslib.as_ctypes_type(np.short), type[ct.c_short]) +assert_type(np.ctypeslib.as_ctypes_type(np.intc), type[ct.c_int]) +assert_type(np.ctypeslib.as_ctypes_type(np.single), type[ct.c_float]) +assert_type(np.ctypeslib.as_ctypes_type(np.double), type[ct.c_double]) +assert_type(np.ctypeslib.as_ctypes_type(ct.c_double), type[ct.c_double]) +assert_type(np.ctypeslib.as_ctypes_type("q"), type[ct.c_longlong]) +assert_type(np.ctypeslib.as_ctypes_type([("i8", np.int64), ("f8", np.float64)]), type[Any]) +assert_type(np.ctypeslib.as_ctypes_type("i8"), type[Any]) +assert_type(np.ctypeslib.as_ctypes_type("f8"), type[Any]) -reveal_type(np.ctypeslib.ndpointer()) # E: Type[ctypeslib._ndptr[None]] -reveal_type(np.ctypeslib.ndpointer(dtype=np.float64)) # E: Type[ctypeslib._ndptr[dtype[{float64}]]] -reveal_type(np.ctypeslib.ndpointer(dtype=float)) # E: Type[ctypeslib._ndptr[dtype[Any]]] -reveal_type(np.ctypeslib.ndpointer(shape=(10, 3))) # E: Type[ctypeslib._ndptr[None]] -reveal_type(np.ctypeslib.ndpointer(np.int64, shape=(10, 3))) # E: Type[ctypeslib._concrete_ndptr[dtype[{int64}]]] -reveal_type(np.ctypeslib.ndpointer(int, shape=(1,))) # E: Type[ctypeslib._concrete_ndptr[dtype[Any]]] +assert_type(np.ctypeslib.as_ctypes(AR_bool.take(0)), ct.c_bool) +assert_type(np.ctypeslib.as_ctypes(AR_ubyte.take(0)), ct.c_ubyte) +assert_type(np.ctypeslib.as_ctypes(AR_ushort.take(0)), ct.c_ushort) +assert_type(np.ctypeslib.as_ctypes(AR_uintc.take(0)), ct.c_uint) -reveal_type(np.ctypeslib.as_ctypes_type(np.bool_)) # E: Type[ctypes.c_bool] -reveal_type(np.ctypeslib.as_ctypes_type(np.ubyte)) # E: Type[{c_ubyte}] -reveal_type(np.ctypeslib.as_ctypes_type(np.ushort)) # E: Type[{c_ushort}] -reveal_type(np.ctypeslib.as_ctypes_type(np.uintc)) # E: Type[{c_uint}] -reveal_type(np.ctypeslib.as_ctypes_type(np.uint)) # E: Type[{c_ulong}] -reveal_type(np.ctypeslib.as_ctypes_type(np.ulonglong)) # E: Type[{c_ulonglong}] -reveal_type(np.ctypeslib.as_ctypes_type(np.byte)) # E: Type[{c_byte}] -reveal_type(np.ctypeslib.as_ctypes_type(np.short)) # E: Type[{c_short}] -reveal_type(np.ctypeslib.as_ctypes_type(np.intc)) # E: Type[{c_int}] -reveal_type(np.ctypeslib.as_ctypes_type(np.int_)) # E: Type[{c_long}] -reveal_type(np.ctypeslib.as_ctypes_type(np.longlong)) # E: Type[{c_longlong}] -reveal_type(np.ctypeslib.as_ctypes_type(np.single)) # E: Type[{c_float}] -reveal_type(np.ctypeslib.as_ctypes_type(np.double)) # E: Type[{c_double}] -reveal_type(np.ctypeslib.as_ctypes_type(np.longdouble)) # E: Type[{c_longdouble}] -reveal_type(np.ctypeslib.as_ctypes_type(ctypes.c_double)) # E: Type[{c_double}] -reveal_type(np.ctypeslib.as_ctypes_type("q")) # E: Type[ctypes.c_longlong] -reveal_type(np.ctypeslib.as_ctypes_type([("i8", np.int64), ("f8", np.float64)])) # E: Type[Any] -reveal_type(np.ctypeslib.as_ctypes_type("i8")) # E: Type[Any] -reveal_type(np.ctypeslib.as_ctypes_type("f8")) # E: Type[Any] +assert_type(np.ctypeslib.as_ctypes(AR_byte.take(0)), ct.c_byte) +assert_type(np.ctypeslib.as_ctypes(AR_short.take(0)), ct.c_short) +assert_type(np.ctypeslib.as_ctypes(AR_intc.take(0)), ct.c_int) +assert_type(np.ctypeslib.as_ctypes(AR_single.take(0)), ct.c_float) +assert_type(np.ctypeslib.as_ctypes(AR_double.take(0)), ct.c_double) +assert_type(np.ctypeslib.as_ctypes(AR_void.take(0)), Any) +assert_type(np.ctypeslib.as_ctypes(AR_bool), ct.Array[ct.c_bool]) +assert_type(np.ctypeslib.as_ctypes(AR_ubyte), ct.Array[ct.c_ubyte]) +assert_type(np.ctypeslib.as_ctypes(AR_ushort), ct.Array[ct.c_ushort]) +assert_type(np.ctypeslib.as_ctypes(AR_uintc), ct.Array[ct.c_uint]) +assert_type(np.ctypeslib.as_ctypes(AR_byte), ct.Array[ct.c_byte]) +assert_type(np.ctypeslib.as_ctypes(AR_short), ct.Array[ct.c_short]) +assert_type(np.ctypeslib.as_ctypes(AR_intc), ct.Array[ct.c_int]) +assert_type(np.ctypeslib.as_ctypes(AR_single), ct.Array[ct.c_float]) +assert_type(np.ctypeslib.as_ctypes(AR_double), ct.Array[ct.c_double]) +assert_type(np.ctypeslib.as_ctypes(AR_void), ct.Array[Any]) -reveal_type(np.ctypeslib.as_ctypes(AR_bool.take(0))) # E: ctypes.c_bool -reveal_type(np.ctypeslib.as_ctypes(AR_ubyte.take(0))) # E: {c_ubyte} -reveal_type(np.ctypeslib.as_ctypes(AR_ushort.take(0))) # E: {c_ushort} -reveal_type(np.ctypeslib.as_ctypes(AR_uintc.take(0))) # E: {c_uint} -reveal_type(np.ctypeslib.as_ctypes(AR_uint.take(0))) # E: {c_ulong} -reveal_type(np.ctypeslib.as_ctypes(AR_ulonglong.take(0))) # E: {c_ulonglong} -reveal_type(np.ctypeslib.as_ctypes(AR_byte.take(0))) # E: {c_byte} -reveal_type(np.ctypeslib.as_ctypes(AR_short.take(0))) # E: {c_short} -reveal_type(np.ctypeslib.as_ctypes(AR_intc.take(0))) # E: {c_int} -reveal_type(np.ctypeslib.as_ctypes(AR_int.take(0))) # E: {c_long} -reveal_type(np.ctypeslib.as_ctypes(AR_longlong.take(0))) # E: {c_longlong} -reveal_type(np.ctypeslib.as_ctypes(AR_single.take(0))) # E: {c_float} -reveal_type(np.ctypeslib.as_ctypes(AR_double.take(0))) # E: {c_double} -reveal_type(np.ctypeslib.as_ctypes(AR_longdouble.take(0))) # E: {c_longdouble} -reveal_type(np.ctypeslib.as_ctypes(AR_void.take(0))) # E: Any -reveal_type(np.ctypeslib.as_ctypes(AR_bool)) # E: ctypes.Array[ctypes.c_bool] -reveal_type(np.ctypeslib.as_ctypes(AR_ubyte)) # E: ctypes.Array[{c_ubyte}] -reveal_type(np.ctypeslib.as_ctypes(AR_ushort)) # E: ctypes.Array[{c_ushort}] -reveal_type(np.ctypeslib.as_ctypes(AR_uintc)) # E: ctypes.Array[{c_uint}] -reveal_type(np.ctypeslib.as_ctypes(AR_uint)) # E: ctypes.Array[{c_ulong}] -reveal_type(np.ctypeslib.as_ctypes(AR_ulonglong)) # E: ctypes.Array[{c_ulonglong}] -reveal_type(np.ctypeslib.as_ctypes(AR_byte)) # E: ctypes.Array[{c_byte}] -reveal_type(np.ctypeslib.as_ctypes(AR_short)) # E: ctypes.Array[{c_short}] -reveal_type(np.ctypeslib.as_ctypes(AR_intc)) # E: ctypes.Array[{c_int}] -reveal_type(np.ctypeslib.as_ctypes(AR_int)) # E: ctypes.Array[{c_long}] -reveal_type(np.ctypeslib.as_ctypes(AR_longlong)) # E: ctypes.Array[{c_longlong}] -reveal_type(np.ctypeslib.as_ctypes(AR_single)) # E: ctypes.Array[{c_float}] -reveal_type(np.ctypeslib.as_ctypes(AR_double)) # E: ctypes.Array[{c_double}] -reveal_type(np.ctypeslib.as_ctypes(AR_longdouble)) # E: ctypes.Array[{c_longdouble}] -reveal_type(np.ctypeslib.as_ctypes(AR_void)) # E: ctypes.Array[Any] +assert_type(np.ctypeslib.as_array(AR_ubyte), npt.NDArray[np.ubyte]) +assert_type(np.ctypeslib.as_array(1), npt.NDArray[Any]) +assert_type(np.ctypeslib.as_array(pointer), npt.NDArray[Any]) -reveal_type(np.ctypeslib.as_array(AR_ubyte)) # E: ndarray[Any, dtype[{ubyte}]] -reveal_type(np.ctypeslib.as_array(1)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.ctypeslib.as_array(pointer)) # E: ndarray[Any, dtype[Any]] +if sys.platform == "win32": + assert_type(np.ctypeslib.as_ctypes_type(np.int_), type[ct.c_int]) + assert_type(np.ctypeslib.as_ctypes_type(np.uint), type[ct.c_uint]) + assert_type(np.ctypeslib.as_ctypes(AR_uint), ct.Array[ct.c_uint]) + assert_type(np.ctypeslib.as_ctypes(AR_int), ct.Array[ct.c_int]) + assert_type(np.ctypeslib.as_ctypes(AR_uint.take(0)), ct.c_uint) + assert_type(np.ctypeslib.as_ctypes(AR_int.take(0)), ct.c_int) +else: + assert_type(np.ctypeslib.as_ctypes_type(np.int_), type[ct.c_long]) + assert_type(np.ctypeslib.as_ctypes_type(np.uint), type[ct.c_ulong]) + assert_type(np.ctypeslib.as_ctypes(AR_uint), ct.Array[ct.c_ulong]) + assert_type(np.ctypeslib.as_ctypes(AR_int), ct.Array[ct.c_long]) + assert_type(np.ctypeslib.as_ctypes(AR_uint.take(0)), ct.c_ulong) + assert_type(np.ctypeslib.as_ctypes(AR_int.take(0)), ct.c_long) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/datasource.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/datasource.pyi index 245ac7649e..865722d8c9 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/datasource.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/datasource.pyi @@ -1,6 +1,14 @@ +import sys from pathlib import Path +from typing import IO, Any + import numpy as np +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + path1: Path path2: str @@ -8,14 +16,14 @@ d1 = np.DataSource(path1) d2 = np.DataSource(path2) d3 = np.DataSource(None) -reveal_type(d1.abspath("...")) # E: str -reveal_type(d2.abspath("...")) # E: str -reveal_type(d3.abspath("...")) # E: str +assert_type(d1.abspath("..."), str) +assert_type(d2.abspath("..."), str) +assert_type(d3.abspath("..."), str) -reveal_type(d1.exists("...")) # E: bool -reveal_type(d2.exists("...")) # E: bool -reveal_type(d3.exists("...")) # E: bool +assert_type(d1.exists("..."), bool) +assert_type(d2.exists("..."), bool) +assert_type(d3.exists("..."), bool) -reveal_type(d1.open("...", "r")) # E: IO[Any] -reveal_type(d2.open("...", encoding="utf8")) # E: IO[Any] -reveal_type(d3.open("...", newline="/n")) # E: IO[Any] +assert_type(d1.open("...", "r"), IO[Any]) +assert_type(d2.open("...", encoding="utf8"), IO[Any]) +assert_type(d3.open("...", newline="/n"), IO[Any]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/dtype.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/dtype.pyi index ce6b803d68..19713098bb 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/dtype.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/dtype.pyi @@ -1,77 +1,85 @@ +import sys import ctypes as ct +from typing import Any + import numpy as np +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + dtype_U: np.dtype[np.str_] dtype_V: np.dtype[np.void] dtype_i8: np.dtype[np.int64] -reveal_type(np.dtype(np.float64)) # E: dtype[{float64}] -reveal_type(np.dtype(np.float64, metadata={"test": "test"})) # E: dtype[{float64}] -reveal_type(np.dtype(np.int64)) # E: dtype[{int64}] +assert_type(np.dtype(np.float64), np.dtype[np.float64]) +assert_type(np.dtype(np.float64, metadata={"test": "test"}), np.dtype[np.float64]) +assert_type(np.dtype(np.int64), np.dtype[np.int64]) # String aliases -reveal_type(np.dtype("float64")) # E: dtype[{float64}] -reveal_type(np.dtype("float32")) # E: dtype[{float32}] -reveal_type(np.dtype("int64")) # E: dtype[{int64}] -reveal_type(np.dtype("int32")) # E: dtype[{int32}] -reveal_type(np.dtype("bool")) # E: dtype[bool_] -reveal_type(np.dtype("bytes")) # E: dtype[bytes_] -reveal_type(np.dtype("str")) # E: dtype[str_] +assert_type(np.dtype("float64"), np.dtype[np.float64]) +assert_type(np.dtype("float32"), np.dtype[np.float32]) +assert_type(np.dtype("int64"), np.dtype[np.int64]) +assert_type(np.dtype("int32"), np.dtype[np.int32]) +assert_type(np.dtype("bool"), np.dtype[np.bool_]) +assert_type(np.dtype("bytes"), np.dtype[np.bytes_]) +assert_type(np.dtype("str"), np.dtype[np.str_]) # Python types -reveal_type(np.dtype(complex)) # E: dtype[{cdouble}] -reveal_type(np.dtype(float)) # E: dtype[{double}] -reveal_type(np.dtype(int)) # E: dtype[{int_}] -reveal_type(np.dtype(bool)) # E: dtype[bool_] -reveal_type(np.dtype(str)) # E: dtype[str_] -reveal_type(np.dtype(bytes)) # E: dtype[bytes_] -reveal_type(np.dtype(object)) # E: dtype[object_] +assert_type(np.dtype(complex), np.dtype[np.cdouble]) +assert_type(np.dtype(float), np.dtype[np.double]) +assert_type(np.dtype(int), np.dtype[np.int_]) +assert_type(np.dtype(bool), np.dtype[np.bool_]) +assert_type(np.dtype(str), np.dtype[np.str_]) +assert_type(np.dtype(bytes), np.dtype[np.bytes_]) +assert_type(np.dtype(object), np.dtype[np.object_]) # ctypes -reveal_type(np.dtype(ct.c_double)) # E: dtype[{double}] -reveal_type(np.dtype(ct.c_longlong)) # E: dtype[{longlong}] -reveal_type(np.dtype(ct.c_uint32)) # E: dtype[{uint32}] -reveal_type(np.dtype(ct.c_bool)) # E: dtype[bool_] -reveal_type(np.dtype(ct.c_char)) # E: dtype[bytes_] -reveal_type(np.dtype(ct.py_object)) # E: dtype[object_] +assert_type(np.dtype(ct.c_double), np.dtype[np.double]) +assert_type(np.dtype(ct.c_longlong), np.dtype[np.longlong]) +assert_type(np.dtype(ct.c_uint32), np.dtype[np.uint32]) +assert_type(np.dtype(ct.c_bool), np.dtype[np.bool_]) +assert_type(np.dtype(ct.c_char), np.dtype[np.bytes_]) +assert_type(np.dtype(ct.py_object), np.dtype[np.object_]) # Special case for None -reveal_type(np.dtype(None)) # E: dtype[{double}] +assert_type(np.dtype(None), np.dtype[np.double]) # Dtypes of dtypes -reveal_type(np.dtype(np.dtype(np.float64))) # E: dtype[{float64}] +assert_type(np.dtype(np.dtype(np.float64)), np.dtype[np.float64]) # Parameterized dtypes -reveal_type(np.dtype("S8")) # E: dtype +assert_type(np.dtype("S8"), np.dtype) # Void -reveal_type(np.dtype(("U", 10))) # E: dtype[void] +assert_type(np.dtype(("U", 10)), np.dtype[np.void]) # Methods and attributes -reveal_type(dtype_U.base) # E: dtype[Any] -reveal_type(dtype_U.subdtype) # E: Union[None, Tuple[dtype[Any], builtins.tuple[builtins.int, ...]]] -reveal_type(dtype_U.newbyteorder()) # E: dtype[str_] -reveal_type(dtype_U.type) # E: Type[str_] -reveal_type(dtype_U.name) # E: str -reveal_type(dtype_U.names) # E: Union[None, builtins.tuple[builtins.str, ...]] - -reveal_type(dtype_U * 0) # E: dtype[str_] -reveal_type(dtype_U * 1) # E: dtype[str_] -reveal_type(dtype_U * 2) # E: dtype[str_] - -reveal_type(dtype_i8 * 0) # E: dtype[void] -reveal_type(dtype_i8 * 1) # E: dtype[{int64}] -reveal_type(dtype_i8 * 2) # E: dtype[void] - -reveal_type(0 * dtype_U) # E: dtype[str_] -reveal_type(1 * dtype_U) # E: dtype[str_] -reveal_type(2 * dtype_U) # E: dtype[str_] - -reveal_type(0 * dtype_i8) # E: dtype[Any] -reveal_type(1 * dtype_i8) # E: dtype[Any] -reveal_type(2 * dtype_i8) # E: dtype[Any] - -reveal_type(dtype_V["f0"]) # E: dtype[Any] -reveal_type(dtype_V[0]) # E: dtype[Any] -reveal_type(dtype_V[["f0", "f1"]]) # E: dtype[void] -reveal_type(dtype_V[["f0"]]) # E: dtype[void] +assert_type(dtype_U.base, np.dtype[Any]) +assert_type(dtype_U.subdtype, None | tuple[np.dtype[Any], tuple[int, ...]]) +assert_type(dtype_U.newbyteorder(), np.dtype[np.str_]) +assert_type(dtype_U.type, type[np.str_]) +assert_type(dtype_U.name, str) +assert_type(dtype_U.names, None | tuple[str, ...]) + +assert_type(dtype_U * 0, np.dtype[np.str_]) +assert_type(dtype_U * 1, np.dtype[np.str_]) +assert_type(dtype_U * 2, np.dtype[np.str_]) + +assert_type(dtype_i8 * 0, np.dtype[np.void]) +assert_type(dtype_i8 * 1, np.dtype[np.int64]) +assert_type(dtype_i8 * 2, np.dtype[np.void]) + +assert_type(0 * dtype_U, np.dtype[np.str_]) +assert_type(1 * dtype_U, np.dtype[np.str_]) +assert_type(2 * dtype_U, np.dtype[np.str_]) + +assert_type(0 * dtype_i8, np.dtype[Any]) +assert_type(1 * dtype_i8, np.dtype[Any]) +assert_type(2 * dtype_i8, np.dtype[Any]) + +assert_type(dtype_V["f0"], np.dtype[Any]) +assert_type(dtype_V[0], np.dtype[Any]) +assert_type(dtype_V[["f0", "f1"]], np.dtype[np.void]) +assert_type(dtype_V[["f0"]], np.dtype[np.void]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/einsumfunc.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/einsumfunc.pyi index 5f6415f275..645aaad31c 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/einsumfunc.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/einsumfunc.pyi @@ -1,7 +1,14 @@ +import sys from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_LIKE_b: list[bool] AR_LIKE_u: list[np.uint32] AR_LIKE_i: list[int] @@ -12,27 +19,27 @@ AR_o: npt.NDArray[np.object_] OUT_f: npt.NDArray[np.float64] -reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b)) # E: Any -reveal_type(np.einsum("i,i->i", AR_o, AR_o)) # E: Any -reveal_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u)) # E: Any -reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i)) # E: Any -reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f)) # E: Any -reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c)) # E: Any -reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i)) # E: Any -reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)) # E: Any - -reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f)) # E: ndarray[Any, dtype[{float64}] -reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe", out=OUT_f)) # E: ndarray[Any, dtype[{float64}] -reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16")) # E: Any -reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe")) # E: Any - -reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b)) # E: Tuple[builtins.list[Any], builtins.str] -reveal_type(np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u)) # E: Tuple[builtins.list[Any], builtins.str] -reveal_type(np.einsum_path("i,i->i", AR_LIKE_i, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str] -reveal_type(np.einsum_path("i,i->i", AR_LIKE_f, AR_LIKE_f)) # E: Tuple[builtins.list[Any], builtins.str] -reveal_type(np.einsum_path("i,i->i", AR_LIKE_c, AR_LIKE_c)) # E: Tuple[builtins.list[Any], builtins.str] -reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str] -reveal_type(np.einsum_path("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)) # E: Tuple[builtins.list[Any], builtins.str] - -reveal_type(np.einsum([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: Any -reveal_type(np.einsum_path([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i)) # E: Tuple[builtins.list[Any], builtins.str] +assert_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b), Any) +assert_type(np.einsum("i,i->i", AR_o, AR_o), Any) +assert_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u), Any) +assert_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i), Any) +assert_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f), Any) +assert_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c), Any) +assert_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i), Any) +assert_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c), Any) + +assert_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f), npt.NDArray[np.float64]) +assert_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe", out=OUT_f), npt.NDArray[np.float64]) +assert_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16"), Any) +assert_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe"), Any) + +assert_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b), tuple[list[Any], str]) +assert_type(np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u), tuple[list[Any], str]) +assert_type(np.einsum_path("i,i->i", AR_LIKE_i, AR_LIKE_i), tuple[list[Any], str]) +assert_type(np.einsum_path("i,i->i", AR_LIKE_f, AR_LIKE_f), tuple[list[Any], str]) +assert_type(np.einsum_path("i,i->i", AR_LIKE_c, AR_LIKE_c), tuple[list[Any], str]) +assert_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_i), tuple[list[Any], str]) +assert_type(np.einsum_path("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c), tuple[list[Any], str]) + +assert_type(np.einsum([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i), Any) +assert_type(np.einsum_path([[1, 1], [1, 1]], AR_LIKE_i, AR_LIKE_i), tuple[list[Any], str]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/emath.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/emath.pyi index 9ab2d72d2b..d1027bf48d 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/emath.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/emath.pyi @@ -1,52 +1,60 @@ +import sys +from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_f8: npt.NDArray[np.float64] AR_c16: npt.NDArray[np.complex128] f8: np.float64 c16: np.complex128 -reveal_type(np.emath.sqrt(f8)) # E: Any -reveal_type(np.emath.sqrt(AR_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.sqrt(c16)) # E: complexfloating[Any, Any] -reveal_type(np.emath.sqrt(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.log(f8)) # E: Any -reveal_type(np.emath.log(AR_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.log(c16)) # E: complexfloating[Any, Any] -reveal_type(np.emath.log(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.log10(f8)) # E: Any -reveal_type(np.emath.log10(AR_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.log10(c16)) # E: complexfloating[Any, Any] -reveal_type(np.emath.log10(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.log2(f8)) # E: Any -reveal_type(np.emath.log2(AR_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.log2(c16)) # E: complexfloating[Any, Any] -reveal_type(np.emath.log2(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.logn(f8, 2)) # E: Any -reveal_type(np.emath.logn(AR_f8, 4)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.logn(f8, 1j)) # E: complexfloating[Any, Any] -reveal_type(np.emath.logn(AR_c16, 1.5)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.power(f8, 2)) # E: Any -reveal_type(np.emath.power(AR_f8, 4)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.power(f8, 2j)) # E: complexfloating[Any, Any] -reveal_type(np.emath.power(AR_c16, 1.5)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.arccos(f8)) # E: Any -reveal_type(np.emath.arccos(AR_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.arccos(c16)) # E: complexfloating[Any, Any] -reveal_type(np.emath.arccos(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.arcsin(f8)) # E: Any -reveal_type(np.emath.arcsin(AR_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.arcsin(c16)) # E: complexfloating[Any, Any] -reveal_type(np.emath.arcsin(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.emath.arctanh(f8)) # E: Any -reveal_type(np.emath.arctanh(AR_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.emath.arctanh(c16)) # E: complexfloating[Any, Any] -reveal_type(np.emath.arctanh(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] +assert_type(np.emath.sqrt(f8), Any) +assert_type(np.emath.sqrt(AR_f8), npt.NDArray[Any]) +assert_type(np.emath.sqrt(c16), np.complexfloating[Any, Any]) +assert_type(np.emath.sqrt(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.log(f8), Any) +assert_type(np.emath.log(AR_f8), npt.NDArray[Any]) +assert_type(np.emath.log(c16), np.complexfloating[Any, Any]) +assert_type(np.emath.log(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.log10(f8), Any) +assert_type(np.emath.log10(AR_f8), npt.NDArray[Any]) +assert_type(np.emath.log10(c16), np.complexfloating[Any, Any]) +assert_type(np.emath.log10(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.log2(f8), Any) +assert_type(np.emath.log2(AR_f8), npt.NDArray[Any]) +assert_type(np.emath.log2(c16), np.complexfloating[Any, Any]) +assert_type(np.emath.log2(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.logn(f8, 2), Any) +assert_type(np.emath.logn(AR_f8, 4), npt.NDArray[Any]) +assert_type(np.emath.logn(f8, 1j), np.complexfloating[Any, Any]) +assert_type(np.emath.logn(AR_c16, 1.5), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.power(f8, 2), Any) +assert_type(np.emath.power(AR_f8, 4), npt.NDArray[Any]) +assert_type(np.emath.power(f8, 2j), np.complexfloating[Any, Any]) +assert_type(np.emath.power(AR_c16, 1.5), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.arccos(f8), Any) +assert_type(np.emath.arccos(AR_f8), npt.NDArray[Any]) +assert_type(np.emath.arccos(c16), np.complexfloating[Any, Any]) +assert_type(np.emath.arccos(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.arcsin(f8), Any) +assert_type(np.emath.arcsin(AR_f8), npt.NDArray[Any]) +assert_type(np.emath.arcsin(c16), np.complexfloating[Any, Any]) +assert_type(np.emath.arcsin(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.emath.arctanh(f8), Any) +assert_type(np.emath.arctanh(AR_f8), npt.NDArray[Any]) +assert_type(np.emath.arctanh(c16), np.complexfloating[Any, Any]) +assert_type(np.emath.arctanh(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/false_positives.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/false_positives.pyi index 2d7156642e..7a2e016245 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/false_positives.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/false_positives.pyi @@ -1,10 +1,18 @@ +import sys from typing import Any + +import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_Any: npt.NDArray[Any] # Mypy bug where overload ambiguity is ignored for `Any`-parametrized types; # xref numpy/numpy#20099 and python/mypy#11347 # -# The expected output would be something akin to `ndarray[Any, dtype[Any]]` -reveal_type(AR_Any + 2) # E: ndarray[Any, dtype[signedinteger[Any]]] +# The expected output would be something akin to `npt.NDArray[Any]` +assert_type(AR_Any + 2, npt.NDArray[np.signedinteger[Any]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fft.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fft.pyi index 0667938e44..d6e9ba756d 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fft.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fft.pyi @@ -1,35 +1,43 @@ +import sys +from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_f8: npt.NDArray[np.float64] AR_c16: npt.NDArray[np.complex128] AR_LIKE_f8: list[float] -reveal_type(np.fft.fftshift(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fft.fftshift(AR_LIKE_f8, axes=0)) # E: ndarray[Any, dtype[Any]] +assert_type(np.fft.fftshift(AR_f8), npt.NDArray[np.float64]) +assert_type(np.fft.fftshift(AR_LIKE_f8, axes=0), npt.NDArray[Any]) -reveal_type(np.fft.ifftshift(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fft.ifftshift(AR_LIKE_f8, axes=0)) # E: ndarray[Any, dtype[Any]] +assert_type(np.fft.ifftshift(AR_f8), npt.NDArray[np.float64]) +assert_type(np.fft.ifftshift(AR_LIKE_f8, axes=0), npt.NDArray[Any]) -reveal_type(np.fft.fftfreq(5, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.fft.fftfreq(np.int64(), AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] +assert_type(np.fft.fftfreq(5, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.fft.fftfreq(np.int64(), AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) -reveal_type(np.fft.fftfreq(5, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.fft.fftfreq(np.int64(), AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] +assert_type(np.fft.fftfreq(5, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.fft.fftfreq(np.int64(), AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) -reveal_type(np.fft.fft(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.ifft(AR_f8, axis=1)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.rfft(AR_f8, n=None)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.irfft(AR_f8, norm="ortho")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fft.hfft(AR_f8, n=2)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fft.ihfft(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] +assert_type(np.fft.fft(AR_f8), npt.NDArray[np.complex128]) +assert_type(np.fft.ifft(AR_f8, axis=1), npt.NDArray[np.complex128]) +assert_type(np.fft.rfft(AR_f8, n=None), npt.NDArray[np.complex128]) +assert_type(np.fft.irfft(AR_f8, norm="ortho"), npt.NDArray[np.float64]) +assert_type(np.fft.hfft(AR_f8, n=2), npt.NDArray[np.float64]) +assert_type(np.fft.ihfft(AR_f8), npt.NDArray[np.complex128]) -reveal_type(np.fft.fftn(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.ifftn(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.rfftn(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.irfftn(AR_f8)) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.fft.fftn(AR_f8), npt.NDArray[np.complex128]) +assert_type(np.fft.ifftn(AR_f8), npt.NDArray[np.complex128]) +assert_type(np.fft.rfftn(AR_f8), npt.NDArray[np.complex128]) +assert_type(np.fft.irfftn(AR_f8), npt.NDArray[np.float64]) -reveal_type(np.fft.rfft2(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.ifft2(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.fft2(AR_f8)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.fft.irfft2(AR_f8)) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.fft.rfft2(AR_f8), npt.NDArray[np.complex128]) +assert_type(np.fft.ifft2(AR_f8), npt.NDArray[np.complex128]) +assert_type(np.fft.fft2(AR_f8), npt.NDArray[np.complex128]) +assert_type(np.fft.irfft2(AR_f8), npt.NDArray[np.float64]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/flatiter.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/flatiter.pyi index 8d3e806328..84d3b03b7d 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/flatiter.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/flatiter.pyi @@ -1,22 +1,30 @@ +import sys from typing import Any + import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type -a: np.flatiter[np.ndarray[Any, np.dtype[np.str_]]] +a: np.flatiter[npt.NDArray[np.str_]] -reveal_type(a.base) # E: ndarray[Any, dtype[str_]] -reveal_type(a.copy()) # E: ndarray[Any, dtype[str_]] -reveal_type(a.coords) # E: tuple[builtins.int, ...] -reveal_type(a.index) # E: int -reveal_type(iter(a)) # E: Any -reveal_type(next(a)) # E: str_ -reveal_type(a[0]) # E: str_ -reveal_type(a[[0, 1, 2]]) # E: ndarray[Any, dtype[str_]] -reveal_type(a[...]) # E: ndarray[Any, dtype[str_]] -reveal_type(a[:]) # E: ndarray[Any, dtype[str_]] -reveal_type(a[(...,)]) # E: ndarray[Any, dtype[str_]] -reveal_type(a[(0,)]) # E: str_ -reveal_type(a.__array__()) # E: ndarray[Any, dtype[str_]] -reveal_type(a.__array__(np.dtype(np.float64))) # E: ndarray[Any, dtype[{float64}]] +assert_type(a.base, npt.NDArray[np.str_]) +assert_type(a.copy(), npt.NDArray[np.str_]) +assert_type(a.coords, tuple[int, ...]) +assert_type(a.index, int) +assert_type(iter(a), np.flatiter[npt.NDArray[np.str_]]) +assert_type(next(a), np.str_) +assert_type(a[0], np.str_) +assert_type(a[[0, 1, 2]], npt.NDArray[np.str_]) +assert_type(a[...], npt.NDArray[np.str_]) +assert_type(a[:], npt.NDArray[np.str_]) +assert_type(a[(...,)], npt.NDArray[np.str_]) +assert_type(a[(0,)], np.str_) +assert_type(a.__array__(), npt.NDArray[np.str_]) +assert_type(a.__array__(np.dtype(np.float64)), npt.NDArray[np.float64]) a[0] = "a" a[:5] = "a" a[...] = "a" diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fromnumeric.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fromnumeric.pyi index e769abcf5e..aec21ec22c 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fromnumeric.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/fromnumeric.pyi @@ -1,8 +1,16 @@ """Tests for :mod:`core.fromnumeric`.""" +import sys +from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + class NDArraySubclass(npt.NDArray[np.complex128]): ... @@ -19,279 +27,279 @@ f4: np.float32 i8: np.int64 f: float -reveal_type(np.take(b, 0)) # E: bool_ -reveal_type(np.take(f4, 0)) # E: {float32} -reveal_type(np.take(f, 0)) # E: Any -reveal_type(np.take(AR_b, 0)) # E: bool_ -reveal_type(np.take(AR_f4, 0)) # E: {float32} -reveal_type(np.take(AR_b, [0])) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.take(AR_f4, [0])) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.take([1], [0])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.take(AR_f4, [0], out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.reshape(b, 1)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.reshape(f4, 1)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.reshape(f, 1)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.reshape(AR_b, 1)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.reshape(AR_f4, 1)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.choose(1, [True, True])) # E: Any -reveal_type(np.choose([1], [True, True])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.choose([1], AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.choose([1], AR_b, out=AR_f4)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.repeat(b, 1)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.repeat(f4, 1)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.repeat(f, 1)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.repeat(AR_b, 1)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.repeat(AR_f4, 1)) # E: ndarray[Any, dtype[{float32}]] +assert_type(np.take(b, 0), np.bool_) +assert_type(np.take(f4, 0), np.float32) +assert_type(np.take(f, 0), Any) +assert_type(np.take(AR_b, 0), np.bool_) +assert_type(np.take(AR_f4, 0), np.float32) +assert_type(np.take(AR_b, [0]), npt.NDArray[np.bool_]) +assert_type(np.take(AR_f4, [0]), npt.NDArray[np.float32]) +assert_type(np.take([1], [0]), npt.NDArray[Any]) +assert_type(np.take(AR_f4, [0], out=AR_subclass), NDArraySubclass) + +assert_type(np.reshape(b, 1), npt.NDArray[np.bool_]) +assert_type(np.reshape(f4, 1), npt.NDArray[np.float32]) +assert_type(np.reshape(f, 1), npt.NDArray[Any]) +assert_type(np.reshape(AR_b, 1), npt.NDArray[np.bool_]) +assert_type(np.reshape(AR_f4, 1), npt.NDArray[np.float32]) + +assert_type(np.choose(1, [True, True]), Any) +assert_type(np.choose([1], [True, True]), npt.NDArray[Any]) +assert_type(np.choose([1], AR_b), npt.NDArray[np.bool_]) +assert_type(np.choose([1], AR_b, out=AR_f4), npt.NDArray[np.float32]) + +assert_type(np.repeat(b, 1), npt.NDArray[np.bool_]) +assert_type(np.repeat(f4, 1), npt.NDArray[np.float32]) +assert_type(np.repeat(f, 1), npt.NDArray[Any]) +assert_type(np.repeat(AR_b, 1), npt.NDArray[np.bool_]) +assert_type(np.repeat(AR_f4, 1), npt.NDArray[np.float32]) # TODO: array_bdd tests for np.put() -reveal_type(np.swapaxes([[0, 1]], 0, 0)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.swapaxes(AR_b, 0, 0)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.swapaxes(AR_f4, 0, 0)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.transpose(b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.transpose(f4)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.transpose(f)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.transpose(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.transpose(AR_f4)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.partition(b, 0, axis=None)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.partition(f4, 0, axis=None)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.partition(f, 0, axis=None)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.partition(AR_b, 0)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.partition(AR_f4, 0)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.argpartition(b, 0)) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.argpartition(f4, 0)) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.argpartition(f, 0)) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.argpartition(AR_b, 0)) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.argpartition(AR_f4, 0)) # E: ndarray[Any, dtype[{intp}]] - -reveal_type(np.sort([2, 1], 0)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.sort(AR_b, 0)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.sort(AR_f4, 0)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.argsort(AR_b, 0)) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.argsort(AR_f4, 0)) # E: ndarray[Any, dtype[{intp}]] - -reveal_type(np.argmax(AR_b)) # E: {intp} -reveal_type(np.argmax(AR_f4)) # E: {intp} -reveal_type(np.argmax(AR_b, axis=0)) # E: Any -reveal_type(np.argmax(AR_f4, axis=0)) # E: Any -reveal_type(np.argmax(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.argmin(AR_b)) # E: {intp} -reveal_type(np.argmin(AR_f4)) # E: {intp} -reveal_type(np.argmin(AR_b, axis=0)) # E: Any -reveal_type(np.argmin(AR_f4, axis=0)) # E: Any -reveal_type(np.argmin(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.searchsorted(AR_b[0], 0)) # E: {intp} -reveal_type(np.searchsorted(AR_f4[0], 0)) # E: {intp} -reveal_type(np.searchsorted(AR_b[0], [0])) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.searchsorted(AR_f4[0], [0])) # E: ndarray[Any, dtype[{intp}]] - -reveal_type(np.resize(b, (5, 5))) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.resize(f4, (5, 5))) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.resize(f, (5, 5))) # E: ndarray[Any, dtype[Any]] -reveal_type(np.resize(AR_b, (5, 5))) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.resize(AR_f4, (5, 5))) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.squeeze(b)) # E: bool_ -reveal_type(np.squeeze(f4)) # E: {float32} -reveal_type(np.squeeze(f)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.squeeze(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.squeeze(AR_f4)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.diagonal(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.diagonal(AR_f4)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.trace(AR_b)) # E: Any -reveal_type(np.trace(AR_f4)) # E: Any -reveal_type(np.trace(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.ravel(b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.ravel(f4)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.ravel(f)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.ravel(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.ravel(AR_f4)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.nonzero(b)) # E: tuple[ndarray[Any, dtype[{intp}]], ...] -reveal_type(np.nonzero(f4)) # E: tuple[ndarray[Any, dtype[{intp}]], ...] -reveal_type(np.nonzero(f)) # E: tuple[ndarray[Any, dtype[{intp}]], ...] -reveal_type(np.nonzero(AR_b)) # E: tuple[ndarray[Any, dtype[{intp}]], ...] -reveal_type(np.nonzero(AR_f4)) # E: tuple[ndarray[Any, dtype[{intp}]], ...] - -reveal_type(np.shape(b)) # E: tuple[builtins.int, ...] -reveal_type(np.shape(f4)) # E: tuple[builtins.int, ...] -reveal_type(np.shape(f)) # E: tuple[builtins.int, ...] -reveal_type(np.shape(AR_b)) # E: tuple[builtins.int, ...] -reveal_type(np.shape(AR_f4)) # E: tuple[builtins.int, ...] - -reveal_type(np.compress([True], b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.compress([True], f4)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.compress([True], f)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.compress([True], AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.compress([True], AR_f4)) # E: ndarray[Any, dtype[{float32}]] - -reveal_type(np.clip(b, 0, 1.0)) # E: bool_ -reveal_type(np.clip(f4, -1, 1)) # E: {float32} -reveal_type(np.clip(f, 0, 1)) # E: Any -reveal_type(np.clip(AR_b, 0, 1)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.clip(AR_f4, 0, 1)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.clip([0], 0, 1)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.clip(AR_b, 0, 1, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.sum(b)) # E: bool_ -reveal_type(np.sum(f4)) # E: {float32} -reveal_type(np.sum(f)) # E: Any -reveal_type(np.sum(AR_b)) # E: bool_ -reveal_type(np.sum(AR_f4)) # E: {float32} -reveal_type(np.sum(AR_b, axis=0)) # E: Any -reveal_type(np.sum(AR_f4, axis=0)) # E: Any -reveal_type(np.sum(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.all(b)) # E: bool_ -reveal_type(np.all(f4)) # E: bool_ -reveal_type(np.all(f)) # E: bool_ -reveal_type(np.all(AR_b)) # E: bool_ -reveal_type(np.all(AR_f4)) # E: bool_ -reveal_type(np.all(AR_b, axis=0)) # E: Any -reveal_type(np.all(AR_f4, axis=0)) # E: Any -reveal_type(np.all(AR_b, keepdims=True)) # E: Any -reveal_type(np.all(AR_f4, keepdims=True)) # E: Any -reveal_type(np.all(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.any(b)) # E: bool_ -reveal_type(np.any(f4)) # E: bool_ -reveal_type(np.any(f)) # E: bool_ -reveal_type(np.any(AR_b)) # E: bool_ -reveal_type(np.any(AR_f4)) # E: bool_ -reveal_type(np.any(AR_b, axis=0)) # E: Any -reveal_type(np.any(AR_f4, axis=0)) # E: Any -reveal_type(np.any(AR_b, keepdims=True)) # E: Any -reveal_type(np.any(AR_f4, keepdims=True)) # E: Any -reveal_type(np.any(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.cumsum(b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.cumsum(f4)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.cumsum(f)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.cumsum(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.cumsum(AR_f4)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.cumsum(f, dtype=float)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.cumsum(f, dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.cumsum(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.ptp(b)) # E: bool_ -reveal_type(np.ptp(f4)) # E: {float32} -reveal_type(np.ptp(f)) # E: Any -reveal_type(np.ptp(AR_b)) # E: bool_ -reveal_type(np.ptp(AR_f4)) # E: {float32} -reveal_type(np.ptp(AR_b, axis=0)) # E: Any -reveal_type(np.ptp(AR_f4, axis=0)) # E: Any -reveal_type(np.ptp(AR_b, keepdims=True)) # E: Any -reveal_type(np.ptp(AR_f4, keepdims=True)) # E: Any -reveal_type(np.ptp(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.amax(b)) # E: bool_ -reveal_type(np.amax(f4)) # E: {float32} -reveal_type(np.amax(f)) # E: Any -reveal_type(np.amax(AR_b)) # E: bool_ -reveal_type(np.amax(AR_f4)) # E: {float32} -reveal_type(np.amax(AR_b, axis=0)) # E: Any -reveal_type(np.amax(AR_f4, axis=0)) # E: Any -reveal_type(np.amax(AR_b, keepdims=True)) # E: Any -reveal_type(np.amax(AR_f4, keepdims=True)) # E: Any -reveal_type(np.amax(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.amin(b)) # E: bool_ -reveal_type(np.amin(f4)) # E: {float32} -reveal_type(np.amin(f)) # E: Any -reveal_type(np.amin(AR_b)) # E: bool_ -reveal_type(np.amin(AR_f4)) # E: {float32} -reveal_type(np.amin(AR_b, axis=0)) # E: Any -reveal_type(np.amin(AR_f4, axis=0)) # E: Any -reveal_type(np.amin(AR_b, keepdims=True)) # E: Any -reveal_type(np.amin(AR_f4, keepdims=True)) # E: Any -reveal_type(np.amin(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.prod(AR_b)) # E: {int_} -reveal_type(np.prod(AR_u8)) # E: {uint64} -reveal_type(np.prod(AR_i8)) # E: {int64} -reveal_type(np.prod(AR_f4)) # E: floating[Any] -reveal_type(np.prod(AR_c16)) # E: complexfloating[Any, Any] -reveal_type(np.prod(AR_O)) # E: Any -reveal_type(np.prod(AR_f4, axis=0)) # E: Any -reveal_type(np.prod(AR_f4, keepdims=True)) # E: Any -reveal_type(np.prod(AR_f4, dtype=np.float64)) # E: {float64} -reveal_type(np.prod(AR_f4, dtype=float)) # E: Any -reveal_type(np.prod(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.cumprod(AR_b)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.cumprod(AR_u8)) # E: ndarray[Any, dtype[{uint64}]] -reveal_type(np.cumprod(AR_i8)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.cumprod(AR_f4)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.cumprod(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.cumprod(AR_O)) # E: ndarray[Any, dtype[object_]] -reveal_type(np.cumprod(AR_f4, axis=0)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.cumprod(AR_f4, dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.cumprod(AR_f4, dtype=float)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.cumprod(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.ndim(b)) # E: int -reveal_type(np.ndim(f4)) # E: int -reveal_type(np.ndim(f)) # E: int -reveal_type(np.ndim(AR_b)) # E: int -reveal_type(np.ndim(AR_f4)) # E: int - -reveal_type(np.size(b)) # E: int -reveal_type(np.size(f4)) # E: int -reveal_type(np.size(f)) # E: int -reveal_type(np.size(AR_b)) # E: int -reveal_type(np.size(AR_f4)) # E: int - -reveal_type(np.around(b)) # E: {float16} -reveal_type(np.around(f)) # E: Any -reveal_type(np.around(i8)) # E: {int64} -reveal_type(np.around(f4)) # E: {float32} -reveal_type(np.around(AR_b)) # E: ndarray[Any, dtype[{float16}]] -reveal_type(np.around(AR_i8)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.around(AR_f4)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.around([1.5])) # E: ndarray[Any, dtype[Any]] -reveal_type(np.around(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.mean(AR_b)) # E: floating[Any] -reveal_type(np.mean(AR_i8)) # E: floating[Any] -reveal_type(np.mean(AR_f4)) # E: floating[Any] -reveal_type(np.mean(AR_c16)) # E: complexfloating[Any, Any] -reveal_type(np.mean(AR_O)) # E: Any -reveal_type(np.mean(AR_f4, axis=0)) # E: Any -reveal_type(np.mean(AR_f4, keepdims=True)) # E: Any -reveal_type(np.mean(AR_f4, dtype=float)) # E: Any -reveal_type(np.mean(AR_f4, dtype=np.float64)) # E: {float64} -reveal_type(np.mean(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.std(AR_b)) # E: floating[Any] -reveal_type(np.std(AR_i8)) # E: floating[Any] -reveal_type(np.std(AR_f4)) # E: floating[Any] -reveal_type(np.std(AR_c16)) # E: floating[Any] -reveal_type(np.std(AR_O)) # E: Any -reveal_type(np.std(AR_f4, axis=0)) # E: Any -reveal_type(np.std(AR_f4, keepdims=True)) # E: Any -reveal_type(np.std(AR_f4, dtype=float)) # E: Any -reveal_type(np.std(AR_f4, dtype=np.float64)) # E: {float64} -reveal_type(np.std(AR_f4, out=AR_subclass)) # E: NDArraySubclass - -reveal_type(np.var(AR_b)) # E: floating[Any] -reveal_type(np.var(AR_i8)) # E: floating[Any] -reveal_type(np.var(AR_f4)) # E: floating[Any] -reveal_type(np.var(AR_c16)) # E: floating[Any] -reveal_type(np.var(AR_O)) # E: Any -reveal_type(np.var(AR_f4, axis=0)) # E: Any -reveal_type(np.var(AR_f4, keepdims=True)) # E: Any -reveal_type(np.var(AR_f4, dtype=float)) # E: Any -reveal_type(np.var(AR_f4, dtype=np.float64)) # E: {float64} -reveal_type(np.var(AR_f4, out=AR_subclass)) # E: NDArraySubclass +assert_type(np.swapaxes([[0, 1]], 0, 0), npt.NDArray[Any]) +assert_type(np.swapaxes(AR_b, 0, 0), npt.NDArray[np.bool_]) +assert_type(np.swapaxes(AR_f4, 0, 0), npt.NDArray[np.float32]) + +assert_type(np.transpose(b), npt.NDArray[np.bool_]) +assert_type(np.transpose(f4), npt.NDArray[np.float32]) +assert_type(np.transpose(f), npt.NDArray[Any]) +assert_type(np.transpose(AR_b), npt.NDArray[np.bool_]) +assert_type(np.transpose(AR_f4), npt.NDArray[np.float32]) + +assert_type(np.partition(b, 0, axis=None), npt.NDArray[np.bool_]) +assert_type(np.partition(f4, 0, axis=None), npt.NDArray[np.float32]) +assert_type(np.partition(f, 0, axis=None), npt.NDArray[Any]) +assert_type(np.partition(AR_b, 0), npt.NDArray[np.bool_]) +assert_type(np.partition(AR_f4, 0), npt.NDArray[np.float32]) + +assert_type(np.argpartition(b, 0), npt.NDArray[np.intp]) +assert_type(np.argpartition(f4, 0), npt.NDArray[np.intp]) +assert_type(np.argpartition(f, 0), npt.NDArray[np.intp]) +assert_type(np.argpartition(AR_b, 0), npt.NDArray[np.intp]) +assert_type(np.argpartition(AR_f4, 0), npt.NDArray[np.intp]) + +assert_type(np.sort([2, 1], 0), npt.NDArray[Any]) +assert_type(np.sort(AR_b, 0), npt.NDArray[np.bool_]) +assert_type(np.sort(AR_f4, 0), npt.NDArray[np.float32]) + +assert_type(np.argsort(AR_b, 0), npt.NDArray[np.intp]) +assert_type(np.argsort(AR_f4, 0), npt.NDArray[np.intp]) + +assert_type(np.argmax(AR_b), np.intp) +assert_type(np.argmax(AR_f4), np.intp) +assert_type(np.argmax(AR_b, axis=0), Any) +assert_type(np.argmax(AR_f4, axis=0), Any) +assert_type(np.argmax(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.argmin(AR_b), np.intp) +assert_type(np.argmin(AR_f4), np.intp) +assert_type(np.argmin(AR_b, axis=0), Any) +assert_type(np.argmin(AR_f4, axis=0), Any) +assert_type(np.argmin(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.searchsorted(AR_b[0], 0), np.intp) +assert_type(np.searchsorted(AR_f4[0], 0), np.intp) +assert_type(np.searchsorted(AR_b[0], [0]), npt.NDArray[np.intp]) +assert_type(np.searchsorted(AR_f4[0], [0]), npt.NDArray[np.intp]) + +assert_type(np.resize(b, (5, 5)), npt.NDArray[np.bool_]) +assert_type(np.resize(f4, (5, 5)), npt.NDArray[np.float32]) +assert_type(np.resize(f, (5, 5)), npt.NDArray[Any]) +assert_type(np.resize(AR_b, (5, 5)), npt.NDArray[np.bool_]) +assert_type(np.resize(AR_f4, (5, 5)), npt.NDArray[np.float32]) + +assert_type(np.squeeze(b), np.bool_) +assert_type(np.squeeze(f4), np.float32) +assert_type(np.squeeze(f), npt.NDArray[Any]) +assert_type(np.squeeze(AR_b), npt.NDArray[np.bool_]) +assert_type(np.squeeze(AR_f4), npt.NDArray[np.float32]) + +assert_type(np.diagonal(AR_b), npt.NDArray[np.bool_]) +assert_type(np.diagonal(AR_f4), npt.NDArray[np.float32]) + +assert_type(np.trace(AR_b), Any) +assert_type(np.trace(AR_f4), Any) +assert_type(np.trace(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.ravel(b), npt.NDArray[np.bool_]) +assert_type(np.ravel(f4), npt.NDArray[np.float32]) +assert_type(np.ravel(f), npt.NDArray[Any]) +assert_type(np.ravel(AR_b), npt.NDArray[np.bool_]) +assert_type(np.ravel(AR_f4), npt.NDArray[np.float32]) + +assert_type(np.nonzero(b), tuple[npt.NDArray[np.intp], ...]) +assert_type(np.nonzero(f4), tuple[npt.NDArray[np.intp], ...]) +assert_type(np.nonzero(f), tuple[npt.NDArray[np.intp], ...]) +assert_type(np.nonzero(AR_b), tuple[npt.NDArray[np.intp], ...]) +assert_type(np.nonzero(AR_f4), tuple[npt.NDArray[np.intp], ...]) + +assert_type(np.shape(b), tuple[int, ...]) +assert_type(np.shape(f4), tuple[int, ...]) +assert_type(np.shape(f), tuple[int, ...]) +assert_type(np.shape(AR_b), tuple[int, ...]) +assert_type(np.shape(AR_f4), tuple[int, ...]) + +assert_type(np.compress([True], b), npt.NDArray[np.bool_]) +assert_type(np.compress([True], f4), npt.NDArray[np.float32]) +assert_type(np.compress([True], f), npt.NDArray[Any]) +assert_type(np.compress([True], AR_b), npt.NDArray[np.bool_]) +assert_type(np.compress([True], AR_f4), npt.NDArray[np.float32]) + +assert_type(np.clip(b, 0, 1.0), np.bool_) +assert_type(np.clip(f4, -1, 1), np.float32) +assert_type(np.clip(f, 0, 1), Any) +assert_type(np.clip(AR_b, 0, 1), npt.NDArray[np.bool_]) +assert_type(np.clip(AR_f4, 0, 1), npt.NDArray[np.float32]) +assert_type(np.clip([0], 0, 1), npt.NDArray[Any]) +assert_type(np.clip(AR_b, 0, 1, out=AR_subclass), NDArraySubclass) + +assert_type(np.sum(b), np.bool_) +assert_type(np.sum(f4), np.float32) +assert_type(np.sum(f), Any) +assert_type(np.sum(AR_b), np.bool_) +assert_type(np.sum(AR_f4), np.float32) +assert_type(np.sum(AR_b, axis=0), Any) +assert_type(np.sum(AR_f4, axis=0), Any) +assert_type(np.sum(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.all(b), np.bool_) +assert_type(np.all(f4), np.bool_) +assert_type(np.all(f), np.bool_) +assert_type(np.all(AR_b), np.bool_) +assert_type(np.all(AR_f4), np.bool_) +assert_type(np.all(AR_b, axis=0), Any) +assert_type(np.all(AR_f4, axis=0), Any) +assert_type(np.all(AR_b, keepdims=True), Any) +assert_type(np.all(AR_f4, keepdims=True), Any) +assert_type(np.all(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.any(b), np.bool_) +assert_type(np.any(f4), np.bool_) +assert_type(np.any(f), np.bool_) +assert_type(np.any(AR_b), np.bool_) +assert_type(np.any(AR_f4), np.bool_) +assert_type(np.any(AR_b, axis=0), Any) +assert_type(np.any(AR_f4, axis=0), Any) +assert_type(np.any(AR_b, keepdims=True), Any) +assert_type(np.any(AR_f4, keepdims=True), Any) +assert_type(np.any(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.cumsum(b), npt.NDArray[np.bool_]) +assert_type(np.cumsum(f4), npt.NDArray[np.float32]) +assert_type(np.cumsum(f), npt.NDArray[Any]) +assert_type(np.cumsum(AR_b), npt.NDArray[np.bool_]) +assert_type(np.cumsum(AR_f4), npt.NDArray[np.float32]) +assert_type(np.cumsum(f, dtype=float), npt.NDArray[Any]) +assert_type(np.cumsum(f, dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.cumsum(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.ptp(b), np.bool_) +assert_type(np.ptp(f4), np.float32) +assert_type(np.ptp(f), Any) +assert_type(np.ptp(AR_b), np.bool_) +assert_type(np.ptp(AR_f4), np.float32) +assert_type(np.ptp(AR_b, axis=0), Any) +assert_type(np.ptp(AR_f4, axis=0), Any) +assert_type(np.ptp(AR_b, keepdims=True), Any) +assert_type(np.ptp(AR_f4, keepdims=True), Any) +assert_type(np.ptp(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.amax(b), np.bool_) +assert_type(np.amax(f4), np.float32) +assert_type(np.amax(f), Any) +assert_type(np.amax(AR_b), np.bool_) +assert_type(np.amax(AR_f4), np.float32) +assert_type(np.amax(AR_b, axis=0), Any) +assert_type(np.amax(AR_f4, axis=0), Any) +assert_type(np.amax(AR_b, keepdims=True), Any) +assert_type(np.amax(AR_f4, keepdims=True), Any) +assert_type(np.amax(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.amin(b), np.bool_) +assert_type(np.amin(f4), np.float32) +assert_type(np.amin(f), Any) +assert_type(np.amin(AR_b), np.bool_) +assert_type(np.amin(AR_f4), np.float32) +assert_type(np.amin(AR_b, axis=0), Any) +assert_type(np.amin(AR_f4, axis=0), Any) +assert_type(np.amin(AR_b, keepdims=True), Any) +assert_type(np.amin(AR_f4, keepdims=True), Any) +assert_type(np.amin(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.prod(AR_b), np.int_) +assert_type(np.prod(AR_u8), np.uint64) +assert_type(np.prod(AR_i8), np.int64) +assert_type(np.prod(AR_f4), np.floating[Any]) +assert_type(np.prod(AR_c16), np.complexfloating[Any, Any]) +assert_type(np.prod(AR_O), Any) +assert_type(np.prod(AR_f4, axis=0), Any) +assert_type(np.prod(AR_f4, keepdims=True), Any) +assert_type(np.prod(AR_f4, dtype=np.float64), np.float64) +assert_type(np.prod(AR_f4, dtype=float), Any) +assert_type(np.prod(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.cumprod(AR_b), npt.NDArray[np.int_]) +assert_type(np.cumprod(AR_u8), npt.NDArray[np.uint64]) +assert_type(np.cumprod(AR_i8), npt.NDArray[np.int64]) +assert_type(np.cumprod(AR_f4), npt.NDArray[np.floating[Any]]) +assert_type(np.cumprod(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.cumprod(AR_O), npt.NDArray[np.object_]) +assert_type(np.cumprod(AR_f4, axis=0), npt.NDArray[np.floating[Any]]) +assert_type(np.cumprod(AR_f4, dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.cumprod(AR_f4, dtype=float), npt.NDArray[Any]) +assert_type(np.cumprod(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.ndim(b), int) +assert_type(np.ndim(f4), int) +assert_type(np.ndim(f), int) +assert_type(np.ndim(AR_b), int) +assert_type(np.ndim(AR_f4), int) + +assert_type(np.size(b), int) +assert_type(np.size(f4), int) +assert_type(np.size(f), int) +assert_type(np.size(AR_b), int) +assert_type(np.size(AR_f4), int) + +assert_type(np.around(b), np.float16) +assert_type(np.around(f), Any) +assert_type(np.around(i8), np.int64) +assert_type(np.around(f4), np.float32) +assert_type(np.around(AR_b), npt.NDArray[np.float16]) +assert_type(np.around(AR_i8), npt.NDArray[np.int64]) +assert_type(np.around(AR_f4), npt.NDArray[np.float32]) +assert_type(np.around([1.5]), npt.NDArray[Any]) +assert_type(np.around(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.mean(AR_b), np.floating[Any]) +assert_type(np.mean(AR_i8), np.floating[Any]) +assert_type(np.mean(AR_f4), np.floating[Any]) +assert_type(np.mean(AR_c16), np.complexfloating[Any, Any]) +assert_type(np.mean(AR_O), Any) +assert_type(np.mean(AR_f4, axis=0), Any) +assert_type(np.mean(AR_f4, keepdims=True), Any) +assert_type(np.mean(AR_f4, dtype=float), Any) +assert_type(np.mean(AR_f4, dtype=np.float64), np.float64) +assert_type(np.mean(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.std(AR_b), np.floating[Any]) +assert_type(np.std(AR_i8), np.floating[Any]) +assert_type(np.std(AR_f4), np.floating[Any]) +assert_type(np.std(AR_c16), np.floating[Any]) +assert_type(np.std(AR_O), Any) +assert_type(np.std(AR_f4, axis=0), Any) +assert_type(np.std(AR_f4, keepdims=True), Any) +assert_type(np.std(AR_f4, dtype=float), Any) +assert_type(np.std(AR_f4, dtype=np.float64), np.float64) +assert_type(np.std(AR_f4, out=AR_subclass), NDArraySubclass) + +assert_type(np.var(AR_b), np.floating[Any]) +assert_type(np.var(AR_i8), np.floating[Any]) +assert_type(np.var(AR_f4), np.floating[Any]) +assert_type(np.var(AR_c16), np.floating[Any]) +assert_type(np.var(AR_O), Any) +assert_type(np.var(AR_f4, axis=0), Any) +assert_type(np.var(AR_f4, keepdims=True), Any) +assert_type(np.var(AR_f4, dtype=float), Any) +assert_type(np.var(AR_f4, dtype=np.float64), np.float64) +assert_type(np.var(AR_f4, out=AR_subclass), NDArraySubclass) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/getlimits.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/getlimits.pyi index 1614b577ee..f53fdf4882 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/getlimits.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/getlimits.pyi @@ -1,4 +1,13 @@ +import sys +from typing import Any + import numpy as np + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + f: float f8: np.float64 c8: np.complex64 @@ -10,38 +19,38 @@ u4: np.uint32 finfo_f8: np.finfo[np.float64] iinfo_i8: np.iinfo[np.int64] -reveal_type(np.finfo(f)) # E: finfo[{double}] -reveal_type(np.finfo(f8)) # E: finfo[{float64}] -reveal_type(np.finfo(c8)) # E: finfo[{float32}] -reveal_type(np.finfo('f2')) # E: finfo[floating[Any]] - -reveal_type(finfo_f8.dtype) # E: dtype[{float64}] -reveal_type(finfo_f8.bits) # E: int -reveal_type(finfo_f8.eps) # E: {float64} -reveal_type(finfo_f8.epsneg) # E: {float64} -reveal_type(finfo_f8.iexp) # E: int -reveal_type(finfo_f8.machep) # E: int -reveal_type(finfo_f8.max) # E: {float64} -reveal_type(finfo_f8.maxexp) # E: int -reveal_type(finfo_f8.min) # E: {float64} -reveal_type(finfo_f8.minexp) # E: int -reveal_type(finfo_f8.negep) # E: int -reveal_type(finfo_f8.nexp) # E: int -reveal_type(finfo_f8.nmant) # E: int -reveal_type(finfo_f8.precision) # E: int -reveal_type(finfo_f8.resolution) # E: {float64} -reveal_type(finfo_f8.tiny) # E: {float64} -reveal_type(finfo_f8.smallest_normal) # E: {float64} -reveal_type(finfo_f8.smallest_subnormal) # E: {float64} - -reveal_type(np.iinfo(i)) # E: iinfo[{int_}] -reveal_type(np.iinfo(i8)) # E: iinfo[{int64}] -reveal_type(np.iinfo(u4)) # E: iinfo[{uint32}] -reveal_type(np.iinfo('i2')) # E: iinfo[Any] - -reveal_type(iinfo_i8.dtype) # E: dtype[{int64}] -reveal_type(iinfo_i8.kind) # E: str -reveal_type(iinfo_i8.bits) # E: int -reveal_type(iinfo_i8.key) # E: str -reveal_type(iinfo_i8.min) # E: int -reveal_type(iinfo_i8.max) # E: int +assert_type(np.finfo(f), np.finfo[np.double]) +assert_type(np.finfo(f8), np.finfo[np.float64]) +assert_type(np.finfo(c8), np.finfo[np.float32]) +assert_type(np.finfo('f2'), np.finfo[np.floating[Any]]) + +assert_type(finfo_f8.dtype, np.dtype[np.float64]) +assert_type(finfo_f8.bits, int) +assert_type(finfo_f8.eps, np.float64) +assert_type(finfo_f8.epsneg, np.float64) +assert_type(finfo_f8.iexp, int) +assert_type(finfo_f8.machep, int) +assert_type(finfo_f8.max, np.float64) +assert_type(finfo_f8.maxexp, int) +assert_type(finfo_f8.min, np.float64) +assert_type(finfo_f8.minexp, int) +assert_type(finfo_f8.negep, int) +assert_type(finfo_f8.nexp, int) +assert_type(finfo_f8.nmant, int) +assert_type(finfo_f8.precision, int) +assert_type(finfo_f8.resolution, np.float64) +assert_type(finfo_f8.tiny, np.float64) +assert_type(finfo_f8.smallest_normal, np.float64) +assert_type(finfo_f8.smallest_subnormal, np.float64) + +assert_type(np.iinfo(i), np.iinfo[np.int_]) +assert_type(np.iinfo(i8), np.iinfo[np.int64]) +assert_type(np.iinfo(u4), np.iinfo[np.uint32]) +assert_type(np.iinfo('i2'), np.iinfo[Any]) + +assert_type(iinfo_i8.dtype, np.dtype[np.int64]) +assert_type(iinfo_i8.kind, str) +assert_type(iinfo_i8.bits, int) +assert_type(iinfo_i8.key, str) +assert_type(iinfo_i8.min, int) +assert_type(iinfo_i8.max, int) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/histograms.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/histograms.pyi index d96e44f096..68df0b96f4 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/histograms.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/histograms.pyi @@ -1,19 +1,27 @@ +import sys +from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_i8: npt.NDArray[np.int64] AR_f8: npt.NDArray[np.float64] -reveal_type(np.histogram_bin_edges(AR_i8, bins="auto")) # E: ndarray[Any, dtype[Any]] -reveal_type(np.histogram_bin_edges(AR_i8, bins="rice", range=(0, 3))) # E: ndarray[Any, dtype[Any]] -reveal_type(np.histogram_bin_edges(AR_i8, bins="scott", weights=AR_f8)) # E: ndarray[Any, dtype[Any]] +assert_type(np.histogram_bin_edges(AR_i8, bins="auto"), npt.NDArray[Any]) +assert_type(np.histogram_bin_edges(AR_i8, bins="rice", range=(0, 3)), npt.NDArray[Any]) +assert_type(np.histogram_bin_edges(AR_i8, bins="scott", weights=AR_f8), npt.NDArray[Any]) -reveal_type(np.histogram(AR_i8, bins="auto")) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] -reveal_type(np.histogram(AR_i8, bins="rice", range=(0, 3))) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] -reveal_type(np.histogram(AR_i8, bins="scott", weights=AR_f8)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] -reveal_type(np.histogram(AR_f8, bins=1, density=True)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] +assert_type(np.histogram(AR_i8, bins="auto"), tuple[npt.NDArray[Any], npt.NDArray[Any]]) +assert_type(np.histogram(AR_i8, bins="rice", range=(0, 3)), tuple[npt.NDArray[Any], npt.NDArray[Any]]) +assert_type(np.histogram(AR_i8, bins="scott", weights=AR_f8), tuple[npt.NDArray[Any], npt.NDArray[Any]]) +assert_type(np.histogram(AR_f8, bins=1, density=True), tuple[npt.NDArray[Any], npt.NDArray[Any]]) -reveal_type(np.histogramdd(AR_i8, bins=[1])) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] -reveal_type(np.histogramdd(AR_i8, range=[(0, 3)])) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] -reveal_type(np.histogramdd(AR_i8, weights=AR_f8)) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] -reveal_type(np.histogramdd(AR_f8, density=True)) # E: Tuple[ndarray[Any, dtype[Any]], builtins.list[ndarray[Any, dtype[Any]]]] +assert_type(np.histogramdd(AR_i8, bins=[1]), tuple[npt.NDArray[Any], list[npt.NDArray[Any]]]) +assert_type(np.histogramdd(AR_i8, range=[(0, 3)]), tuple[npt.NDArray[Any], list[npt.NDArray[Any]]]) +assert_type(np.histogramdd(AR_i8, weights=AR_f8), tuple[npt.NDArray[Any], list[npt.NDArray[Any]]]) +assert_type(np.histogramdd(AR_f8, density=True), tuple[npt.NDArray[Any], list[npt.NDArray[Any]]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/index_tricks.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/index_tricks.pyi index 707d6f3d42..e74eb56768 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/index_tricks.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/index_tricks.pyi @@ -1,5 +1,13 @@ -from typing import Any +import sys +from typing import Any, Literal + import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR_LIKE_b: list[bool] AR_LIKE_i: list[int] @@ -8,59 +16,59 @@ AR_LIKE_U: list[str] AR_i8: np.ndarray[Any, np.dtype[np.int64]] -reveal_type(np.ndenumerate(AR_i8)) # E: ndenumerate[{int64}] -reveal_type(np.ndenumerate(AR_LIKE_f)) # E: ndenumerate[{double}] -reveal_type(np.ndenumerate(AR_LIKE_U)) # E: ndenumerate[str_] +assert_type(np.ndenumerate(AR_i8), np.ndenumerate[np.int64]) +assert_type(np.ndenumerate(AR_LIKE_f), np.ndenumerate[np.float64]) +assert_type(np.ndenumerate(AR_LIKE_U), np.ndenumerate[np.str_]) -reveal_type(np.ndenumerate(AR_i8).iter) # E: flatiter[ndarray[Any, dtype[{int64}]]] -reveal_type(np.ndenumerate(AR_LIKE_f).iter) # E: flatiter[ndarray[Any, dtype[{double}]]] -reveal_type(np.ndenumerate(AR_LIKE_U).iter) # E: flatiter[ndarray[Any, dtype[str_]]] +assert_type(np.ndenumerate(AR_i8).iter, np.flatiter[npt.NDArray[np.int64]]) +assert_type(np.ndenumerate(AR_LIKE_f).iter, np.flatiter[npt.NDArray[np.float64]]) +assert_type(np.ndenumerate(AR_LIKE_U).iter, np.flatiter[npt.NDArray[np.str_]]) -reveal_type(next(np.ndenumerate(AR_i8))) # E: Tuple[builtins.tuple[builtins.int, ...], {int64}] -reveal_type(next(np.ndenumerate(AR_LIKE_f))) # E: Tuple[builtins.tuple[builtins.int, ...], {double}] -reveal_type(next(np.ndenumerate(AR_LIKE_U))) # E: Tuple[builtins.tuple[builtins.int, ...], str_] +assert_type(next(np.ndenumerate(AR_i8)), tuple[tuple[int, ...], np.int64]) +assert_type(next(np.ndenumerate(AR_LIKE_f)), tuple[tuple[int, ...], np.float64]) +assert_type(next(np.ndenumerate(AR_LIKE_U)), tuple[tuple[int, ...], np.str_]) -reveal_type(iter(np.ndenumerate(AR_i8))) # E: ndenumerate[{int64}] -reveal_type(iter(np.ndenumerate(AR_LIKE_f))) # E: ndenumerate[{double}] -reveal_type(iter(np.ndenumerate(AR_LIKE_U))) # E: ndenumerate[str_] +assert_type(iter(np.ndenumerate(AR_i8)), np.ndenumerate[np.int64]) +assert_type(iter(np.ndenumerate(AR_LIKE_f)), np.ndenumerate[np.float64]) +assert_type(iter(np.ndenumerate(AR_LIKE_U)), np.ndenumerate[np.str_]) -reveal_type(np.ndindex(1, 2, 3)) # E: numpy.ndindex -reveal_type(np.ndindex((1, 2, 3))) # E: numpy.ndindex -reveal_type(iter(np.ndindex(1, 2, 3))) # E: ndindex -reveal_type(next(np.ndindex(1, 2, 3))) # E: builtins.tuple[builtins.int, ...] +assert_type(np.ndindex(1, 2, 3), np.ndindex) +assert_type(np.ndindex((1, 2, 3)), np.ndindex) +assert_type(iter(np.ndindex(1, 2, 3)), np.ndindex) +assert_type(next(np.ndindex(1, 2, 3)), tuple[int, ...]) -reveal_type(np.unravel_index([22, 41, 37], (7, 6))) # E: tuple[ndarray[Any, dtype[{intp}]], ...] -reveal_type(np.unravel_index([31, 41, 13], (7, 6), order="F")) # E: tuple[ndarray[Any, dtype[{intp}]], ...] -reveal_type(np.unravel_index(1621, (6, 7, 8, 9))) # E: tuple[{intp}, ...] +assert_type(np.unravel_index([22, 41, 37], (7, 6)), tuple[npt.NDArray[np.intp], ...]) +assert_type(np.unravel_index([31, 41, 13], (7, 6), order="F"), tuple[npt.NDArray[np.intp], ...]) +assert_type(np.unravel_index(1621, (6, 7, 8, 9)), tuple[np.intp, ...]) -reveal_type(np.ravel_multi_index([[1]], (7, 6))) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.ravel_multi_index(AR_LIKE_i, (7, 6))) # E: {intp} -reveal_type(np.ravel_multi_index(AR_LIKE_i, (7, 6), order="F")) # E: {intp} -reveal_type(np.ravel_multi_index(AR_LIKE_i, (4, 6), mode="clip")) # E: {intp} -reveal_type(np.ravel_multi_index(AR_LIKE_i, (4, 4), mode=("clip", "wrap"))) # E: {intp} -reveal_type(np.ravel_multi_index((3, 1, 4, 1), (6, 7, 8, 9))) # E: {intp} +assert_type(np.ravel_multi_index([[1]], (7, 6)), npt.NDArray[np.intp]) +assert_type(np.ravel_multi_index(AR_LIKE_i, (7, 6)), np.intp) +assert_type(np.ravel_multi_index(AR_LIKE_i, (7, 6), order="F"), np.intp) +assert_type(np.ravel_multi_index(AR_LIKE_i, (4, 6), mode="clip"), np.intp) +assert_type(np.ravel_multi_index(AR_LIKE_i, (4, 4), mode=("clip", "wrap")), np.intp) +assert_type(np.ravel_multi_index((3, 1, 4, 1), (6, 7, 8, 9)), np.intp) -reveal_type(np.mgrid[1:1:2]) # E: ndarray[Any, dtype[Any]] -reveal_type(np.mgrid[1:1:2, None:10]) # E: ndarray[Any, dtype[Any]] +assert_type(np.mgrid[1:1:2], npt.NDArray[Any]) +assert_type(np.mgrid[1:1:2, None:10], npt.NDArray[Any]) -reveal_type(np.ogrid[1:1:2]) # E: list[ndarray[Any, dtype[Any]]] -reveal_type(np.ogrid[1:1:2, None:10]) # E: list[ndarray[Any, dtype[Any]]] +assert_type(np.ogrid[1:1:2], list[npt.NDArray[Any]]) +assert_type(np.ogrid[1:1:2, None:10], list[npt.NDArray[Any]]) -reveal_type(np.index_exp[0:1]) # E: Tuple[builtins.slice] -reveal_type(np.index_exp[0:1, None:3]) # E: Tuple[builtins.slice, builtins.slice] -reveal_type(np.index_exp[0, 0:1, ..., [0, 1, 3]]) # E: Tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]] +assert_type(np.index_exp[0:1], tuple[slice]) +assert_type(np.index_exp[0:1, None:3], tuple[slice, slice]) +assert_type(np.index_exp[0, 0:1, ..., [0, 1, 3]], tuple[Literal[0], slice, ellipsis, list[int]]) -reveal_type(np.s_[0:1]) # E: builtins.slice -reveal_type(np.s_[0:1, None:3]) # E: Tuple[builtins.slice, builtins.slice] -reveal_type(np.s_[0, 0:1, ..., [0, 1, 3]]) # E: Tuple[Literal[0]?, builtins.slice, builtins.ellipsis, builtins.list[builtins.int]] +assert_type(np.s_[0:1], slice) +assert_type(np.s_[0:1, None:3], tuple[slice, slice]) +assert_type(np.s_[0, 0:1, ..., [0, 1, 3]], tuple[Literal[0], slice, ellipsis, list[int]]) -reveal_type(np.ix_(AR_LIKE_b)) # E: tuple[ndarray[Any, dtype[bool_]], ...] -reveal_type(np.ix_(AR_LIKE_i, AR_LIKE_f)) # E: tuple[ndarray[Any, dtype[{double}]], ...] -reveal_type(np.ix_(AR_i8)) # E: tuple[ndarray[Any, dtype[{int64}]], ...] +assert_type(np.ix_(AR_LIKE_b), tuple[npt.NDArray[np.bool_], ...]) +assert_type(np.ix_(AR_LIKE_i, AR_LIKE_f), tuple[npt.NDArray[np.float64], ...]) +assert_type(np.ix_(AR_i8), tuple[npt.NDArray[np.int64], ...]) -reveal_type(np.fill_diagonal(AR_i8, 5)) # E: None +assert_type(np.fill_diagonal(AR_i8, 5), None) -reveal_type(np.diag_indices(4)) # E: tuple[ndarray[Any, dtype[{int_}]], ...] -reveal_type(np.diag_indices(2, 3)) # E: tuple[ndarray[Any, dtype[{int_}]], ...] +assert_type(np.diag_indices(4), tuple[npt.NDArray[np.int_], ...]) +assert_type(np.diag_indices(2, 3), tuple[npt.NDArray[np.int_], ...]) -reveal_type(np.diag_indices_from(AR_i8)) # E: tuple[ndarray[Any, dtype[{int_}]], ...] +assert_type(np.diag_indices_from(AR_i8), tuple[npt.NDArray[np.int_], ...]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_function_base.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_function_base.pyi index a8b9b01ac9..0420511a7d 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_function_base.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_function_base.pyi @@ -1,8 +1,15 @@ +import sys from typing import Any +from collections.abc import Callable import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + vectorized_func: np.vectorize f8: np.float64 @@ -20,158 +27,159 @@ CHAR_AR_U: np.chararray[Any, np.dtype[np.str_]] def func(*args: Any, **kwargs: Any) -> Any: ... -reveal_type(vectorized_func.pyfunc) # E: def (*Any, **Any) -> Any -reveal_type(vectorized_func.cache) # E: bool -reveal_type(vectorized_func.signature) # E: Union[None, builtins.str] -reveal_type(vectorized_func.otypes) # E: Union[None, builtins.str] -reveal_type(vectorized_func.excluded) # E: set[Union[builtins.int, builtins.str]] -reveal_type(vectorized_func.__doc__) # E: Union[None, builtins.str] -reveal_type(vectorized_func([1])) # E: Any -reveal_type(np.vectorize(int)) # E: vectorize -reveal_type(np.vectorize( # E: vectorize - int, otypes="i", doc="doc", excluded=(), cache=True, signature=None -)) - -reveal_type(np.add_newdoc("__main__", "blabla", doc="test doc")) # E: None -reveal_type(np.add_newdoc("__main__", "blabla", doc=("meth", "test doc"))) # E: None -reveal_type(np.add_newdoc("__main__", "blabla", doc=[("meth", "test doc")])) # E: None - -reveal_type(np.rot90(AR_f8, k=2)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.rot90(AR_LIKE_f8, axes=(0, 1))) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.flip(f8)) # E: {float64} -reveal_type(np.flip(1.0)) # E: Any -reveal_type(np.flip(AR_f8, axis=(0, 1))) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.flip(AR_LIKE_f8, axis=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.iterable(1)) # E: bool -reveal_type(np.iterable([1])) # E: bool - -reveal_type(np.average(AR_f8)) # E: floating[Any] -reveal_type(np.average(AR_f8, weights=AR_c16)) # E: complexfloating[Any, Any] -reveal_type(np.average(AR_O)) # E: Any -reveal_type(np.average(AR_f8, returned=True)) # E: Tuple[floating[Any], floating[Any]] -reveal_type(np.average(AR_f8, weights=AR_c16, returned=True)) # E: Tuple[complexfloating[Any, Any], complexfloating[Any, Any]] -reveal_type(np.average(AR_O, returned=True)) # E: Tuple[Any, Any] -reveal_type(np.average(AR_f8, axis=0)) # E: Any -reveal_type(np.average(AR_f8, axis=0, returned=True)) # E: Tuple[Any, Any] - -reveal_type(np.asarray_chkfinite(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asarray_chkfinite(AR_LIKE_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.asarray_chkfinite(AR_f8, dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asarray_chkfinite(AR_f8, dtype=float)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.piecewise(AR_f8, AR_b, [func])) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.piecewise(AR_LIKE_f8, AR_b, [func])) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.select([AR_f8], [AR_f8])) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.copy(AR_LIKE_f8)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.copy(AR_U)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.copy(CHAR_AR_U)) # E: ndarray[Any, Any] -reveal_type(np.copy(CHAR_AR_U, "K", subok=True)) # E: chararray[Any, dtype[str_]] -reveal_type(np.copy(CHAR_AR_U, subok=True)) # E: chararray[Any, dtype[str_]] - -reveal_type(np.gradient(AR_f8, axis=None)) # E: Any -reveal_type(np.gradient(AR_LIKE_f8, edge_order=2)) # E: Any - -reveal_type(np.diff("bob", n=0)) # E: str -reveal_type(np.diff(AR_f8, axis=0)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.diff(AR_LIKE_f8, prepend=1.5)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.angle(f8)) # E: floating[Any] -reveal_type(np.angle(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.angle(AR_c16, deg=True)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.angle(AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.unwrap(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.unwrap(AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.sort_complex(AR_f8)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.trim_zeros(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.trim_zeros(AR_LIKE_f8)) # E: list[builtins.float] - -reveal_type(np.extract(AR_i8, AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.extract(AR_i8, AR_LIKE_f8)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.place(AR_f8, mask=AR_i8, vals=5.0)) # E: None - -reveal_type(np.disp(1, linefeed=True)) # E: None +assert_type(vectorized_func.pyfunc, Callable[..., Any]) +assert_type(vectorized_func.cache, bool) +assert_type(vectorized_func.signature, None | str) +assert_type(vectorized_func.otypes, None | str) +assert_type(vectorized_func.excluded, set[int | str]) +assert_type(vectorized_func.__doc__, None | str) +assert_type(vectorized_func([1]), Any) +assert_type(np.vectorize(int), np.vectorize) +assert_type( + np.vectorize(int, otypes="i", doc="doc", excluded=(), cache=True, signature=None), + np.vectorize, +) + +assert_type(np.add_newdoc("__main__", "blabla", doc="test doc"), None) +assert_type(np.add_newdoc("__main__", "blabla", doc=("meth", "test doc")), None) +assert_type(np.add_newdoc("__main__", "blabla", doc=[("meth", "test doc")]), None) + +assert_type(np.rot90(AR_f8, k=2), npt.NDArray[np.float64]) +assert_type(np.rot90(AR_LIKE_f8, axes=(0, 1)), npt.NDArray[Any]) + +assert_type(np.flip(f8), np.float64) +assert_type(np.flip(1.0), Any) +assert_type(np.flip(AR_f8, axis=(0, 1)), npt.NDArray[np.float64]) +assert_type(np.flip(AR_LIKE_f8, axis=0), npt.NDArray[Any]) + +assert_type(np.iterable(1), bool) +assert_type(np.iterable([1]), bool) + +assert_type(np.average(AR_f8), np.floating[Any]) +assert_type(np.average(AR_f8, weights=AR_c16), np.complexfloating[Any, Any]) +assert_type(np.average(AR_O), Any) +assert_type(np.average(AR_f8, returned=True), tuple[np.floating[Any], np.floating[Any]]) +assert_type(np.average(AR_f8, weights=AR_c16, returned=True), tuple[np.complexfloating[Any, Any], np.complexfloating[Any, Any]]) +assert_type(np.average(AR_O, returned=True), tuple[Any, Any]) +assert_type(np.average(AR_f8, axis=0), Any) +assert_type(np.average(AR_f8, axis=0, returned=True), tuple[Any, Any]) + +assert_type(np.asarray_chkfinite(AR_f8), npt.NDArray[np.float64]) +assert_type(np.asarray_chkfinite(AR_LIKE_f8), npt.NDArray[Any]) +assert_type(np.asarray_chkfinite(AR_f8, dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.asarray_chkfinite(AR_f8, dtype=float), npt.NDArray[Any]) + +assert_type(np.piecewise(AR_f8, AR_b, [func]), npt.NDArray[np.float64]) +assert_type(np.piecewise(AR_LIKE_f8, AR_b, [func]), npt.NDArray[Any]) + +assert_type(np.select([AR_f8], [AR_f8]), npt.NDArray[Any]) + +assert_type(np.copy(AR_LIKE_f8), npt.NDArray[Any]) +assert_type(np.copy(AR_U), npt.NDArray[np.str_]) +assert_type(np.copy(CHAR_AR_U), np.ndarray[Any, Any]) +assert_type(np.copy(CHAR_AR_U, "K", subok=True), np.chararray[Any, np.dtype[np.str_]]) +assert_type(np.copy(CHAR_AR_U, subok=True), np.chararray[Any, np.dtype[np.str_]]) + +assert_type(np.gradient(AR_f8, axis=None), Any) +assert_type(np.gradient(AR_LIKE_f8, edge_order=2), Any) + +assert_type(np.diff("bob", n=0), str) +assert_type(np.diff(AR_f8, axis=0), npt.NDArray[Any]) +assert_type(np.diff(AR_LIKE_f8, prepend=1.5), npt.NDArray[Any]) + +assert_type(np.angle(f8), np.floating[Any]) +assert_type(np.angle(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.angle(AR_c16, deg=True), npt.NDArray[np.floating[Any]]) +assert_type(np.angle(AR_O), npt.NDArray[np.object_]) + +assert_type(np.unwrap(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.unwrap(AR_O), npt.NDArray[np.object_]) + +assert_type(np.sort_complex(AR_f8), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.trim_zeros(AR_f8), npt.NDArray[np.float64]) +assert_type(np.trim_zeros(AR_LIKE_f8), list[float]) + +assert_type(np.extract(AR_i8, AR_f8), npt.NDArray[np.float64]) +assert_type(np.extract(AR_i8, AR_LIKE_f8), npt.NDArray[Any]) + +assert_type(np.place(AR_f8, mask=AR_i8, vals=5.0), None) + +assert_type(np.disp(1, linefeed=True), None) with open("test", "w") as f: - reveal_type(np.disp("message", device=f)) # E: None - -reveal_type(np.cov(AR_f8, bias=True)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.cov(AR_f8, AR_c16, ddof=1)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.cov(AR_f8, aweights=AR_f8, dtype=np.float32)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.cov(AR_f8, fweights=AR_f8, dtype=float)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.corrcoef(AR_f8, rowvar=True)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.corrcoef(AR_f8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.corrcoef(AR_f8, dtype=np.float32)) # E: ndarray[Any, dtype[{float32}]] -reveal_type(np.corrcoef(AR_f8, dtype=float)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.blackman(5)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.bartlett(6)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.hanning(4.5)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.hamming(0)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.i0(AR_i8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.kaiser(4, 5.9)) # E: ndarray[Any, dtype[floating[Any]]] - -reveal_type(np.sinc(1.0)) # E: floating[Any] -reveal_type(np.sinc(1j)) # E: complexfloating[Any, Any] -reveal_type(np.sinc(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.sinc(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.median(AR_f8, keepdims=False)) # E: floating[Any] -reveal_type(np.median(AR_c16, overwrite_input=True)) # E: complexfloating[Any, Any] -reveal_type(np.median(AR_m)) # E: timedelta64 -reveal_type(np.median(AR_O)) # E: Any -reveal_type(np.median(AR_f8, keepdims=True)) # E: Any -reveal_type(np.median(AR_c16, axis=0)) # E: Any -reveal_type(np.median(AR_LIKE_f8, out=AR_c16)) # E: ndarray[Any, dtype[{complex128}]] - -reveal_type(np.add_newdoc_ufunc(np.add, "docstring")) # E: None - -reveal_type(np.percentile(AR_f8, 50)) # E: floating[Any] -reveal_type(np.percentile(AR_c16, 50)) # E: complexfloating[Any, Any] -reveal_type(np.percentile(AR_m, 50)) # E: timedelta64 -reveal_type(np.percentile(AR_M, 50, overwrite_input=True)) # E: datetime64 -reveal_type(np.percentile(AR_O, 50)) # E: Any -reveal_type(np.percentile(AR_f8, [50])) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.percentile(AR_c16, [50])) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.percentile(AR_m, [50])) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.percentile(AR_M, [50], method="nearest")) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.percentile(AR_O, [50])) # E: ndarray[Any, dtype[object_]] -reveal_type(np.percentile(AR_f8, [50], keepdims=True)) # E: Any -reveal_type(np.percentile(AR_f8, [50], axis=[1])) # E: Any -reveal_type(np.percentile(AR_f8, [50], out=AR_c16)) # E: ndarray[Any, dtype[{complex128}]] - -reveal_type(np.quantile(AR_f8, 0.5)) # E: floating[Any] -reveal_type(np.quantile(AR_c16, 0.5)) # E: complexfloating[Any, Any] -reveal_type(np.quantile(AR_m, 0.5)) # E: timedelta64 -reveal_type(np.quantile(AR_M, 0.5, overwrite_input=True)) # E: datetime64 -reveal_type(np.quantile(AR_O, 0.5)) # E: Any -reveal_type(np.quantile(AR_f8, [0.5])) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.quantile(AR_c16, [0.5])) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.quantile(AR_m, [0.5])) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.quantile(AR_M, [0.5], method="nearest")) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.quantile(AR_O, [0.5])) # E: ndarray[Any, dtype[object_]] -reveal_type(np.quantile(AR_f8, [0.5], keepdims=True)) # E: Any -reveal_type(np.quantile(AR_f8, [0.5], axis=[1])) # E: Any -reveal_type(np.quantile(AR_f8, [0.5], out=AR_c16)) # E: ndarray[Any, dtype[{complex128}]] - -reveal_type(np.meshgrid(AR_f8, AR_i8, copy=False)) # E: list[ndarray[Any, dtype[Any]]] -reveal_type(np.meshgrid(AR_f8, AR_i8, AR_c16, indexing="ij")) # E: list[ndarray[Any, dtype[Any]]] - -reveal_type(np.delete(AR_f8, np.s_[:5])) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.delete(AR_LIKE_f8, [0, 4, 9], axis=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.insert(AR_f8, np.s_[:5], 5)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.insert(AR_LIKE_f8, [0, 4, 9], [0.5, 9.2, 7], axis=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.append(AR_f8, 5)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.append(AR_LIKE_f8, 1j, axis=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.digitize(4.5, [1])) # E: {intp} -reveal_type(np.digitize(AR_f8, [1, 2, 3])) # E: ndarray[Any, dtype[{intp}]] + assert_type(np.disp("message", device=f), None) + +assert_type(np.cov(AR_f8, bias=True), npt.NDArray[np.floating[Any]]) +assert_type(np.cov(AR_f8, AR_c16, ddof=1), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.cov(AR_f8, aweights=AR_f8, dtype=np.float32), npt.NDArray[np.float32]) +assert_type(np.cov(AR_f8, fweights=AR_f8, dtype=float), npt.NDArray[Any]) + +assert_type(np.corrcoef(AR_f8, rowvar=True), npt.NDArray[np.floating[Any]]) +assert_type(np.corrcoef(AR_f8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.corrcoef(AR_f8, dtype=np.float32), npt.NDArray[np.float32]) +assert_type(np.corrcoef(AR_f8, dtype=float), npt.NDArray[Any]) + +assert_type(np.blackman(5), npt.NDArray[np.floating[Any]]) +assert_type(np.bartlett(6), npt.NDArray[np.floating[Any]]) +assert_type(np.hanning(4.5), npt.NDArray[np.floating[Any]]) +assert_type(np.hamming(0), npt.NDArray[np.floating[Any]]) +assert_type(np.i0(AR_i8), npt.NDArray[np.floating[Any]]) +assert_type(np.kaiser(4, 5.9), npt.NDArray[np.floating[Any]]) + +assert_type(np.sinc(1.0), np.floating[Any]) +assert_type(np.sinc(1j), np.complexfloating[Any, Any]) +assert_type(np.sinc(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.sinc(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.median(AR_f8, keepdims=False), np.floating[Any]) +assert_type(np.median(AR_c16, overwrite_input=True), np.complexfloating[Any, Any]) +assert_type(np.median(AR_m), np.timedelta64) +assert_type(np.median(AR_O), Any) +assert_type(np.median(AR_f8, keepdims=True), Any) +assert_type(np.median(AR_c16, axis=0), Any) +assert_type(np.median(AR_LIKE_f8, out=AR_c16), npt.NDArray[np.complex128]) + +assert_type(np.add_newdoc_ufunc(np.add, "docstring"), None) + +assert_type(np.percentile(AR_f8, 50), np.floating[Any]) +assert_type(np.percentile(AR_c16, 50), np.complexfloating[Any, Any]) +assert_type(np.percentile(AR_m, 50), np.timedelta64) +assert_type(np.percentile(AR_M, 50, overwrite_input=True), np.datetime64) +assert_type(np.percentile(AR_O, 50), Any) +assert_type(np.percentile(AR_f8, [50]), npt.NDArray[np.floating[Any]]) +assert_type(np.percentile(AR_c16, [50]), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.percentile(AR_m, [50]), npt.NDArray[np.timedelta64]) +assert_type(np.percentile(AR_M, [50], method="nearest"), npt.NDArray[np.datetime64]) +assert_type(np.percentile(AR_O, [50]), npt.NDArray[np.object_]) +assert_type(np.percentile(AR_f8, [50], keepdims=True), Any) +assert_type(np.percentile(AR_f8, [50], axis=[1]), Any) +assert_type(np.percentile(AR_f8, [50], out=AR_c16), npt.NDArray[np.complex128]) + +assert_type(np.quantile(AR_f8, 0.5), np.floating[Any]) +assert_type(np.quantile(AR_c16, 0.5), np.complexfloating[Any, Any]) +assert_type(np.quantile(AR_m, 0.5), np.timedelta64) +assert_type(np.quantile(AR_M, 0.5, overwrite_input=True), np.datetime64) +assert_type(np.quantile(AR_O, 0.5), Any) +assert_type(np.quantile(AR_f8, [0.5]), npt.NDArray[np.floating[Any]]) +assert_type(np.quantile(AR_c16, [0.5]), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.quantile(AR_m, [0.5]), npt.NDArray[np.timedelta64]) +assert_type(np.quantile(AR_M, [0.5], method="nearest"), npt.NDArray[np.datetime64]) +assert_type(np.quantile(AR_O, [0.5]), npt.NDArray[np.object_]) +assert_type(np.quantile(AR_f8, [0.5], keepdims=True), Any) +assert_type(np.quantile(AR_f8, [0.5], axis=[1]), Any) +assert_type(np.quantile(AR_f8, [0.5], out=AR_c16), npt.NDArray[np.complex128]) + +assert_type(np.meshgrid(AR_f8, AR_i8, copy=False), list[npt.NDArray[Any]]) +assert_type(np.meshgrid(AR_f8, AR_i8, AR_c16, indexing="ij"), list[npt.NDArray[Any]]) + +assert_type(np.delete(AR_f8, np.s_[:5]), npt.NDArray[np.float64]) +assert_type(np.delete(AR_LIKE_f8, [0, 4, 9], axis=0), npt.NDArray[Any]) + +assert_type(np.insert(AR_f8, np.s_[:5], 5), npt.NDArray[np.float64]) +assert_type(np.insert(AR_LIKE_f8, [0, 4, 9], [0.5, 9.2, 7], axis=0), npt.NDArray[Any]) + +assert_type(np.append(AR_f8, 5), npt.NDArray[Any]) +assert_type(np.append(AR_LIKE_f8, 1j, axis=0), npt.NDArray[Any]) + +assert_type(np.digitize(4.5, [1]), np.intp) +assert_type(np.digitize(AR_f8, [1, 2, 3]), npt.NDArray[np.intp]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_polynomial.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_polynomial.pyi index de8950724e..9d258ca3e0 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_polynomial.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_polynomial.pyi @@ -1,6 +1,15 @@ +import sys +from typing import Any, NoReturn +from collections.abc import Iterator + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_b: npt.NDArray[np.bool_] AR_u4: npt.NDArray[np.uint32] AR_i8: npt.NDArray[np.int64] @@ -10,102 +19,132 @@ AR_O: npt.NDArray[np.object_] poly_obj: np.poly1d -reveal_type(poly_obj.variable) # E: str -reveal_type(poly_obj.order) # E: int -reveal_type(poly_obj.o) # E: int -reveal_type(poly_obj.roots) # E: ndarray[Any, dtype[Any]] -reveal_type(poly_obj.r) # E: ndarray[Any, dtype[Any]] -reveal_type(poly_obj.coeffs) # E: ndarray[Any, dtype[Any]] -reveal_type(poly_obj.c) # E: ndarray[Any, dtype[Any]] -reveal_type(poly_obj.coef) # E: ndarray[Any, dtype[Any]] -reveal_type(poly_obj.coefficients) # E: ndarray[Any, dtype[Any]] -reveal_type(poly_obj.__hash__) # E: None - -reveal_type(poly_obj(1)) # E: Any -reveal_type(poly_obj([1])) # E: ndarray[Any, dtype[Any]] -reveal_type(poly_obj(poly_obj)) # E: poly1d - -reveal_type(len(poly_obj)) # E: int -reveal_type(-poly_obj) # E: poly1d -reveal_type(+poly_obj) # E: poly1d - -reveal_type(poly_obj * 5) # E: poly1d -reveal_type(5 * poly_obj) # E: poly1d -reveal_type(poly_obj + 5) # E: poly1d -reveal_type(5 + poly_obj) # E: poly1d -reveal_type(poly_obj - 5) # E: poly1d -reveal_type(5 - poly_obj) # E: poly1d -reveal_type(poly_obj**1) # E: poly1d -reveal_type(poly_obj**1.0) # E: poly1d -reveal_type(poly_obj / 5) # E: poly1d -reveal_type(5 / poly_obj) # E: poly1d - -reveal_type(poly_obj[0]) # E: Any +assert_type(poly_obj.variable, str) +assert_type(poly_obj.order, int) +assert_type(poly_obj.o, int) +assert_type(poly_obj.roots, npt.NDArray[Any]) +assert_type(poly_obj.r, npt.NDArray[Any]) +assert_type(poly_obj.coeffs, npt.NDArray[Any]) +assert_type(poly_obj.c, npt.NDArray[Any]) +assert_type(poly_obj.coef, npt.NDArray[Any]) +assert_type(poly_obj.coefficients, npt.NDArray[Any]) +assert_type(poly_obj.__hash__, None) + +assert_type(poly_obj(1), Any) +assert_type(poly_obj([1]), npt.NDArray[Any]) +assert_type(poly_obj(poly_obj), np.poly1d) + +assert_type(len(poly_obj), int) +assert_type(-poly_obj, np.poly1d) +assert_type(+poly_obj, np.poly1d) + +assert_type(poly_obj * 5, np.poly1d) +assert_type(5 * poly_obj, np.poly1d) +assert_type(poly_obj + 5, np.poly1d) +assert_type(5 + poly_obj, np.poly1d) +assert_type(poly_obj - 5, np.poly1d) +assert_type(5 - poly_obj, np.poly1d) +assert_type(poly_obj**1, np.poly1d) +assert_type(poly_obj**1.0, np.poly1d) +assert_type(poly_obj / 5, np.poly1d) +assert_type(5 / poly_obj, np.poly1d) + +assert_type(poly_obj[0], Any) poly_obj[0] = 5 -reveal_type(iter(poly_obj)) # E: Iterator[Any] -reveal_type(poly_obj.deriv()) # E: poly1d -reveal_type(poly_obj.integ()) # E: poly1d - -reveal_type(np.poly(poly_obj)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.poly(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.poly(AR_c16)) # E: ndarray[Any, dtype[floating[Any]]] - -reveal_type(np.polyint(poly_obj)) # E: poly1d -reveal_type(np.polyint(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.polyint(AR_f8, k=AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.polyint(AR_O, m=2)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.polyder(poly_obj)) # E: poly1d -reveal_type(np.polyder(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.polyder(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.polyder(AR_O, m=2)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.polyfit(AR_f8, AR_f8, 2)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.polyfit(AR_f8, AR_i8, 1, full=True)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] -reveal_type(np.polyfit(AR_u4, AR_f8, 1.0, cov="unscaled")) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] -reveal_type(np.polyfit(AR_c16, AR_f8, 2)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(np.polyfit(AR_f8, AR_c16, 1, full=True)) # E: Tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[signedinteger[typing._32Bit]]], ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]]] -reveal_type(np.polyfit(AR_u4, AR_c16, 1.0, cov=True)) # E: Tuple[ndarray[Any, dtype[{complex128}]], ndarray[Any, dtype[{complex128}]]] - -reveal_type(np.polyval(AR_b, AR_b)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.polyval(AR_u4, AR_b)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.polyval(AR_i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.polyval(AR_f8, AR_i8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.polyval(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.polyval(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.polyadd(poly_obj, AR_i8)) # E: poly1d -reveal_type(np.polyadd(AR_f8, poly_obj)) # E: poly1d -reveal_type(np.polyadd(AR_b, AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.polyadd(AR_u4, AR_b)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.polyadd(AR_i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.polyadd(AR_f8, AR_i8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.polyadd(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.polyadd(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.polysub(poly_obj, AR_i8)) # E: poly1d -reveal_type(np.polysub(AR_f8, poly_obj)) # E: poly1d -reveal_type(np.polysub(AR_b, AR_b)) # E: <nothing> -reveal_type(np.polysub(AR_u4, AR_b)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.polysub(AR_i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.polysub(AR_f8, AR_i8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.polysub(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.polysub(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.polymul(poly_obj, AR_i8)) # E: poly1d -reveal_type(np.polymul(AR_f8, poly_obj)) # E: poly1d -reveal_type(np.polymul(AR_b, AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.polymul(AR_u4, AR_b)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.polymul(AR_i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.polymul(AR_f8, AR_i8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.polymul(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.polymul(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.polydiv(poly_obj, AR_i8)) # E: poly1d -reveal_type(np.polydiv(AR_f8, poly_obj)) # E: poly1d -reveal_type(np.polydiv(AR_b, AR_b)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] -reveal_type(np.polydiv(AR_u4, AR_b)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] -reveal_type(np.polydiv(AR_i8, AR_i8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] -reveal_type(np.polydiv(AR_f8, AR_i8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] -reveal_type(np.polydiv(AR_i8, AR_c16)) # E: Tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], ndarray[Any, dtype[complexfloating[Any, Any]]]] -reveal_type(np.polydiv(AR_O, AR_O)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] +assert_type(iter(poly_obj), Iterator[Any]) +assert_type(poly_obj.deriv(), np.poly1d) +assert_type(poly_obj.integ(), np.poly1d) + +assert_type(np.poly(poly_obj), npt.NDArray[np.floating[Any]]) +assert_type(np.poly(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.poly(AR_c16), npt.NDArray[np.floating[Any]]) + +assert_type(np.polyint(poly_obj), np.poly1d) +assert_type(np.polyint(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.polyint(AR_f8, k=AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.polyint(AR_O, m=2), npt.NDArray[np.object_]) + +assert_type(np.polyder(poly_obj), np.poly1d) +assert_type(np.polyder(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.polyder(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.polyder(AR_O, m=2), npt.NDArray[np.object_]) + +assert_type(np.polyfit(AR_f8, AR_f8, 2), npt.NDArray[np.float64]) +assert_type( + np.polyfit(AR_f8, AR_i8, 1, full=True), + tuple[ + npt.NDArray[np.float64], + npt.NDArray[np.float64], + npt.NDArray[np.int32], + npt.NDArray[np.float64], + npt.NDArray[np.float64], + ], +) +assert_type( + np.polyfit(AR_u4, AR_f8, 1.0, cov="unscaled"), + tuple[ + npt.NDArray[np.float64], + npt.NDArray[np.float64], + ], +) +assert_type(np.polyfit(AR_c16, AR_f8, 2), npt.NDArray[np.complex128]) +assert_type( + np.polyfit(AR_f8, AR_c16, 1, full=True), + tuple[ + npt.NDArray[np.complex128], + npt.NDArray[np.float64], + npt.NDArray[np.int32], + npt.NDArray[np.float64], + npt.NDArray[np.float64], + ], +) +assert_type( + np.polyfit(AR_u4, AR_c16, 1.0, cov=True), + tuple[ + npt.NDArray[np.complex128], + npt.NDArray[np.complex128], + ], +) + +assert_type(np.polyval(AR_b, AR_b), npt.NDArray[np.int64]) +assert_type(np.polyval(AR_u4, AR_b), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.polyval(AR_i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.polyval(AR_f8, AR_i8), npt.NDArray[np.floating[Any]]) +assert_type(np.polyval(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.polyval(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.polyadd(poly_obj, AR_i8), np.poly1d) +assert_type(np.polyadd(AR_f8, poly_obj), np.poly1d) +assert_type(np.polyadd(AR_b, AR_b), npt.NDArray[np.bool_]) +assert_type(np.polyadd(AR_u4, AR_b), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.polyadd(AR_i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.polyadd(AR_f8, AR_i8), npt.NDArray[np.floating[Any]]) +assert_type(np.polyadd(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.polyadd(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.polysub(poly_obj, AR_i8), np.poly1d) +assert_type(np.polysub(AR_f8, poly_obj), np.poly1d) +assert_type(np.polysub(AR_b, AR_b), NoReturn) +assert_type(np.polysub(AR_u4, AR_b), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.polysub(AR_i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.polysub(AR_f8, AR_i8), npt.NDArray[np.floating[Any]]) +assert_type(np.polysub(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.polysub(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.polymul(poly_obj, AR_i8), np.poly1d) +assert_type(np.polymul(AR_f8, poly_obj), np.poly1d) +assert_type(np.polymul(AR_b, AR_b), npt.NDArray[np.bool_]) +assert_type(np.polymul(AR_u4, AR_b), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.polymul(AR_i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.polymul(AR_f8, AR_i8), npt.NDArray[np.floating[Any]]) +assert_type(np.polymul(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.polymul(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.polydiv(poly_obj, AR_i8), tuple[np.poly1d, np.poly1d]) +assert_type(np.polydiv(AR_f8, poly_obj), tuple[np.poly1d, np.poly1d]) +assert_type(np.polydiv(AR_b, AR_b), tuple[npt.NDArray[np.floating[Any]], npt.NDArray[np.floating[Any]]]) +assert_type(np.polydiv(AR_u4, AR_b), tuple[npt.NDArray[np.floating[Any]], npt.NDArray[np.floating[Any]]]) +assert_type(np.polydiv(AR_i8, AR_i8), tuple[npt.NDArray[np.floating[Any]], npt.NDArray[np.floating[Any]]]) +assert_type(np.polydiv(AR_f8, AR_i8), tuple[npt.NDArray[np.floating[Any]], npt.NDArray[np.floating[Any]]]) +assert_type(np.polydiv(AR_i8, AR_c16), tuple[npt.NDArray[np.complexfloating[Any, Any]], npt.NDArray[np.complexfloating[Any, Any]]]) +assert_type(np.polydiv(AR_O, AR_O), tuple[npt.NDArray[Any], npt.NDArray[Any]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_utils.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_utils.pyi index 9b1bf4123d..7b15cf18fd 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_utils.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_utils.pyi @@ -1,30 +1,41 @@ +import sys from io import StringIO -from typing import Any +from typing import Any, Protocol import numpy as np +import numpy.typing as npt +from numpy.lib.utils import _Deprecate -AR: np.ndarray[Any, np.dtype[np.float64]] -AR_DICT: dict[str, np.ndarray[Any, np.dtype[np.float64]]] +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + +AR: npt.NDArray[np.float64] +AR_DICT: dict[str, npt.NDArray[np.float64]] FILE: StringIO def func(a: int) -> bool: ... -reveal_type(np.deprecate(func)) # E: def (a: builtins.int) -> builtins.bool -reveal_type(np.deprecate()) # E: _Deprecate +class FuncProtocol(Protocol): + def __call__(self, a: int) -> bool: ... + +assert_type(np.deprecate(func), FuncProtocol) +assert_type(np.deprecate(), _Deprecate) -reveal_type(np.deprecate_with_doc("test")) # E: _Deprecate -reveal_type(np.deprecate_with_doc(None)) # E: _Deprecate +assert_type(np.deprecate_with_doc("test"), _Deprecate) +assert_type(np.deprecate_with_doc(None), _Deprecate) -reveal_type(np.byte_bounds(AR)) # E: Tuple[builtins.int, builtins.int] -reveal_type(np.byte_bounds(np.float64())) # E: Tuple[builtins.int, builtins.int] +assert_type(np.byte_bounds(AR), tuple[int, int]) +assert_type(np.byte_bounds(np.float64()), tuple[int, int]) -reveal_type(np.who(None)) # E: None -reveal_type(np.who(AR_DICT)) # E: None +assert_type(np.who(None), None) +assert_type(np.who(AR_DICT), None) -reveal_type(np.info(1, output=FILE)) # E: None +assert_type(np.info(1, output=FILE), None) -reveal_type(np.source(np.interp, output=FILE)) # E: None +assert_type(np.source(np.interp, output=FILE), None) -reveal_type(np.lookfor("binary representation", output=FILE)) # E: None +assert_type(np.lookfor("binary representation", output=FILE), None) -reveal_type(np.safe_eval("1 + 1")) # E: Any +assert_type(np.safe_eval("1 + 1"), Any) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_version.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_version.pyi index e6f695558a..142d88bdbb 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_version.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/lib_version.pyi @@ -1,18 +1,25 @@ +import sys + from numpy.lib import NumpyVersion +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + version = NumpyVersion("1.8.0") -reveal_type(version.vstring) # E: str -reveal_type(version.version) # E: str -reveal_type(version.major) # E: int -reveal_type(version.minor) # E: int -reveal_type(version.bugfix) # E: int -reveal_type(version.pre_release) # E: str -reveal_type(version.is_devversion) # E: bool +assert_type(version.vstring, str) +assert_type(version.version, str) +assert_type(version.major, int) +assert_type(version.minor, int) +assert_type(version.bugfix, int) +assert_type(version.pre_release, str) +assert_type(version.is_devversion, bool) -reveal_type(version == version) # E: bool -reveal_type(version != version) # E: bool -reveal_type(version < "1.8.0") # E: bool -reveal_type(version <= version) # E: bool -reveal_type(version > version) # E: bool -reveal_type(version >= "1.8.0") # E: bool +assert_type(version == version, bool) +assert_type(version != version, bool) +assert_type(version < "1.8.0", bool) +assert_type(version <= version, bool) +assert_type(version > version, bool) +assert_type(version >= "1.8.0", bool) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/linalg.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/linalg.pyi index 1303518643..f011aedd93 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/linalg.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/linalg.pyi @@ -1,5 +1,14 @@ +import sys +from typing import Any + import numpy as np import numpy.typing as npt +from numpy.linalg.linalg import QRResult, EigResult, EighResult, SVDResult, SlogdetResult + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR_i8: npt.NDArray[np.int64] AR_f8: npt.NDArray[np.float64] @@ -8,90 +17,90 @@ AR_O: npt.NDArray[np.object_] AR_m: npt.NDArray[np.timedelta64] AR_S: npt.NDArray[np.str_] -reveal_type(np.linalg.tensorsolve(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.tensorsolve(AR_i8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.tensorsolve(AR_c16, AR_f8)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.linalg.solve(AR_i8, AR_i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.solve(AR_i8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.solve(AR_c16, AR_f8)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.linalg.tensorinv(AR_i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.tensorinv(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.tensorinv(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.linalg.inv(AR_i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.inv(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.inv(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.linalg.matrix_power(AR_i8, -1)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.linalg.matrix_power(AR_f8, 0)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.linalg.matrix_power(AR_c16, 1)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.linalg.matrix_power(AR_O, 2)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.linalg.cholesky(AR_i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.cholesky(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.cholesky(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.linalg.qr(AR_i8)) # E: QRResult -reveal_type(np.linalg.qr(AR_f8)) # E: QRResult -reveal_type(np.linalg.qr(AR_c16)) # E: QRResult - -reveal_type(np.linalg.eigvals(AR_i8)) # E: Union[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{complex128}]]] -reveal_type(np.linalg.eigvals(AR_f8)) # E: Union[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[complexfloating[Any, Any]]]] -reveal_type(np.linalg.eigvals(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.linalg.eigvalsh(AR_i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.eigvalsh(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.eigvalsh(AR_c16)) # E: ndarray[Any, dtype[floating[Any]]] - -reveal_type(np.linalg.eig(AR_i8)) # E: EigResult -reveal_type(np.linalg.eig(AR_f8)) # E: EigResult -reveal_type(np.linalg.eig(AR_c16)) # E: EigResult - -reveal_type(np.linalg.eigh(AR_i8)) # E: EighResult -reveal_type(np.linalg.eigh(AR_f8)) # E: EighResult -reveal_type(np.linalg.eigh(AR_c16)) # E: EighResult - -reveal_type(np.linalg.svd(AR_i8)) # E: SVDResult -reveal_type(np.linalg.svd(AR_f8)) # E: SVDResult -reveal_type(np.linalg.svd(AR_c16)) # E: SVDResult -reveal_type(np.linalg.svd(AR_i8, compute_uv=False)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.svd(AR_f8, compute_uv=False)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.svd(AR_c16, compute_uv=False)) # E: ndarray[Any, dtype[floating[Any]]] - -reveal_type(np.linalg.cond(AR_i8)) # E: Any -reveal_type(np.linalg.cond(AR_f8)) # E: Any -reveal_type(np.linalg.cond(AR_c16)) # E: Any - -reveal_type(np.linalg.matrix_rank(AR_i8)) # E: Any -reveal_type(np.linalg.matrix_rank(AR_f8)) # E: Any -reveal_type(np.linalg.matrix_rank(AR_c16)) # E: Any - -reveal_type(np.linalg.pinv(AR_i8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.linalg.pinv(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.linalg.pinv(AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] - -reveal_type(np.linalg.slogdet(AR_i8)) # E: SlogdetResult -reveal_type(np.linalg.slogdet(AR_f8)) # E: SlogdetResult -reveal_type(np.linalg.slogdet(AR_c16)) # E: SlogdetResult - -reveal_type(np.linalg.det(AR_i8)) # E: Any -reveal_type(np.linalg.det(AR_f8)) # E: Any -reveal_type(np.linalg.det(AR_c16)) # E: Any - -reveal_type(np.linalg.lstsq(AR_i8, AR_i8)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{float64}]], {int32}, ndarray[Any, dtype[{float64}]]] -reveal_type(np.linalg.lstsq(AR_i8, AR_f8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]], {int32}, ndarray[Any, dtype[floating[Any]]]] -reveal_type(np.linalg.lstsq(AR_f8, AR_c16)) # E: Tuple[ndarray[Any, dtype[complexfloating[Any, Any]]], ndarray[Any, dtype[floating[Any]]], {int32}, ndarray[Any, dtype[floating[Any]]]] - -reveal_type(np.linalg.norm(AR_i8)) # E: floating[Any] -reveal_type(np.linalg.norm(AR_f8)) # E: floating[Any] -reveal_type(np.linalg.norm(AR_c16)) # E: floating[Any] -reveal_type(np.linalg.norm(AR_S)) # E: floating[Any] -reveal_type(np.linalg.norm(AR_f8, axis=0)) # E: Any - -reveal_type(np.linalg.multi_dot([AR_i8, AR_i8])) # E: Any -reveal_type(np.linalg.multi_dot([AR_i8, AR_f8])) # E: Any -reveal_type(np.linalg.multi_dot([AR_f8, AR_c16])) # E: Any -reveal_type(np.linalg.multi_dot([AR_O, AR_O])) # E: Any -reveal_type(np.linalg.multi_dot([AR_m, AR_m])) # E: Any +assert_type(np.linalg.tensorsolve(AR_i8, AR_i8), npt.NDArray[np.float64]) +assert_type(np.linalg.tensorsolve(AR_i8, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.tensorsolve(AR_c16, AR_f8), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.linalg.solve(AR_i8, AR_i8), npt.NDArray[np.float64]) +assert_type(np.linalg.solve(AR_i8, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.solve(AR_c16, AR_f8), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.linalg.tensorinv(AR_i8), npt.NDArray[np.float64]) +assert_type(np.linalg.tensorinv(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.tensorinv(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.linalg.inv(AR_i8), npt.NDArray[np.float64]) +assert_type(np.linalg.inv(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.inv(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.linalg.matrix_power(AR_i8, -1), npt.NDArray[Any]) +assert_type(np.linalg.matrix_power(AR_f8, 0), npt.NDArray[Any]) +assert_type(np.linalg.matrix_power(AR_c16, 1), npt.NDArray[Any]) +assert_type(np.linalg.matrix_power(AR_O, 2), npt.NDArray[Any]) + +assert_type(np.linalg.cholesky(AR_i8), npt.NDArray[np.float64]) +assert_type(np.linalg.cholesky(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.cholesky(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.linalg.qr(AR_i8), QRResult) +assert_type(np.linalg.qr(AR_f8), QRResult) +assert_type(np.linalg.qr(AR_c16), QRResult) + +assert_type(np.linalg.eigvals(AR_i8), npt.NDArray[np.float64] | npt.NDArray[np.complex128]) +assert_type(np.linalg.eigvals(AR_f8), npt.NDArray[np.floating[Any]] | npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.linalg.eigvals(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.linalg.eigvalsh(AR_i8), npt.NDArray[np.float64]) +assert_type(np.linalg.eigvalsh(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.eigvalsh(AR_c16), npt.NDArray[np.floating[Any]]) + +assert_type(np.linalg.eig(AR_i8), EigResult) +assert_type(np.linalg.eig(AR_f8), EigResult) +assert_type(np.linalg.eig(AR_c16), EigResult) + +assert_type(np.linalg.eigh(AR_i8), EighResult) +assert_type(np.linalg.eigh(AR_f8), EighResult) +assert_type(np.linalg.eigh(AR_c16), EighResult) + +assert_type(np.linalg.svd(AR_i8), SVDResult) +assert_type(np.linalg.svd(AR_f8), SVDResult) +assert_type(np.linalg.svd(AR_c16), SVDResult) +assert_type(np.linalg.svd(AR_i8, compute_uv=False), npt.NDArray[np.float64]) +assert_type(np.linalg.svd(AR_f8, compute_uv=False), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.svd(AR_c16, compute_uv=False), npt.NDArray[np.floating[Any]]) + +assert_type(np.linalg.cond(AR_i8), Any) +assert_type(np.linalg.cond(AR_f8), Any) +assert_type(np.linalg.cond(AR_c16), Any) + +assert_type(np.linalg.matrix_rank(AR_i8), Any) +assert_type(np.linalg.matrix_rank(AR_f8), Any) +assert_type(np.linalg.matrix_rank(AR_c16), Any) + +assert_type(np.linalg.pinv(AR_i8), npt.NDArray[np.float64]) +assert_type(np.linalg.pinv(AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.linalg.pinv(AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) + +assert_type(np.linalg.slogdet(AR_i8), SlogdetResult) +assert_type(np.linalg.slogdet(AR_f8), SlogdetResult) +assert_type(np.linalg.slogdet(AR_c16), SlogdetResult) + +assert_type(np.linalg.det(AR_i8), Any) +assert_type(np.linalg.det(AR_f8), Any) +assert_type(np.linalg.det(AR_c16), Any) + +assert_type(np.linalg.lstsq(AR_i8, AR_i8), tuple[npt.NDArray[np.float64], npt.NDArray[np.float64], np.int32, npt.NDArray[np.float64]]) +assert_type(np.linalg.lstsq(AR_i8, AR_f8), tuple[npt.NDArray[np.floating[Any]], npt.NDArray[np.floating[Any]], np.int32, npt.NDArray[np.floating[Any]]]) +assert_type(np.linalg.lstsq(AR_f8, AR_c16), tuple[npt.NDArray[np.complexfloating[Any, Any]], npt.NDArray[np.floating[Any]], np.int32, npt.NDArray[np.floating[Any]]]) + +assert_type(np.linalg.norm(AR_i8), np.floating[Any]) +assert_type(np.linalg.norm(AR_f8), np.floating[Any]) +assert_type(np.linalg.norm(AR_c16), np.floating[Any]) +assert_type(np.linalg.norm(AR_S), np.floating[Any]) +assert_type(np.linalg.norm(AR_f8, axis=0), Any) + +assert_type(np.linalg.multi_dot([AR_i8, AR_i8]), Any) +assert_type(np.linalg.multi_dot([AR_i8, AR_f8]), Any) +assert_type(np.linalg.multi_dot([AR_f8, AR_c16]), Any) +assert_type(np.linalg.multi_dot([AR_O, AR_O]), Any) +assert_type(np.linalg.multi_dot([AR_m, AR_m]), Any) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/matrix.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/matrix.pyi index 21c39067e9..3fd1ddb94d 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/matrix.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/matrix.pyi @@ -1,69 +1,76 @@ +import sys from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + mat: np.matrix[Any, np.dtype[np.int64]] ar_f8: npt.NDArray[np.float64] -reveal_type(mat * 5) # E: matrix[Any, Any] -reveal_type(5 * mat) # E: matrix[Any, Any] +assert_type(mat * 5, np.matrix[Any, Any]) +assert_type(5 * mat, np.matrix[Any, Any]) mat *= 5 -reveal_type(mat**5) # E: matrix[Any, Any] +assert_type(mat**5, np.matrix[Any, Any]) mat **= 5 -reveal_type(mat.sum()) # E: Any -reveal_type(mat.mean()) # E: Any -reveal_type(mat.std()) # E: Any -reveal_type(mat.var()) # E: Any -reveal_type(mat.prod()) # E: Any -reveal_type(mat.any()) # E: bool_ -reveal_type(mat.all()) # E: bool_ -reveal_type(mat.max()) # E: {int64} -reveal_type(mat.min()) # E: {int64} -reveal_type(mat.argmax()) # E: {intp} -reveal_type(mat.argmin()) # E: {intp} -reveal_type(mat.ptp()) # E: {int64} +assert_type(mat.sum(), Any) +assert_type(mat.mean(), Any) +assert_type(mat.std(), Any) +assert_type(mat.var(), Any) +assert_type(mat.prod(), Any) +assert_type(mat.any(), np.bool_) +assert_type(mat.all(), np.bool_) +assert_type(mat.max(), np.int64) +assert_type(mat.min(), np.int64) +assert_type(mat.argmax(), np.intp) +assert_type(mat.argmin(), np.intp) +assert_type(mat.ptp(), np.int64) -reveal_type(mat.sum(axis=0)) # E: matrix[Any, Any] -reveal_type(mat.mean(axis=0)) # E: matrix[Any, Any] -reveal_type(mat.std(axis=0)) # E: matrix[Any, Any] -reveal_type(mat.var(axis=0)) # E: matrix[Any, Any] -reveal_type(mat.prod(axis=0)) # E: matrix[Any, Any] -reveal_type(mat.any(axis=0)) # E: matrix[Any, dtype[bool_]] -reveal_type(mat.all(axis=0)) # E: matrix[Any, dtype[bool_]] -reveal_type(mat.max(axis=0)) # E: matrix[Any, dtype[{int64}]] -reveal_type(mat.min(axis=0)) # E: matrix[Any, dtype[{int64}]] -reveal_type(mat.argmax(axis=0)) # E: matrix[Any, dtype[{intp}]] -reveal_type(mat.argmin(axis=0)) # E: matrix[Any, dtype[{intp}]] -reveal_type(mat.ptp(axis=0)) # E: matrix[Any, dtype[{int64}]] +assert_type(mat.sum(axis=0), np.matrix[Any, Any]) +assert_type(mat.mean(axis=0), np.matrix[Any, Any]) +assert_type(mat.std(axis=0), np.matrix[Any, Any]) +assert_type(mat.var(axis=0), np.matrix[Any, Any]) +assert_type(mat.prod(axis=0), np.matrix[Any, Any]) +assert_type(mat.any(axis=0), np.matrix[Any, np.dtype[np.bool_]]) +assert_type(mat.all(axis=0), np.matrix[Any, np.dtype[np.bool_]]) +assert_type(mat.max(axis=0), np.matrix[Any, np.dtype[np.int64]]) +assert_type(mat.min(axis=0), np.matrix[Any, np.dtype[np.int64]]) +assert_type(mat.argmax(axis=0), np.matrix[Any, np.dtype[np.intp]]) +assert_type(mat.argmin(axis=0), np.matrix[Any, np.dtype[np.intp]]) +assert_type(mat.ptp(axis=0), np.matrix[Any, np.dtype[np.int64]]) -reveal_type(mat.sum(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.mean(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.std(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.var(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.prod(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.any(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.all(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.max(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.min(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.argmax(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.argmin(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(mat.ptp(out=ar_f8)) # E: ndarray[Any, dtype[{float64}]] +assert_type(mat.sum(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.mean(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.std(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.var(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.prod(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.any(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.all(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.max(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.min(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.argmax(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.argmin(out=ar_f8), npt.NDArray[np.float64]) +assert_type(mat.ptp(out=ar_f8), npt.NDArray[np.float64]) -reveal_type(mat.T) # E: matrix[Any, dtype[{int64}]] -reveal_type(mat.I) # E: matrix[Any, Any] -reveal_type(mat.A) # E: ndarray[Any, dtype[{int64}]] -reveal_type(mat.A1) # E: ndarray[Any, dtype[{int64}]] -reveal_type(mat.H) # E: matrix[Any, dtype[{int64}]] -reveal_type(mat.getT()) # E: matrix[Any, dtype[{int64}]] -reveal_type(mat.getI()) # E: matrix[Any, Any] -reveal_type(mat.getA()) # E: ndarray[Any, dtype[{int64}]] -reveal_type(mat.getA1()) # E: ndarray[Any, dtype[{int64}]] -reveal_type(mat.getH()) # E: matrix[Any, dtype[{int64}]] +assert_type(mat.T, np.matrix[Any, np.dtype[np.int64]]) +assert_type(mat.I, np.matrix[Any, Any]) +assert_type(mat.A, npt.NDArray[np.int64]) +assert_type(mat.A1, npt.NDArray[np.int64]) +assert_type(mat.H, np.matrix[Any, np.dtype[np.int64]]) +assert_type(mat.getT(), np.matrix[Any, np.dtype[np.int64]]) +assert_type(mat.getI(), np.matrix[Any, Any]) +assert_type(mat.getA(), npt.NDArray[np.int64]) +assert_type(mat.getA1(), npt.NDArray[np.int64]) +assert_type(mat.getH(), np.matrix[Any, np.dtype[np.int64]]) -reveal_type(np.bmat(ar_f8)) # E: matrix[Any, Any] -reveal_type(np.bmat([[0, 1, 2]])) # E: matrix[Any, Any] -reveal_type(np.bmat("mat")) # E: matrix[Any, Any] +assert_type(np.bmat(ar_f8), np.matrix[Any, Any]) +assert_type(np.bmat([[0, 1, 2]]), np.matrix[Any, Any]) +assert_type(np.bmat("mat"), np.matrix[Any, Any]) -reveal_type(np.asmatrix(ar_f8, dtype=np.int64)) # E: matrix[Any, Any] +assert_type(np.asmatrix(ar_f8, dtype=np.int64), np.matrix[Any, Any]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/memmap.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/memmap.pyi index af73074992..53278ff112 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/memmap.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/memmap.pyi @@ -1,18 +1,25 @@ -import numpy as np +import sys from typing import Any +import numpy as np + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + memmap_obj: np.memmap[Any, np.dtype[np.str_]] -reveal_type(np.memmap.__array_priority__) # E: float -reveal_type(memmap_obj.__array_priority__) # E: float -reveal_type(memmap_obj.filename) # E: Union[builtins.str, None] -reveal_type(memmap_obj.offset) # E: int -reveal_type(memmap_obj.mode) # E: str -reveal_type(memmap_obj.flush()) # E: None +assert_type(np.memmap.__array_priority__, float) +assert_type(memmap_obj.__array_priority__, float) +assert_type(memmap_obj.filename, str | None) +assert_type(memmap_obj.offset, int) +assert_type(memmap_obj.mode, str) +assert_type(memmap_obj.flush(), None) -reveal_type(np.memmap("file.txt", offset=5)) # E: memmap[Any, dtype[{uint8}]] -reveal_type(np.memmap(b"file.txt", dtype=np.float64, shape=(10, 3))) # E: memmap[Any, dtype[{float64}]] +assert_type(np.memmap("file.txt", offset=5), np.memmap[Any, np.dtype[np.uint8]]) +assert_type(np.memmap(b"file.txt", dtype=np.float64, shape=(10, 3)), np.memmap[Any, np.dtype[np.float64]]) with open("file.txt", "rb") as f: - reveal_type(np.memmap(f, dtype=float, order="K")) # E: memmap[Any, dtype[Any]] + assert_type(np.memmap(f, dtype=float, order="K"), np.memmap[Any, np.dtype[Any]]) -reveal_type(memmap_obj.__array_finalize__(object())) # E: None +assert_type(memmap_obj.__array_finalize__(object()), None) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/mod.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/mod.pyi index b2790b7f39..48fee893cd 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/mod.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/mod.pyi @@ -1,5 +1,14 @@ +import sys from typing import Any + import numpy as np +import numpy.typing as npt +from numpy._typing import _32Bit, _64Bit + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type f8 = np.float64() i8 = np.int64() @@ -16,132 +25,124 @@ b = bool() f = float() i = int() -AR_b: np.ndarray[Any, np.dtype[np.bool_]] -AR_m: np.ndarray[Any, np.dtype[np.timedelta64]] +AR_b: npt.NDArray[np.bool_] +AR_m: npt.NDArray[np.timedelta64] # Time structures -reveal_type(td % td) # E: timedelta64 -reveal_type(AR_m % td) # E: Any -reveal_type(td % AR_m) # E: Any +assert_type(td % td, np.timedelta64) +assert_type(AR_m % td, npt.NDArray[np.timedelta64]) +assert_type(td % AR_m, npt.NDArray[np.timedelta64]) -reveal_type(divmod(td, td)) # E: Tuple[{int64}, timedelta64] -reveal_type(divmod(AR_m, td)) # E: Tuple[ndarray[Any, dtype[signedinteger[typing._64Bit]]], ndarray[Any, dtype[timedelta64]]] -reveal_type(divmod(td, AR_m)) # E: Tuple[ndarray[Any, dtype[signedinteger[typing._64Bit]]], ndarray[Any, dtype[timedelta64]]] +assert_type(divmod(td, td), tuple[np.int64, np.timedelta64]) +assert_type(divmod(AR_m, td), tuple[npt.NDArray[np.int64], npt.NDArray[np.timedelta64]]) +assert_type(divmod(td, AR_m), tuple[npt.NDArray[np.int64], npt.NDArray[np.timedelta64]]) # Bool -reveal_type(b_ % b) # E: {int8} -reveal_type(b_ % i) # E: {int_} -reveal_type(b_ % f) # E: {float64} -reveal_type(b_ % b_) # E: {int8} -reveal_type(b_ % i8) # E: {int64} -reveal_type(b_ % u8) # E: {uint64} -reveal_type(b_ % f8) # E: {float64} -reveal_type(b_ % AR_b) # E: ndarray[Any, dtype[{int8}]] - -reveal_type(divmod(b_, b)) # E: Tuple[{int8}, {int8}] -reveal_type(divmod(b_, i)) # E: Tuple[{int_}, {int_}] -reveal_type(divmod(b_, f)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(b_, b_)) # E: Tuple[{int8}, {int8}] -reveal_type(divmod(b_, i8)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(b_, u8)) # E: Tuple[{uint64}, {uint64}] -reveal_type(divmod(b_, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(b_, AR_b)) # E: ndarray[Any, dtype[{int8}]], ndarray[Any, dtype[{int8}]]] - -reveal_type(b % b_) # E: {int8} -reveal_type(i % b_) # E: {int_} -reveal_type(f % b_) # E: {float64} -reveal_type(b_ % b_) # E: {int8} -reveal_type(i8 % b_) # E: {int64} -reveal_type(u8 % b_) # E: {uint64} -reveal_type(f8 % b_) # E: {float64} -reveal_type(AR_b % b_) # E: ndarray[Any, dtype[{int8}]] - -reveal_type(divmod(b, b_)) # E: Tuple[{int8}, {int8}] -reveal_type(divmod(i, b_)) # E: Tuple[{int_}, {int_}] -reveal_type(divmod(f, b_)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(b_, b_)) # E: Tuple[{int8}, {int8}] -reveal_type(divmod(i8, b_)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(u8, b_)) # E: Tuple[{uint64}, {uint64}] -reveal_type(divmod(f8, b_)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(AR_b, b_)) # E: ndarray[Any, dtype[{int8}]], ndarray[Any, dtype[{int8}]]] +assert_type(b_ % b, np.int8) +assert_type(b_ % i, np.int_) +assert_type(b_ % f, np.float64) +assert_type(b_ % b_, np.int8) +assert_type(b_ % i8, np.int64) +assert_type(b_ % u8, np.uint64) +assert_type(b_ % f8, np.float64) +assert_type(b_ % AR_b, npt.NDArray[np.int8]) + +assert_type(divmod(b_, b), tuple[np.int8, np.int8]) +assert_type(divmod(b_, i), tuple[np.int_, np.int_]) +assert_type(divmod(b_, f), tuple[np.float64, np.float64]) +assert_type(divmod(b_, b_), tuple[np.int8, np.int8]) +assert_type(divmod(b_, i8), tuple[np.int64, np.int64]) +assert_type(divmod(b_, u8), tuple[np.uint64, np.uint64]) +assert_type(divmod(b_, f8), tuple[np.float64, np.float64]) +assert_type(divmod(b_, AR_b), tuple[npt.NDArray[np.int8], npt.NDArray[np.int8]]) + +assert_type(b % b_, np.int8) +assert_type(i % b_, np.int_) +assert_type(f % b_, np.float64) +assert_type(b_ % b_, np.int8) +assert_type(i8 % b_, np.int64) +assert_type(u8 % b_, np.uint64) +assert_type(f8 % b_, np.float64) +assert_type(AR_b % b_, npt.NDArray[np.int8]) + +assert_type(divmod(b, b_), tuple[np.int8, np.int8]) +assert_type(divmod(i, b_), tuple[np.int_, np.int_]) +assert_type(divmod(f, b_), tuple[np.float64, np.float64]) +assert_type(divmod(b_, b_), tuple[np.int8, np.int8]) +assert_type(divmod(i8, b_), tuple[np.int64, np.int64]) +assert_type(divmod(u8, b_), tuple[np.uint64, np.uint64]) +assert_type(divmod(f8, b_), tuple[np.float64, np.float64]) +assert_type(divmod(AR_b, b_), tuple[npt.NDArray[np.int8], npt.NDArray[np.int8]]) # int -reveal_type(i8 % b) # E: {int64} -reveal_type(i8 % i) # E: {int64} -reveal_type(i8 % f) # E: {float64} -reveal_type(i8 % i8) # E: {int64} -reveal_type(i8 % f8) # E: {float64} -reveal_type(i4 % i8) # E: {int64} -reveal_type(i4 % f8) # E: {float64} -reveal_type(i4 % i4) # E: {int32} -reveal_type(i4 % f4) # E: {float32} -reveal_type(i8 % AR_b) # E: ndarray[Any, dtype[signedinteger[Any]]] - -reveal_type(divmod(i8, b)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(i8, i)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(i8, f)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(i8, i8)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(i8, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(i8, i4)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(i8, f4)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(i4, i4)) # E: Tuple[{int32}, {int32}] -reveal_type(divmod(i4, f4)) # E: Tuple[{float32}, {float32}] -reveal_type(divmod(i8, AR_b)) # E: Tuple[ndarray[Any, dtype[signedinteger[Any]]], ndarray[Any, dtype[signedinteger[Any]]]] - -reveal_type(b % i8) # E: {int64} -reveal_type(i % i8) # E: {int64} -reveal_type(f % i8) # E: {float64} -reveal_type(i8 % i8) # E: {int64} -reveal_type(f8 % i8) # E: {float64} -reveal_type(i8 % i4) # E: {int64} -reveal_type(f8 % i4) # E: {float64} -reveal_type(i4 % i4) # E: {int32} -reveal_type(f4 % i4) # E: {float32} -reveal_type(AR_b % i8) # E: ndarray[Any, dtype[signedinteger[Any]]] - -reveal_type(divmod(b, i8)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(i, i8)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(f, i8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(i8, i8)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(f8, i8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(i4, i8)) # E: Tuple[{int64}, {int64}] -reveal_type(divmod(f4, i8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(i4, i4)) # E: Tuple[{int32}, {int32}] -reveal_type(divmod(f4, i4)) # E: Tuple[{float32}, {float32}] -reveal_type(divmod(AR_b, i8)) # E: Tuple[ndarray[Any, dtype[signedinteger[Any]]], ndarray[Any, dtype[signedinteger[Any]]]] +assert_type(i8 % b, np.int64) +assert_type(i8 % f, np.float64) +assert_type(i8 % i8, np.int64) +assert_type(i8 % f8, np.float64) +assert_type(i4 % i8, np.signedinteger[_32Bit | _64Bit]) +assert_type(i4 % f8, np.floating[_32Bit | _64Bit]) +assert_type(i4 % i4, np.int32) +assert_type(i4 % f4, np.float32) +assert_type(i8 % AR_b, npt.NDArray[np.signedinteger[Any]]) + +assert_type(divmod(i8, b), tuple[np.int64, np.int64]) +assert_type(divmod(i8, f), tuple[np.float64, np.float64]) +assert_type(divmod(i8, i8), tuple[np.int64, np.int64]) +assert_type(divmod(i8, f8), tuple[np.float64, np.float64]) +assert_type(divmod(i8, i4), tuple[np.signedinteger[_32Bit | _64Bit], np.signedinteger[_32Bit | _64Bit]]) +assert_type(divmod(i8, f4), tuple[np.floating[_32Bit | _64Bit], np.floating[_32Bit | _64Bit]]) +assert_type(divmod(i4, i4), tuple[np.int32, np.int32]) +assert_type(divmod(i4, f4), tuple[np.float32, np.float32]) +assert_type(divmod(i8, AR_b), tuple[npt.NDArray[np.signedinteger[Any]], npt.NDArray[np.signedinteger[Any]]]) + +assert_type(b % i8, np.int64) +assert_type(f % i8, np.float64) +assert_type(i8 % i8, np.int64) +assert_type(f8 % i8, np.float64) +assert_type(i8 % i4, np.signedinteger[_32Bit | _64Bit]) +assert_type(f8 % i4, np.floating[_32Bit | _64Bit]) +assert_type(i4 % i4, np.int32) +assert_type(f4 % i4, np.float32) +assert_type(AR_b % i8, npt.NDArray[np.signedinteger[Any]]) + +assert_type(divmod(b, i8), tuple[np.int64, np.int64]) +assert_type(divmod(f, i8), tuple[np.float64, np.float64]) +assert_type(divmod(i8, i8), tuple[np.int64, np.int64]) +assert_type(divmod(f8, i8), tuple[np.float64, np.float64]) +assert_type(divmod(i4, i8), tuple[np.signedinteger[_32Bit | _64Bit], np.signedinteger[_32Bit | _64Bit]]) +assert_type(divmod(f4, i8), tuple[np.floating[_32Bit | _64Bit], np.floating[_32Bit | _64Bit]]) +assert_type(divmod(i4, i4), tuple[np.int32, np.int32]) +assert_type(divmod(f4, i4), tuple[np.float32, np.float32]) +assert_type(divmod(AR_b, i8), tuple[npt.NDArray[np.signedinteger[Any]], npt.NDArray[np.signedinteger[Any]]]) # float -reveal_type(f8 % b) # E: {float64} -reveal_type(f8 % i) # E: {float64} -reveal_type(f8 % f) # E: {float64} -reveal_type(i8 % f4) # E: {float64} -reveal_type(f4 % f4) # E: {float32} -reveal_type(f8 % AR_b) # E: ndarray[Any, dtype[floating[Any]]] - -reveal_type(divmod(f8, b)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f8, i)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f8, f)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f8, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f8, f4)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f4, f4)) # E: Tuple[{float32}, {float32}] -reveal_type(divmod(f8, AR_b)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] - -reveal_type(b % f8) # E: {float64} -reveal_type(i % f8) # E: {float64} -reveal_type(f % f8) # E: {float64} -reveal_type(f8 % f8) # E: {float64} -reveal_type(f8 % f8) # E: {float64} -reveal_type(f4 % f4) # E: {float32} -reveal_type(AR_b % f8) # E: ndarray[Any, dtype[floating[Any]]] - -reveal_type(divmod(b, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(i, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f8, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f4, f8)) # E: Tuple[{float64}, {float64}] -reveal_type(divmod(f4, f4)) # E: Tuple[{float32}, {float32}] -reveal_type(divmod(AR_b, f8)) # E: Tuple[ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] +assert_type(f8 % b, np.float64) +assert_type(f8 % f, np.float64) +assert_type(i8 % f4, np.floating[_32Bit | _64Bit]) +assert_type(f4 % f4, np.float32) +assert_type(f8 % AR_b, npt.NDArray[np.floating[Any]]) + +assert_type(divmod(f8, b), tuple[np.float64, np.float64]) +assert_type(divmod(f8, f), tuple[np.float64, np.float64]) +assert_type(divmod(f8, f8), tuple[np.float64, np.float64]) +assert_type(divmod(f8, f4), tuple[np.floating[_32Bit | _64Bit], np.floating[_32Bit | _64Bit]]) +assert_type(divmod(f4, f4), tuple[np.float32, np.float32]) +assert_type(divmod(f8, AR_b), tuple[npt.NDArray[np.floating[Any]], npt.NDArray[np.floating[Any]]]) + +assert_type(b % f8, np.float64) +assert_type(f % f8, np.float64) +assert_type(f8 % f8, np.float64) +assert_type(f8 % f8, np.float64) +assert_type(f4 % f4, np.float32) +assert_type(AR_b % f8, npt.NDArray[np.floating[Any]]) + +assert_type(divmod(b, f8), tuple[np.float64, np.float64]) +assert_type(divmod(f, f8), tuple[np.float64, np.float64]) +assert_type(divmod(f8, f8), tuple[np.float64, np.float64]) +assert_type(divmod(f4, f8), tuple[np.floating[_32Bit | _64Bit], np.floating[_32Bit | _64Bit]]) +assert_type(divmod(f4, f4), tuple[np.float32, np.float32]) +assert_type(divmod(AR_b, f8), tuple[npt.NDArray[np.floating[Any]], npt.NDArray[np.floating[Any]]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/modules.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/modules.pyi index 4191c564af..1ab01cd079 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/modules.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/modules.pyi @@ -1,49 +1,56 @@ +import sys +import types + import numpy as np from numpy import f2py -reveal_type(np) # E: ModuleType +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + +assert_type(np, types.ModuleType) -reveal_type(np.char) # E: ModuleType -reveal_type(np.ctypeslib) # E: ModuleType -reveal_type(np.emath) # E: ModuleType -reveal_type(np.fft) # E: ModuleType -reveal_type(np.lib) # E: ModuleType -reveal_type(np.linalg) # E: ModuleType -reveal_type(np.ma) # E: ModuleType -reveal_type(np.matrixlib) # E: ModuleType -reveal_type(np.polynomial) # E: ModuleType -reveal_type(np.random) # E: ModuleType -reveal_type(np.rec) # E: ModuleType -reveal_type(np.testing) # E: ModuleType -reveal_type(np.version) # E: ModuleType -reveal_type(np.exceptions) # E: ModuleType -reveal_type(np.dtypes) # E: ModuleType +assert_type(np.char, types.ModuleType) +assert_type(np.ctypeslib, types.ModuleType) +assert_type(np.emath, types.ModuleType) +assert_type(np.fft, types.ModuleType) +assert_type(np.lib, types.ModuleType) +assert_type(np.linalg, types.ModuleType) +assert_type(np.ma, types.ModuleType) +assert_type(np.matrixlib, types.ModuleType) +assert_type(np.polynomial, types.ModuleType) +assert_type(np.random, types.ModuleType) +assert_type(np.rec, types.ModuleType) +assert_type(np.testing, types.ModuleType) +assert_type(np.version, types.ModuleType) +assert_type(np.exceptions, types.ModuleType) +assert_type(np.dtypes, types.ModuleType) -reveal_type(np.lib.format) # E: ModuleType -reveal_type(np.lib.mixins) # E: ModuleType -reveal_type(np.lib.scimath) # E: ModuleType -reveal_type(np.lib.stride_tricks) # E: ModuleType -reveal_type(np.ma.extras) # E: ModuleType -reveal_type(np.polynomial.chebyshev) # E: ModuleType -reveal_type(np.polynomial.hermite) # E: ModuleType -reveal_type(np.polynomial.hermite_e) # E: ModuleType -reveal_type(np.polynomial.laguerre) # E: ModuleType -reveal_type(np.polynomial.legendre) # E: ModuleType -reveal_type(np.polynomial.polynomial) # E: ModuleType +assert_type(np.lib.format, types.ModuleType) +assert_type(np.lib.mixins, types.ModuleType) +assert_type(np.lib.scimath, types.ModuleType) +assert_type(np.lib.stride_tricks, types.ModuleType) +assert_type(np.ma.extras, types.ModuleType) +assert_type(np.polynomial.chebyshev, types.ModuleType) +assert_type(np.polynomial.hermite, types.ModuleType) +assert_type(np.polynomial.hermite_e, types.ModuleType) +assert_type(np.polynomial.laguerre, types.ModuleType) +assert_type(np.polynomial.legendre, types.ModuleType) +assert_type(np.polynomial.polynomial, types.ModuleType) -reveal_type(np.__path__) # E: list[builtins.str] -reveal_type(np.__version__) # E: str -reveal_type(np.__git_version__) # E: str -reveal_type(np.test) # E: _pytesttester.PytestTester -reveal_type(np.test.module_name) # E: str +assert_type(np.__path__, list[str]) +assert_type(np.__version__, str) +assert_type(np.test, np._pytesttester.PytestTester) +assert_type(np.test.module_name, str) -reveal_type(np.__all__) # E: list[builtins.str] -reveal_type(np.char.__all__) # E: list[builtins.str] -reveal_type(np.ctypeslib.__all__) # E: list[builtins.str] -reveal_type(np.emath.__all__) # E: list[builtins.str] -reveal_type(np.lib.__all__) # E: list[builtins.str] -reveal_type(np.ma.__all__) # E: list[builtins.str] -reveal_type(np.random.__all__) # E: list[builtins.str] -reveal_type(np.rec.__all__) # E: list[builtins.str] -reveal_type(np.testing.__all__) # E: list[builtins.str] -reveal_type(f2py.__all__) # E: list[builtins.str] +assert_type(np.__all__, list[str]) +assert_type(np.char.__all__, list[str]) +assert_type(np.ctypeslib.__all__, list[str]) +assert_type(np.emath.__all__, list[str]) +assert_type(np.lib.__all__, list[str]) +assert_type(np.ma.__all__, list[str]) +assert_type(np.random.__all__, list[str]) +assert_type(np.rec.__all__, list[str]) +assert_type(np.testing.__all__, list[str]) +assert_type(f2py.__all__, list[str]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/multiarray.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/multiarray.pyi index 27a54f50d6..4254b796df 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/multiarray.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/multiarray.pyi @@ -1,3 +1,4 @@ +import sys import datetime as dt from typing import Any, TypeVar from pathlib import Path @@ -5,6 +6,11 @@ from pathlib import Path import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + _SCT = TypeVar("_SCT", bound=np.generic, covariant=True) class SubClass(np.ndarray[Any, np.dtype[_SCT]]): ... @@ -34,111 +40,111 @@ timedelta_seq: list[dt.timedelta] def func(a: int) -> bool: ... -reveal_type(next(b_f8)) # E: tuple[Any, ...] -reveal_type(b_f8.reset()) # E: None -reveal_type(b_f8.index) # E: int -reveal_type(b_f8.iters) # E: tuple[flatiter[Any], ...] -reveal_type(b_f8.nd) # E: int -reveal_type(b_f8.ndim) # E: int -reveal_type(b_f8.numiter) # E: int -reveal_type(b_f8.shape) # E: tuple[builtins.int, ...] -reveal_type(b_f8.size) # E: int +assert_type(next(b_f8), tuple[Any, ...]) +assert_type(b_f8.reset(), None) +assert_type(b_f8.index, int) +assert_type(b_f8.iters, tuple[np.flatiter[Any], ...]) +assert_type(b_f8.nd, int) +assert_type(b_f8.ndim, int) +assert_type(b_f8.numiter, int) +assert_type(b_f8.shape, tuple[int, ...]) +assert_type(b_f8.size, int) -reveal_type(next(b_i8_f8_f8)) # E: tuple[Any, ...] -reveal_type(b_i8_f8_f8.reset()) # E: None -reveal_type(b_i8_f8_f8.index) # E: int -reveal_type(b_i8_f8_f8.iters) # E: tuple[flatiter[Any], ...] -reveal_type(b_i8_f8_f8.nd) # E: int -reveal_type(b_i8_f8_f8.ndim) # E: int -reveal_type(b_i8_f8_f8.numiter) # E: int -reveal_type(b_i8_f8_f8.shape) # E: tuple[builtins.int, ...] -reveal_type(b_i8_f8_f8.size) # E: int +assert_type(next(b_i8_f8_f8), tuple[Any, ...]) +assert_type(b_i8_f8_f8.reset(), None) +assert_type(b_i8_f8_f8.index, int) +assert_type(b_i8_f8_f8.iters, tuple[np.flatiter[Any], ...]) +assert_type(b_i8_f8_f8.nd, int) +assert_type(b_i8_f8_f8.ndim, int) +assert_type(b_i8_f8_f8.numiter, int) +assert_type(b_i8_f8_f8.shape, tuple[int, ...]) +assert_type(b_i8_f8_f8.size, int) -reveal_type(np.inner(AR_f8, AR_i8)) # E: Any +assert_type(np.inner(AR_f8, AR_i8), Any) -reveal_type(np.where([True, True, False])) # E: tuple[ndarray[Any, dtype[{intp}]], ...] -reveal_type(np.where([True, True, False], 1, 0)) # E: ndarray[Any, dtype[Any]] +assert_type(np.where([True, True, False]), tuple[npt.NDArray[np.intp], ...]) +assert_type(np.where([True, True, False], 1, 0), npt.NDArray[Any]) -reveal_type(np.lexsort([0, 1, 2])) # E: Any +assert_type(np.lexsort([0, 1, 2]), Any) -reveal_type(np.can_cast(np.dtype("i8"), int)) # E: bool -reveal_type(np.can_cast(AR_f8, "f8")) # E: bool -reveal_type(np.can_cast(AR_f8, np.complex128, casting="unsafe")) # E: bool +assert_type(np.can_cast(np.dtype("i8"), int), bool) +assert_type(np.can_cast(AR_f8, "f8"), bool) +assert_type(np.can_cast(AR_f8, np.complex128, casting="unsafe"), bool) -reveal_type(np.min_scalar_type([1])) # E: dtype[Any] -reveal_type(np.min_scalar_type(AR_f8)) # E: dtype[Any] +assert_type(np.min_scalar_type([1]), np.dtype[Any]) +assert_type(np.min_scalar_type(AR_f8), np.dtype[Any]) -reveal_type(np.result_type(int, [1])) # E: dtype[Any] -reveal_type(np.result_type(AR_f8, AR_u1)) # E: dtype[Any] -reveal_type(np.result_type(AR_f8, np.complex128)) # E: dtype[Any] +assert_type(np.result_type(int, [1]), np.dtype[Any]) +assert_type(np.result_type(AR_f8, AR_u1), np.dtype[Any]) +assert_type(np.result_type(AR_f8, np.complex128), np.dtype[Any]) -reveal_type(np.dot(AR_LIKE_f, AR_i8)) # E: Any -reveal_type(np.dot(AR_u1, 1)) # E: Any -reveal_type(np.dot(1.5j, 1)) # E: Any -reveal_type(np.dot(AR_u1, 1, out=AR_f8)) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.dot(AR_LIKE_f, AR_i8), Any) +assert_type(np.dot(AR_u1, 1), Any) +assert_type(np.dot(1.5j, 1), Any) +assert_type(np.dot(AR_u1, 1, out=AR_f8), npt.NDArray[np.float64]) -reveal_type(np.vdot(AR_LIKE_f, AR_i8)) # E: floating[Any] -reveal_type(np.vdot(AR_u1, 1)) # E: signedinteger[Any] -reveal_type(np.vdot(1.5j, 1)) # E: complexfloating[Any, Any] +assert_type(np.vdot(AR_LIKE_f, AR_i8), np.floating[Any]) +assert_type(np.vdot(AR_u1, 1), np.signedinteger[Any]) +assert_type(np.vdot(1.5j, 1), np.complexfloating[Any, Any]) -reveal_type(np.bincount(AR_i8)) # E: ndarray[Any, dtype[{intp}]] +assert_type(np.bincount(AR_i8), npt.NDArray[np.intp]) -reveal_type(np.copyto(AR_f8, [1., 1.5, 1.6])) # E: None +assert_type(np.copyto(AR_f8, [1., 1.5, 1.6]), None) -reveal_type(np.putmask(AR_f8, [True, True, False], 1.5)) # E: None +assert_type(np.putmask(AR_f8, [True, True, False], 1.5), None) -reveal_type(np.packbits(AR_i8)) # ndarray[Any, dtype[{uint8}]] -reveal_type(np.packbits(AR_u1)) # ndarray[Any, dtype[{uint8}]] +assert_type(np.packbits(AR_i8), npt.NDArray[np.uint8]) +assert_type(np.packbits(AR_u1), npt.NDArray[np.uint8]) -reveal_type(np.unpackbits(AR_u1)) # ndarray[Any, dtype[{uint8}]] +assert_type(np.unpackbits(AR_u1), npt.NDArray[np.uint8]) -reveal_type(np.shares_memory(1, 2)) # E: bool -reveal_type(np.shares_memory(AR_f8, AR_f8, max_work=1)) # E: bool +assert_type(np.shares_memory(1, 2), bool) +assert_type(np.shares_memory(AR_f8, AR_f8, max_work=1), bool) -reveal_type(np.may_share_memory(1, 2)) # E: bool -reveal_type(np.may_share_memory(AR_f8, AR_f8, max_work=1)) # E: bool +assert_type(np.may_share_memory(1, 2), bool) +assert_type(np.may_share_memory(AR_f8, AR_f8, max_work=1), bool) -reveal_type(np.geterrobj()) # E: list[Any] +assert_type(np.geterrobj(), list[Any]) -reveal_type(np.seterrobj([8192, 521, None])) # E: None +assert_type(np.seterrobj([8192, 521, None]), None) -reveal_type(np.promote_types(np.int32, np.int64)) # E: dtype[Any] -reveal_type(np.promote_types("f4", float)) # E: dtype[Any] +assert_type(np.promote_types(np.int32, np.int64), np.dtype[Any]) +assert_type(np.promote_types("f4", float), np.dtype[Any]) -reveal_type(np.frompyfunc(func, 1, 1, identity=None)) # ufunc +assert_type(np.frompyfunc(func, 1, 1, identity=None), np.ufunc) -reveal_type(np.datetime_data("m8[D]")) # E: Tuple[builtins.str, builtins.int] -reveal_type(np.datetime_data(np.datetime64)) # E: Tuple[builtins.str, builtins.int] -reveal_type(np.datetime_data(np.dtype(np.timedelta64))) # E: Tuple[builtins.str, builtins.int] +assert_type(np.datetime_data("m8[D]"), tuple[str, int]) +assert_type(np.datetime_data(np.datetime64), tuple[str, int]) +assert_type(np.datetime_data(np.dtype(np.timedelta64)), tuple[str, int]) -reveal_type(np.busday_count("2011-01", "2011-02")) # E: {int_} -reveal_type(np.busday_count(["2011-01"], "2011-02")) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.busday_count(["2011-01"], date_scalar)) # E: ndarray[Any, dtype[{int_}]] +assert_type(np.busday_count("2011-01", "2011-02"), np.int_) +assert_type(np.busday_count(["2011-01"], "2011-02"), npt.NDArray[np.int_]) +assert_type(np.busday_count(["2011-01"], date_scalar), npt.NDArray[np.int_]) -reveal_type(np.busday_offset(M, m)) # E: datetime64 -reveal_type(np.busday_offset(date_scalar, m)) # E: datetime64 -reveal_type(np.busday_offset(M, 5)) # E: datetime64 -reveal_type(np.busday_offset(AR_M, m)) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.busday_offset(M, timedelta_seq)) # E: ndarray[Any, dtype[datetime64]] -reveal_type(np.busday_offset("2011-01", "2011-02", roll="forward")) # E: datetime64 -reveal_type(np.busday_offset(["2011-01"], "2011-02", roll="forward")) # E: ndarray[Any, dtype[datetime64]] +assert_type(np.busday_offset(M, m), np.datetime64) +assert_type(np.busday_offset(date_scalar, m), np.datetime64) +assert_type(np.busday_offset(M, 5), np.datetime64) +assert_type(np.busday_offset(AR_M, m), npt.NDArray[np.datetime64]) +assert_type(np.busday_offset(M, timedelta_seq), npt.NDArray[np.datetime64]) +assert_type(np.busday_offset("2011-01", "2011-02", roll="forward"), np.datetime64) +assert_type(np.busday_offset(["2011-01"], "2011-02", roll="forward"), npt.NDArray[np.datetime64]) -reveal_type(np.is_busday("2012")) # E: bool_ -reveal_type(np.is_busday(date_scalar)) # E: bool_ -reveal_type(np.is_busday(["2012"])) # E: ndarray[Any, dtype[bool_]] +assert_type(np.is_busday("2012"), np.bool_) +assert_type(np.is_busday(date_scalar), np.bool_) +assert_type(np.is_busday(["2012"]), npt.NDArray[np.bool_]) -reveal_type(np.datetime_as_string(M)) # E: str_ -reveal_type(np.datetime_as_string(AR_M)) # E: ndarray[Any, dtype[str_]] +assert_type(np.datetime_as_string(M), np.str_) +assert_type(np.datetime_as_string(AR_M), npt.NDArray[np.str_]) -reveal_type(np.busdaycalendar(holidays=date_seq)) # E: busdaycalendar -reveal_type(np.busdaycalendar(holidays=[M])) # E: busdaycalendar +assert_type(np.busdaycalendar(holidays=date_seq), np.busdaycalendar) +assert_type(np.busdaycalendar(holidays=[M]), np.busdaycalendar) -reveal_type(np.compare_chararrays("a", "b", "!=", rstrip=False)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.compare_chararrays(b"a", b"a", "==", True)) # E: ndarray[Any, dtype[bool_]] +assert_type(np.compare_chararrays("a", "b", "!=", rstrip=False), npt.NDArray[np.bool_]) +assert_type(np.compare_chararrays(b"a", b"a", "==", True), npt.NDArray[np.bool_]) -reveal_type(np.add_docstring(func, "test")) # E: None +assert_type(np.add_docstring(func, "test"), None) -reveal_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], flags=["c_index"])) # E: tuple[nditer, ...] -reveal_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], op_flags=[["readonly", "readonly"]])) # E: tuple[nditer, ...] -reveal_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], op_dtypes=np.int_)) # E: tuple[nditer, ...] -reveal_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], order="C", casting="no")) # E: tuple[nditer, ...] +assert_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], flags=["c_index"]), tuple[np.nditer, ...]) +assert_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], op_flags=[["readonly", "readonly"]]), tuple[np.nditer, ...]) +assert_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], op_dtypes=np.int_), tuple[np.nditer, ...]) +assert_type(np.nested_iters([AR_i8, AR_i8], [[0], [1]], order="C", casting="no"), tuple[np.nditer, ...]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nbit_base_example.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nbit_base_example.pyi index a7cc681947..ac2eb1d253 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nbit_base_example.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nbit_base_example.pyi @@ -1,8 +1,14 @@ -from __future__ import annotations - +import sys from typing import TypeVar + import numpy as np import numpy.typing as npt +from numpy._typing import _64Bit, _32Bit + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type T1 = TypeVar("T1", bound=npt.NBitBase) T2 = TypeVar("T2", bound=npt.NBitBase) @@ -15,7 +21,7 @@ i4: np.int32 f8: np.float64 f4: np.float32 -reveal_type(add(f8, i8)) # E: {float64} -reveal_type(add(f4, i8)) # E: {float64} -reveal_type(add(f8, i4)) # E: {float64} -reveal_type(add(f4, i4)) # E: {float32} +assert_type(add(f8, i8), np.float64) +assert_type(add(f4, i8), np.floating[_32Bit | _64Bit]) +assert_type(add(f8, i4), np.floating[_32Bit | _64Bit]) +assert_type(add(f4, i4), np.float32) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_conversion.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_conversion.pyi index 6885d4fd65..a2fe73891f 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_conversion.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_conversion.pyi @@ -1,16 +1,24 @@ +import sys +from typing import Any + import numpy as np import numpy.typing as npt -nd: npt.NDArray[np.int_] = np.array([[1, 2], [3, 4]]) +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + +nd: npt.NDArray[np.int_] # item -reveal_type(nd.item()) # E: int -reveal_type(nd.item(1)) # E: int -reveal_type(nd.item(0, 1)) # E: int -reveal_type(nd.item((0, 1))) # E: int +assert_type(nd.item(), int) +assert_type(nd.item(1), int) +assert_type(nd.item(0, 1), int) +assert_type(nd.item((0, 1)), int) # tolist -reveal_type(nd.tolist()) # E: Any +assert_type(nd.tolist(), Any) # itemset does not return a value # tostring is pretty simple @@ -20,32 +28,32 @@ reveal_type(nd.tolist()) # E: Any # dumps is pretty simple # astype -reveal_type(nd.astype("float")) # E: ndarray[Any, dtype[Any]] -reveal_type(nd.astype(float)) # E: ndarray[Any, dtype[Any]] -reveal_type(nd.astype(np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(nd.astype(np.float64, "K")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(nd.astype(np.float64, "K", "unsafe")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(nd.astype(np.float64, "K", "unsafe", True)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(nd.astype(np.float64, "K", "unsafe", True, True)) # E: ndarray[Any, dtype[{float64}]] +assert_type(nd.astype("float"), npt.NDArray[Any]) +assert_type(nd.astype(float), npt.NDArray[Any]) +assert_type(nd.astype(np.float64), npt.NDArray[np.float64]) +assert_type(nd.astype(np.float64, "K"), npt.NDArray[np.float64]) +assert_type(nd.astype(np.float64, "K", "unsafe"), npt.NDArray[np.float64]) +assert_type(nd.astype(np.float64, "K", "unsafe", True), npt.NDArray[np.float64]) +assert_type(nd.astype(np.float64, "K", "unsafe", True, True), npt.NDArray[np.float64]) # byteswap -reveal_type(nd.byteswap()) # E: ndarray[Any, dtype[{int_}]] -reveal_type(nd.byteswap(True)) # E: ndarray[Any, dtype[{int_}]] +assert_type(nd.byteswap(), npt.NDArray[np.int_]) +assert_type(nd.byteswap(True), npt.NDArray[np.int_]) # copy -reveal_type(nd.copy()) # E: ndarray[Any, dtype[{int_}]] -reveal_type(nd.copy("C")) # E: ndarray[Any, dtype[{int_}]] +assert_type(nd.copy(), npt.NDArray[np.int_]) +assert_type(nd.copy("C"), npt.NDArray[np.int_]) -reveal_type(nd.view()) # E: ndarray[Any, dtype[{int_}]] -reveal_type(nd.view(np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(nd.view(float)) # E: ndarray[Any, dtype[Any]] -reveal_type(nd.view(np.float64, np.matrix)) # E: matrix[Any, Any] +assert_type(nd.view(), npt.NDArray[np.int_]) +assert_type(nd.view(np.float64), npt.NDArray[np.float64]) +assert_type(nd.view(float), npt.NDArray[Any]) +assert_type(nd.view(np.float64, np.matrix), np.matrix[Any, Any]) # getfield -reveal_type(nd.getfield("float")) # E: ndarray[Any, dtype[Any]] -reveal_type(nd.getfield(float)) # E: ndarray[Any, dtype[Any]] -reveal_type(nd.getfield(np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(nd.getfield(np.float64, 8)) # E: ndarray[Any, dtype[{float64}]] +assert_type(nd.getfield("float"), npt.NDArray[Any]) +assert_type(nd.getfield(float), npt.NDArray[Any]) +assert_type(nd.getfield(np.float64), npt.NDArray[np.float64]) +assert_type(nd.getfield(np.float64, 8), npt.NDArray[np.float64]) # setflags does not return a value # fill does not return a value diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_misc.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_misc.pyi index 03fea72dc2..4c1f093586 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_misc.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_misc.pyi @@ -6,215 +6,221 @@ function-based counterpart in `../from_numeric.py`. """ +import sys import operator import ctypes as ct -from typing import Any +from typing import Any, Literal import numpy as np -from numpy._typing import NDArray +import numpy.typing as npt -class SubClass(NDArray[np.object_]): ... +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + +class SubClass(npt.NDArray[np.object_]): ... f8: np.float64 B: SubClass -AR_f8: NDArray[np.float64] -AR_i8: NDArray[np.int64] -AR_U: NDArray[np.str_] -AR_V: NDArray[np.void] +AR_f8: npt.NDArray[np.float64] +AR_i8: npt.NDArray[np.int64] +AR_U: npt.NDArray[np.str_] +AR_V: npt.NDArray[np.void] ctypes_obj = AR_f8.ctypes -reveal_type(AR_f8.__dlpack__()) # E: Any -reveal_type(AR_f8.__dlpack_device__()) # E: Tuple[int, Literal[0]] - -reveal_type(ctypes_obj.data) # E: int -reveal_type(ctypes_obj.shape) # E: ctypes.Array[{c_intp}] -reveal_type(ctypes_obj.strides) # E: ctypes.Array[{c_intp}] -reveal_type(ctypes_obj._as_parameter_) # E: ctypes.c_void_p - -reveal_type(ctypes_obj.data_as(ct.c_void_p)) # E: ctypes.c_void_p -reveal_type(ctypes_obj.shape_as(ct.c_longlong)) # E: ctypes.Array[ctypes.c_longlong] -reveal_type(ctypes_obj.strides_as(ct.c_ubyte)) # E: ctypes.Array[ctypes.c_ubyte] - -reveal_type(f8.all()) # E: bool_ -reveal_type(AR_f8.all()) # E: bool_ -reveal_type(AR_f8.all(axis=0)) # E: Any -reveal_type(AR_f8.all(keepdims=True)) # E: Any -reveal_type(AR_f8.all(out=B)) # E: SubClass - -reveal_type(f8.any()) # E: bool_ -reveal_type(AR_f8.any()) # E: bool_ -reveal_type(AR_f8.any(axis=0)) # E: Any -reveal_type(AR_f8.any(keepdims=True)) # E: Any -reveal_type(AR_f8.any(out=B)) # E: SubClass - -reveal_type(f8.argmax()) # E: {intp} -reveal_type(AR_f8.argmax()) # E: {intp} -reveal_type(AR_f8.argmax(axis=0)) # E: Any -reveal_type(AR_f8.argmax(out=B)) # E: SubClass - -reveal_type(f8.argmin()) # E: {intp} -reveal_type(AR_f8.argmin()) # E: {intp} -reveal_type(AR_f8.argmin(axis=0)) # E: Any -reveal_type(AR_f8.argmin(out=B)) # E: SubClass - -reveal_type(f8.argsort()) # E: ndarray[Any, Any] -reveal_type(AR_f8.argsort()) # E: ndarray[Any, Any] - -reveal_type(f8.astype(np.int64).choose([()])) # E: ndarray[Any, Any] -reveal_type(AR_f8.choose([0])) # E: ndarray[Any, Any] -reveal_type(AR_f8.choose([0], out=B)) # E: SubClass - -reveal_type(f8.clip(1)) # E: Any -reveal_type(AR_f8.clip(1)) # E: Any -reveal_type(AR_f8.clip(None, 1)) # E: Any -reveal_type(AR_f8.clip(1, out=B)) # E: SubClass -reveal_type(AR_f8.clip(None, 1, out=B)) # E: SubClass - -reveal_type(f8.compress([0])) # E: ndarray[Any, Any] -reveal_type(AR_f8.compress([0])) # E: ndarray[Any, Any] -reveal_type(AR_f8.compress([0], out=B)) # E: SubClass - -reveal_type(f8.conj()) # E: {float64} -reveal_type(AR_f8.conj()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(B.conj()) # E: SubClass - -reveal_type(f8.conjugate()) # E: {float64} -reveal_type(AR_f8.conjugate()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(B.conjugate()) # E: SubClass - -reveal_type(f8.cumprod()) # E: ndarray[Any, Any] -reveal_type(AR_f8.cumprod()) # E: ndarray[Any, Any] -reveal_type(AR_f8.cumprod(out=B)) # E: SubClass - -reveal_type(f8.cumsum()) # E: ndarray[Any, Any] -reveal_type(AR_f8.cumsum()) # E: ndarray[Any, Any] -reveal_type(AR_f8.cumsum(out=B)) # E: SubClass - -reveal_type(f8.max()) # E: Any -reveal_type(AR_f8.max()) # E: Any -reveal_type(AR_f8.max(axis=0)) # E: Any -reveal_type(AR_f8.max(keepdims=True)) # E: Any -reveal_type(AR_f8.max(out=B)) # E: SubClass - -reveal_type(f8.mean()) # E: Any -reveal_type(AR_f8.mean()) # E: Any -reveal_type(AR_f8.mean(axis=0)) # E: Any -reveal_type(AR_f8.mean(keepdims=True)) # E: Any -reveal_type(AR_f8.mean(out=B)) # E: SubClass - -reveal_type(f8.min()) # E: Any -reveal_type(AR_f8.min()) # E: Any -reveal_type(AR_f8.min(axis=0)) # E: Any -reveal_type(AR_f8.min(keepdims=True)) # E: Any -reveal_type(AR_f8.min(out=B)) # E: SubClass - -reveal_type(f8.newbyteorder()) # E: {float64} -reveal_type(AR_f8.newbyteorder()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(B.newbyteorder('|')) # E: SubClass - -reveal_type(f8.prod()) # E: Any -reveal_type(AR_f8.prod()) # E: Any -reveal_type(AR_f8.prod(axis=0)) # E: Any -reveal_type(AR_f8.prod(keepdims=True)) # E: Any -reveal_type(AR_f8.prod(out=B)) # E: SubClass - -reveal_type(f8.ptp()) # E: Any -reveal_type(AR_f8.ptp()) # E: Any -reveal_type(AR_f8.ptp(axis=0)) # E: Any -reveal_type(AR_f8.ptp(keepdims=True)) # E: Any -reveal_type(AR_f8.ptp(out=B)) # E: SubClass - -reveal_type(f8.round()) # E: {float64} -reveal_type(AR_f8.round()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(AR_f8.round(out=B)) # E: SubClass - -reveal_type(f8.repeat(1)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(AR_f8.repeat(1)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(B.repeat(1)) # E: ndarray[Any, dtype[object_]] - -reveal_type(f8.std()) # E: Any -reveal_type(AR_f8.std()) # E: Any -reveal_type(AR_f8.std(axis=0)) # E: Any -reveal_type(AR_f8.std(keepdims=True)) # E: Any -reveal_type(AR_f8.std(out=B)) # E: SubClass - -reveal_type(f8.sum()) # E: Any -reveal_type(AR_f8.sum()) # E: Any -reveal_type(AR_f8.sum(axis=0)) # E: Any -reveal_type(AR_f8.sum(keepdims=True)) # E: Any -reveal_type(AR_f8.sum(out=B)) # E: SubClass - -reveal_type(f8.take(0)) # E: {float64} -reveal_type(AR_f8.take(0)) # E: {float64} -reveal_type(AR_f8.take([0])) # E: ndarray[Any, dtype[{float64}]] -reveal_type(AR_f8.take(0, out=B)) # E: SubClass -reveal_type(AR_f8.take([0], out=B)) # E: SubClass - -reveal_type(f8.var()) # E: Any -reveal_type(AR_f8.var()) # E: Any -reveal_type(AR_f8.var(axis=0)) # E: Any -reveal_type(AR_f8.var(keepdims=True)) # E: Any -reveal_type(AR_f8.var(out=B)) # E: SubClass - -reveal_type(AR_f8.argpartition([0])) # E: ndarray[Any, dtype[{intp}]] - -reveal_type(AR_f8.diagonal()) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(AR_f8.dot(1)) # E: ndarray[Any, Any] -reveal_type(AR_f8.dot([1])) # E: Any -reveal_type(AR_f8.dot(1, out=B)) # E: SubClass - -reveal_type(AR_f8.nonzero()) # E: tuple[ndarray[Any, dtype[{intp}]], ...] - -reveal_type(AR_f8.searchsorted(1)) # E: {intp} -reveal_type(AR_f8.searchsorted([1])) # E: ndarray[Any, dtype[{intp}]] - -reveal_type(AR_f8.trace()) # E: Any -reveal_type(AR_f8.trace(out=B)) # E: SubClass - -reveal_type(AR_f8.item()) # E: float -reveal_type(AR_U.item()) # E: str - -reveal_type(AR_f8.ravel()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(AR_U.ravel()) # E: ndarray[Any, dtype[str_]] - -reveal_type(AR_f8.flatten()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(AR_U.flatten()) # E: ndarray[Any, dtype[str_]] - -reveal_type(AR_f8.reshape(1)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(AR_U.reshape(1)) # E: ndarray[Any, dtype[str_]] - -reveal_type(int(AR_f8)) # E: int -reveal_type(int(AR_U)) # E: int - -reveal_type(float(AR_f8)) # E: float -reveal_type(float(AR_U)) # E: float - -reveal_type(complex(AR_f8)) # E: complex - -reveal_type(operator.index(AR_i8)) # E: int - -reveal_type(AR_f8.__array_prepare__(B)) # E: ndarray[Any, dtype[object_]] -reveal_type(AR_f8.__array_wrap__(B)) # E: ndarray[Any, dtype[object_]] - -reveal_type(AR_V[0]) # E: Any -reveal_type(AR_V[0, 0]) # E: Any -reveal_type(AR_V[AR_i8]) # E: ndarray[Any, dtype[void]] -reveal_type(AR_V[AR_i8, AR_i8]) # E: ndarray[Any, dtype[void]] -reveal_type(AR_V[AR_i8, None]) # E: ndarray[Any, dtype[void]] -reveal_type(AR_V[0, ...]) # E: ndarray[Any, dtype[void]] -reveal_type(AR_V[[0]]) # E: ndarray[Any, dtype[void]] -reveal_type(AR_V[[0], [0]]) # E: ndarray[Any, dtype[void]] -reveal_type(AR_V[:]) # E: ndarray[Any, dtype[void]] -reveal_type(AR_V["a"]) # E: ndarray[Any, dtype[Any]] -reveal_type(AR_V[["a", "b"]]) # E: ndarray[Any, dtype[void]] +assert_type(AR_f8.__dlpack__(), Any) +assert_type(AR_f8.__dlpack_device__(), tuple[int, Literal[0]]) + +assert_type(ctypes_obj.data, int) +assert_type(ctypes_obj.shape, ct.Array[np.ctypeslib.c_intp]) +assert_type(ctypes_obj.strides, ct.Array[np.ctypeslib.c_intp]) +assert_type(ctypes_obj._as_parameter_, ct.c_void_p) + +assert_type(ctypes_obj.data_as(ct.c_void_p), ct.c_void_p) +assert_type(ctypes_obj.shape_as(ct.c_longlong), ct.Array[ct.c_longlong]) +assert_type(ctypes_obj.strides_as(ct.c_ubyte), ct.Array[ct.c_ubyte]) + +assert_type(f8.all(), np.bool_) +assert_type(AR_f8.all(), np.bool_) +assert_type(AR_f8.all(axis=0), Any) +assert_type(AR_f8.all(keepdims=True), Any) +assert_type(AR_f8.all(out=B), SubClass) + +assert_type(f8.any(), np.bool_) +assert_type(AR_f8.any(), np.bool_) +assert_type(AR_f8.any(axis=0), Any) +assert_type(AR_f8.any(keepdims=True), Any) +assert_type(AR_f8.any(out=B), SubClass) + +assert_type(f8.argmax(), np.intp) +assert_type(AR_f8.argmax(), np.intp) +assert_type(AR_f8.argmax(axis=0), Any) +assert_type(AR_f8.argmax(out=B), SubClass) + +assert_type(f8.argmin(), np.intp) +assert_type(AR_f8.argmin(), np.intp) +assert_type(AR_f8.argmin(axis=0), Any) +assert_type(AR_f8.argmin(out=B), SubClass) + +assert_type(f8.argsort(), np.ndarray[Any, Any]) +assert_type(AR_f8.argsort(), np.ndarray[Any, Any]) + +assert_type(f8.astype(np.int64).choose([()]), np.ndarray[Any, Any]) +assert_type(AR_f8.choose([0]), np.ndarray[Any, Any]) +assert_type(AR_f8.choose([0], out=B), SubClass) + +assert_type(f8.clip(1), np.ndarray[Any, Any]) +assert_type(AR_f8.clip(1), np.ndarray[Any, Any]) +assert_type(AR_f8.clip(None, 1), np.ndarray[Any, Any]) +assert_type(AR_f8.clip(1, out=B), SubClass) +assert_type(AR_f8.clip(None, 1, out=B), SubClass) + +assert_type(f8.compress([0]), np.ndarray[Any, Any]) +assert_type(AR_f8.compress([0]), np.ndarray[Any, Any]) +assert_type(AR_f8.compress([0], out=B), SubClass) + +assert_type(f8.conj(), np.float64) +assert_type(AR_f8.conj(), npt.NDArray[np.float64]) +assert_type(B.conj(), SubClass) + +assert_type(f8.conjugate(), np.float64) +assert_type(AR_f8.conjugate(), npt.NDArray[np.float64]) +assert_type(B.conjugate(), SubClass) + +assert_type(f8.cumprod(), np.ndarray[Any, Any]) +assert_type(AR_f8.cumprod(), np.ndarray[Any, Any]) +assert_type(AR_f8.cumprod(out=B), SubClass) + +assert_type(f8.cumsum(), np.ndarray[Any, Any]) +assert_type(AR_f8.cumsum(), np.ndarray[Any, Any]) +assert_type(AR_f8.cumsum(out=B), SubClass) + +assert_type(f8.max(), Any) +assert_type(AR_f8.max(), Any) +assert_type(AR_f8.max(axis=0), Any) +assert_type(AR_f8.max(keepdims=True), Any) +assert_type(AR_f8.max(out=B), SubClass) + +assert_type(f8.mean(), Any) +assert_type(AR_f8.mean(), Any) +assert_type(AR_f8.mean(axis=0), Any) +assert_type(AR_f8.mean(keepdims=True), Any) +assert_type(AR_f8.mean(out=B), SubClass) + +assert_type(f8.min(), Any) +assert_type(AR_f8.min(), Any) +assert_type(AR_f8.min(axis=0), Any) +assert_type(AR_f8.min(keepdims=True), Any) +assert_type(AR_f8.min(out=B), SubClass) + +assert_type(f8.newbyteorder(), np.float64) +assert_type(AR_f8.newbyteorder(), npt.NDArray[np.float64]) +assert_type(B.newbyteorder('|'), SubClass) + +assert_type(f8.prod(), Any) +assert_type(AR_f8.prod(), Any) +assert_type(AR_f8.prod(axis=0), Any) +assert_type(AR_f8.prod(keepdims=True), Any) +assert_type(AR_f8.prod(out=B), SubClass) + +assert_type(f8.ptp(), Any) +assert_type(AR_f8.ptp(), Any) +assert_type(AR_f8.ptp(axis=0), Any) +assert_type(AR_f8.ptp(keepdims=True), Any) +assert_type(AR_f8.ptp(out=B), SubClass) + +assert_type(f8.round(), np.float64) +assert_type(AR_f8.round(), npt.NDArray[np.float64]) +assert_type(AR_f8.round(out=B), SubClass) + +assert_type(f8.repeat(1), npt.NDArray[np.float64]) +assert_type(AR_f8.repeat(1), npt.NDArray[np.float64]) +assert_type(B.repeat(1), npt.NDArray[np.object_]) + +assert_type(f8.std(), Any) +assert_type(AR_f8.std(), Any) +assert_type(AR_f8.std(axis=0), Any) +assert_type(AR_f8.std(keepdims=True), Any) +assert_type(AR_f8.std(out=B), SubClass) + +assert_type(f8.sum(), Any) +assert_type(AR_f8.sum(), Any) +assert_type(AR_f8.sum(axis=0), Any) +assert_type(AR_f8.sum(keepdims=True), Any) +assert_type(AR_f8.sum(out=B), SubClass) + +assert_type(f8.take(0), np.float64) +assert_type(AR_f8.take(0), np.float64) +assert_type(AR_f8.take([0]), npt.NDArray[np.float64]) +assert_type(AR_f8.take(0, out=B), SubClass) +assert_type(AR_f8.take([0], out=B), SubClass) + +assert_type(f8.var(), Any) +assert_type(AR_f8.var(), Any) +assert_type(AR_f8.var(axis=0), Any) +assert_type(AR_f8.var(keepdims=True), Any) +assert_type(AR_f8.var(out=B), SubClass) + +assert_type(AR_f8.argpartition([0]), npt.NDArray[np.intp]) + +assert_type(AR_f8.diagonal(), npt.NDArray[np.float64]) + +assert_type(AR_f8.dot(1), np.ndarray[Any, Any]) +assert_type(AR_f8.dot([1]), Any) +assert_type(AR_f8.dot(1, out=B), SubClass) + +assert_type(AR_f8.nonzero(), tuple[npt.NDArray[np.intp], ...]) + +assert_type(AR_f8.searchsorted(1), np.intp) +assert_type(AR_f8.searchsorted([1]), npt.NDArray[np.intp]) + +assert_type(AR_f8.trace(), Any) +assert_type(AR_f8.trace(out=B), SubClass) + +assert_type(AR_f8.item(), float) +assert_type(AR_U.item(), str) + +assert_type(AR_f8.ravel(), npt.NDArray[np.float64]) +assert_type(AR_U.ravel(), npt.NDArray[np.str_]) + +assert_type(AR_f8.flatten(), npt.NDArray[np.float64]) +assert_type(AR_U.flatten(), npt.NDArray[np.str_]) + +assert_type(AR_f8.reshape(1), npt.NDArray[np.float64]) +assert_type(AR_U.reshape(1), npt.NDArray[np.str_]) + +assert_type(int(AR_f8), int) +assert_type(int(AR_U), int) + +assert_type(float(AR_f8), float) +assert_type(float(AR_U), float) + +assert_type(complex(AR_f8), complex) + +assert_type(operator.index(AR_i8), int) + +assert_type(AR_f8.__array_prepare__(B), npt.NDArray[np.object_]) +assert_type(AR_f8.__array_wrap__(B), npt.NDArray[np.object_]) + +assert_type(AR_V[0], Any) +assert_type(AR_V[0, 0], Any) +assert_type(AR_V[AR_i8], npt.NDArray[np.void]) +assert_type(AR_V[AR_i8, AR_i8], npt.NDArray[np.void]) +assert_type(AR_V[AR_i8, None], npt.NDArray[np.void]) +assert_type(AR_V[0, ...], npt.NDArray[np.void]) +assert_type(AR_V[[0]], npt.NDArray[np.void]) +assert_type(AR_V[[0], [0]], npt.NDArray[np.void]) +assert_type(AR_V[:], npt.NDArray[np.void]) +assert_type(AR_V["a"], npt.NDArray[Any]) +assert_type(AR_V[["a", "b"]], npt.NDArray[np.void]) -reveal_type(AR_f8.dump("test_file")) # E: None -reveal_type(AR_f8.dump(b"test_file")) # E: None +assert_type(AR_f8.dump("test_file"), None) +assert_type(AR_f8.dump(b"test_file"), None) with open("test_file", "wb") as f: - reveal_type(AR_f8.dump(f)) # E: None + assert_type(AR_f8.dump(f), None) -reveal_type(AR_f8.__array_finalize__(None)) # E: None -reveal_type(AR_f8.__array_finalize__(B)) # E: None -reveal_type(AR_f8.__array_finalize__(AR_f8)) # E: None +assert_type(AR_f8.__array_finalize__(None), None) +assert_type(AR_f8.__array_finalize__(B), None) +assert_type(AR_f8.__array_finalize__(AR_f8), None) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_shape_manipulation.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_shape_manipulation.pyi index c000bf45c3..9a41a90f1e 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_shape_manipulation.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ndarray_shape_manipulation.pyi @@ -1,35 +1,44 @@ +import sys +from typing import Any + import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type -nd = np.array([[1, 2], [3, 4]]) +nd: npt.NDArray[np.int64] # reshape -reveal_type(nd.reshape()) # E: ndarray -reveal_type(nd.reshape(4)) # E: ndarray -reveal_type(nd.reshape(2, 2)) # E: ndarray -reveal_type(nd.reshape((2, 2))) # E: ndarray +assert_type(nd.reshape(), npt.NDArray[np.int64]) +assert_type(nd.reshape(4), npt.NDArray[np.int64]) +assert_type(nd.reshape(2, 2), npt.NDArray[np.int64]) +assert_type(nd.reshape((2, 2)), npt.NDArray[np.int64]) -reveal_type(nd.reshape((2, 2), order="C")) # E: ndarray -reveal_type(nd.reshape(4, order="C")) # E: ndarray +assert_type(nd.reshape((2, 2), order="C"), npt.NDArray[np.int64]) +assert_type(nd.reshape(4, order="C"), npt.NDArray[np.int64]) # resize does not return a value # transpose -reveal_type(nd.transpose()) # E: ndarray -reveal_type(nd.transpose(1, 0)) # E: ndarray -reveal_type(nd.transpose((1, 0))) # E: ndarray +assert_type(nd.transpose(), npt.NDArray[np.int64]) +assert_type(nd.transpose(1, 0), npt.NDArray[np.int64]) +assert_type(nd.transpose((1, 0)), npt.NDArray[np.int64]) # swapaxes -reveal_type(nd.swapaxes(0, 1)) # E: ndarray +assert_type(nd.swapaxes(0, 1), npt.NDArray[np.int64]) # flatten -reveal_type(nd.flatten()) # E: ndarray -reveal_type(nd.flatten("C")) # E: ndarray +assert_type(nd.flatten(), npt.NDArray[np.int64]) +assert_type(nd.flatten("C"), npt.NDArray[np.int64]) # ravel -reveal_type(nd.ravel()) # E: ndarray -reveal_type(nd.ravel("C")) # E: ndarray +assert_type(nd.ravel(), npt.NDArray[np.int64]) +assert_type(nd.ravel("C"), npt.NDArray[np.int64]) # squeeze -reveal_type(nd.squeeze()) # E: ndarray -reveal_type(nd.squeeze(0)) # E: ndarray -reveal_type(nd.squeeze((0, 2))) # E: ndarray +assert_type(nd.squeeze(), npt.NDArray[np.int64]) +assert_type(nd.squeeze(0), npt.NDArray[np.int64]) +assert_type(nd.squeeze((0, 2)), npt.NDArray[np.int64]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nditer.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nditer.pyi index fd8b7e1094..589453e777 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nditer.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nditer.pyi @@ -1,46 +1,55 @@ +import sys +from typing import Any + import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type nditer_obj: np.nditer -reveal_type(np.nditer([0, 1], flags=["c_index"])) # E: nditer -reveal_type(np.nditer([0, 1], op_flags=[["readonly", "readonly"]])) # E: nditer -reveal_type(np.nditer([0, 1], op_dtypes=np.int_)) # E: nditer -reveal_type(np.nditer([0, 1], order="C", casting="no")) # E: nditer +assert_type(np.nditer([0, 1], flags=["c_index"]), np.nditer) +assert_type(np.nditer([0, 1], op_flags=[["readonly", "readonly"]]), np.nditer) +assert_type(np.nditer([0, 1], op_dtypes=np.int_), np.nditer) +assert_type(np.nditer([0, 1], order="C", casting="no"), np.nditer) -reveal_type(nditer_obj.dtypes) # E: tuple[dtype[Any], ...] -reveal_type(nditer_obj.finished) # E: bool -reveal_type(nditer_obj.has_delayed_bufalloc) # E: bool -reveal_type(nditer_obj.has_index) # E: bool -reveal_type(nditer_obj.has_multi_index) # E: bool -reveal_type(nditer_obj.index) # E: int -reveal_type(nditer_obj.iterationneedsapi) # E: bool -reveal_type(nditer_obj.iterindex) # E: int -reveal_type(nditer_obj.iterrange) # E: tuple[builtins.int, ...] -reveal_type(nditer_obj.itersize) # E: int -reveal_type(nditer_obj.itviews) # E: tuple[ndarray[Any, dtype[Any]], ...] -reveal_type(nditer_obj.multi_index) # E: tuple[builtins.int, ...] -reveal_type(nditer_obj.ndim) # E: int -reveal_type(nditer_obj.nop) # E: int -reveal_type(nditer_obj.operands) # E: tuple[ndarray[Any, dtype[Any]], ...] -reveal_type(nditer_obj.shape) # E: tuple[builtins.int, ...] -reveal_type(nditer_obj.value) # E: tuple[ndarray[Any, dtype[Any]], ...] +assert_type(nditer_obj.dtypes, tuple[np.dtype[Any], ...]) +assert_type(nditer_obj.finished, bool) +assert_type(nditer_obj.has_delayed_bufalloc, bool) +assert_type(nditer_obj.has_index, bool) +assert_type(nditer_obj.has_multi_index, bool) +assert_type(nditer_obj.index, int) +assert_type(nditer_obj.iterationneedsapi, bool) +assert_type(nditer_obj.iterindex, int) +assert_type(nditer_obj.iterrange, tuple[int, ...]) +assert_type(nditer_obj.itersize, int) +assert_type(nditer_obj.itviews, tuple[npt.NDArray[Any], ...]) +assert_type(nditer_obj.multi_index, tuple[int, ...]) +assert_type(nditer_obj.ndim, int) +assert_type(nditer_obj.nop, int) +assert_type(nditer_obj.operands, tuple[npt.NDArray[Any], ...]) +assert_type(nditer_obj.shape, tuple[int, ...]) +assert_type(nditer_obj.value, tuple[npt.NDArray[Any], ...]) -reveal_type(nditer_obj.close()) # E: None -reveal_type(nditer_obj.copy()) # E: nditer -reveal_type(nditer_obj.debug_print()) # E: None -reveal_type(nditer_obj.enable_external_loop()) # E: None -reveal_type(nditer_obj.iternext()) # E: bool -reveal_type(nditer_obj.remove_axis(0)) # E: None -reveal_type(nditer_obj.remove_multi_index()) # E: None -reveal_type(nditer_obj.reset()) # E: None +assert_type(nditer_obj.close(), None) +assert_type(nditer_obj.copy(), np.nditer) +assert_type(nditer_obj.debug_print(), None) +assert_type(nditer_obj.enable_external_loop(), None) +assert_type(nditer_obj.iternext(), bool) +assert_type(nditer_obj.remove_axis(0), None) +assert_type(nditer_obj.remove_multi_index(), None) +assert_type(nditer_obj.reset(), None) -reveal_type(len(nditer_obj)) # E: int -reveal_type(iter(nditer_obj)) # E: nditer -reveal_type(next(nditer_obj)) # E: tuple[ndarray[Any, dtype[Any]], ...] -reveal_type(nditer_obj.__copy__()) # E: nditer +assert_type(len(nditer_obj), int) +assert_type(iter(nditer_obj), np.nditer) +assert_type(next(nditer_obj), tuple[npt.NDArray[Any], ...]) +assert_type(nditer_obj.__copy__(), np.nditer) with nditer_obj as f: - reveal_type(f) # E: nditer -reveal_type(nditer_obj[0]) # E: ndarray[Any, dtype[Any]] -reveal_type(nditer_obj[:]) # E: tuple[ndarray[Any, dtype[Any]], ...] + assert_type(f, np.nditer) +assert_type(nditer_obj[0], npt.NDArray[Any]) +assert_type(nditer_obj[:], tuple[npt.NDArray[Any], ...]) nditer_obj[0] = 0 nditer_obj[:] = [0, 1] diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nested_sequence.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nested_sequence.pyi index 286f75ac5c..3ca23d6875 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nested_sequence.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/nested_sequence.pyi @@ -1,8 +1,14 @@ +import sys from collections.abc import Sequence from typing import Any from numpy._typing import _NestedSequence +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + a: Sequence[int] b: Sequence[Sequence[int]] c: Sequence[Sequence[Sequence[int]]] @@ -15,12 +21,12 @@ h: Sequence[Any] def func(a: _NestedSequence[int]) -> None: ... -reveal_type(func(a)) # E: None -reveal_type(func(b)) # E: None -reveal_type(func(c)) # E: None -reveal_type(func(d)) # E: None -reveal_type(func(e)) # E: None -reveal_type(func(f)) # E: None -reveal_type(func(g)) # E: None -reveal_type(func(h)) # E: None -reveal_type(func(range(15))) # E: None +assert_type(func(a), None) +assert_type(func(b), None) +assert_type(func(c), None) +assert_type(func(d), None) +assert_type(func(e), None) +assert_type(func(f), None) +assert_type(func(g), None) +assert_type(func(h), None) +assert_type(func(range(15)), None) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/npyio.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/npyio.pyi index 2c62d8d21e..bbd906068d 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/npyio.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/npyio.pyi @@ -1,17 +1,27 @@ import re +import sys +import zipfile import pathlib -from typing import IO +from typing import IO, Any +from collections.abc import Mapping import numpy.typing as npt import numpy as np +from numpy.lib.npyio import BagObj, NpzFile +from numpy.ma.mrecords import MaskedRecords + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type str_path: str pathlib_path: pathlib.Path str_file: IO[str] bytes_file: IO[bytes] -bag_obj: np.lib.npyio.BagObj[int] -npz_file: np.lib.npyio.NpzFile +bag_obj: BagObj[int] +npz_file: NpzFile AR_i8: npt.NDArray[np.int64] AR_LIKE_f8: list[float] @@ -26,67 +36,67 @@ class BytesReader: bytes_writer: BytesWriter bytes_reader: BytesReader -reveal_type(bag_obj.a) # E: int -reveal_type(bag_obj.b) # E: int - -reveal_type(npz_file.zip) # E: zipfile.ZipFile -reveal_type(npz_file.fid) # E: Union[None, typing.IO[builtins.str]] -reveal_type(npz_file.files) # E: list[builtins.str] -reveal_type(npz_file.allow_pickle) # E: bool -reveal_type(npz_file.pickle_kwargs) # E: Union[None, typing.Mapping[builtins.str, Any]] -reveal_type(npz_file.f) # E: lib.npyio.BagObj[lib.npyio.NpzFile] -reveal_type(npz_file["test"]) # E: ndarray[Any, dtype[Any]] -reveal_type(len(npz_file)) # E: int +assert_type(bag_obj.a, int) +assert_type(bag_obj.b, int) + +assert_type(npz_file.zip, zipfile.ZipFile) +assert_type(npz_file.fid, None | IO[str]) +assert_type(npz_file.files, list[str]) +assert_type(npz_file.allow_pickle, bool) +assert_type(npz_file.pickle_kwargs, None | Mapping[str, Any]) +assert_type(npz_file.f, BagObj[NpzFile]) +assert_type(npz_file["test"], npt.NDArray[Any]) +assert_type(len(npz_file), int) with npz_file as f: - reveal_type(f) # E: lib.npyio.NpzFile - -reveal_type(np.load(bytes_file)) # E: Any -reveal_type(np.load(pathlib_path, allow_pickle=True)) # E: Any -reveal_type(np.load(str_path, encoding="bytes")) # E: Any -reveal_type(np.load(bytes_reader)) # E: Any - -reveal_type(np.save(bytes_file, AR_LIKE_f8)) # E: None -reveal_type(np.save(pathlib_path, AR_i8, allow_pickle=True)) # E: None -reveal_type(np.save(str_path, AR_LIKE_f8)) # E: None -reveal_type(np.save(bytes_writer, AR_LIKE_f8)) # E: None - -reveal_type(np.savez(bytes_file, AR_LIKE_f8)) # E: None -reveal_type(np.savez(pathlib_path, ar1=AR_i8, ar2=AR_i8)) # E: None -reveal_type(np.savez(str_path, AR_LIKE_f8, ar1=AR_i8)) # E: None -reveal_type(np.savez(bytes_writer, AR_LIKE_f8, ar1=AR_i8)) # E: None - -reveal_type(np.savez_compressed(bytes_file, AR_LIKE_f8)) # E: None -reveal_type(np.savez_compressed(pathlib_path, ar1=AR_i8, ar2=AR_i8)) # E: None -reveal_type(np.savez_compressed(str_path, AR_LIKE_f8, ar1=AR_i8)) # E: None -reveal_type(np.savez_compressed(bytes_writer, AR_LIKE_f8, ar1=AR_i8)) # E: None - -reveal_type(np.loadtxt(bytes_file)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.loadtxt(pathlib_path, dtype=np.str_)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.loadtxt(str_path, dtype=str, skiprows=2)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.loadtxt(str_file, comments="test")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.loadtxt(str_file, comments=None)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.loadtxt(str_path, delimiter="\n")) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.loadtxt(str_path, ndmin=2)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.loadtxt(["1", "2", "3"])) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.fromregex(bytes_file, "test", np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fromregex(str_file, b"test", dtype=float)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.fromregex(str_path, re.compile("test"), dtype=np.str_, encoding="utf8")) # E: ndarray[Any, dtype[str_]] -reveal_type(np.fromregex(pathlib_path, "test", np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.fromregex(bytes_reader, "test", np.float64)) # E: ndarray[Any, dtype[{float64}]] - -reveal_type(np.genfromtxt(bytes_file)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.genfromtxt(pathlib_path, dtype=np.str_)) # E: ndarray[Any, dtype[str_]] -reveal_type(np.genfromtxt(str_path, dtype=str, skip_header=2)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.genfromtxt(str_file, comments="test")) # E: ndarray[Any, dtype[Any]] -reveal_type(np.genfromtxt(str_path, delimiter="\n")) # E: ndarray[Any, dtype[Any]] -reveal_type(np.genfromtxt(str_path, ndmin=2)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.genfromtxt(["1", "2", "3"], ndmin=2)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.recfromtxt(bytes_file)) # E: recarray[Any, dtype[record]] -reveal_type(np.recfromtxt(pathlib_path, usemask=True)) # E: ma.mrecords.MaskedRecords[Any, dtype[void]] -reveal_type(np.recfromtxt(["1", "2", "3"])) # E: recarray[Any, dtype[record]] - -reveal_type(np.recfromcsv(bytes_file)) # E: recarray[Any, dtype[record]] -reveal_type(np.recfromcsv(pathlib_path, usemask=True)) # E: ma.mrecords.MaskedRecords[Any, dtype[void]] -reveal_type(np.recfromcsv(["1", "2", "3"])) # E: recarray[Any, dtype[record]] + assert_type(f, NpzFile) + +assert_type(np.load(bytes_file), Any) +assert_type(np.load(pathlib_path, allow_pickle=True), Any) +assert_type(np.load(str_path, encoding="bytes"), Any) +assert_type(np.load(bytes_reader), Any) + +assert_type(np.save(bytes_file, AR_LIKE_f8), None) +assert_type(np.save(pathlib_path, AR_i8, allow_pickle=True), None) +assert_type(np.save(str_path, AR_LIKE_f8), None) +assert_type(np.save(bytes_writer, AR_LIKE_f8), None) + +assert_type(np.savez(bytes_file, AR_LIKE_f8), None) +assert_type(np.savez(pathlib_path, ar1=AR_i8, ar2=AR_i8), None) +assert_type(np.savez(str_path, AR_LIKE_f8, ar1=AR_i8), None) +assert_type(np.savez(bytes_writer, AR_LIKE_f8, ar1=AR_i8), None) + +assert_type(np.savez_compressed(bytes_file, AR_LIKE_f8), None) +assert_type(np.savez_compressed(pathlib_path, ar1=AR_i8, ar2=AR_i8), None) +assert_type(np.savez_compressed(str_path, AR_LIKE_f8, ar1=AR_i8), None) +assert_type(np.savez_compressed(bytes_writer, AR_LIKE_f8, ar1=AR_i8), None) + +assert_type(np.loadtxt(bytes_file), npt.NDArray[np.float64]) +assert_type(np.loadtxt(pathlib_path, dtype=np.str_), npt.NDArray[np.str_]) +assert_type(np.loadtxt(str_path, dtype=str, skiprows=2), npt.NDArray[Any]) +assert_type(np.loadtxt(str_file, comments="test"), npt.NDArray[np.float64]) +assert_type(np.loadtxt(str_file, comments=None), npt.NDArray[np.float64]) +assert_type(np.loadtxt(str_path, delimiter="\n"), npt.NDArray[np.float64]) +assert_type(np.loadtxt(str_path, ndmin=2), npt.NDArray[np.float64]) +assert_type(np.loadtxt(["1", "2", "3"]), npt.NDArray[np.float64]) + +assert_type(np.fromregex(bytes_file, "test", np.float64), npt.NDArray[np.float64]) +assert_type(np.fromregex(str_file, b"test", dtype=float), npt.NDArray[Any]) +assert_type(np.fromregex(str_path, re.compile("test"), dtype=np.str_, encoding="utf8"), npt.NDArray[np.str_]) +assert_type(np.fromregex(pathlib_path, "test", np.float64), npt.NDArray[np.float64]) +assert_type(np.fromregex(bytes_reader, "test", np.float64), npt.NDArray[np.float64]) + +assert_type(np.genfromtxt(bytes_file), npt.NDArray[Any]) +assert_type(np.genfromtxt(pathlib_path, dtype=np.str_), npt.NDArray[np.str_]) +assert_type(np.genfromtxt(str_path, dtype=str, skip_header=2), npt.NDArray[Any]) +assert_type(np.genfromtxt(str_file, comments="test"), npt.NDArray[Any]) +assert_type(np.genfromtxt(str_path, delimiter="\n"), npt.NDArray[Any]) +assert_type(np.genfromtxt(str_path, ndmin=2), npt.NDArray[Any]) +assert_type(np.genfromtxt(["1", "2", "3"], ndmin=2), npt.NDArray[Any]) + +assert_type(np.recfromtxt(bytes_file), np.recarray[Any, np.dtype[np.record]]) +assert_type(np.recfromtxt(pathlib_path, usemask=True), MaskedRecords[Any, np.dtype[np.void]]) +assert_type(np.recfromtxt(["1", "2", "3"]), np.recarray[Any, np.dtype[np.record]]) + +assert_type(np.recfromcsv(bytes_file), np.recarray[Any, np.dtype[np.record]]) +assert_type(np.recfromcsv(pathlib_path, usemask=True), MaskedRecords[Any, np.dtype[np.void]]) +assert_type(np.recfromcsv(["1", "2", "3"]), np.recarray[Any, np.dtype[np.record]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numeric.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numeric.pyi index b8fe15d3a0..78f3980aed 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numeric.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numeric.pyi @@ -5,9 +5,17 @@ Does not include tests which fall under ``array_constructors``. """ +import sys +from typing import Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + class SubClass(npt.NDArray[np.int64]): ... @@ -24,110 +32,110 @@ AR_O: npt.NDArray[np.object_] B: list[int] C: SubClass -reveal_type(np.count_nonzero(i8)) # E: int -reveal_type(np.count_nonzero(AR_i8)) # E: int -reveal_type(np.count_nonzero(B)) # E: int -reveal_type(np.count_nonzero(AR_i8, keepdims=True)) # E: Any -reveal_type(np.count_nonzero(AR_i8, axis=0)) # E: Any - -reveal_type(np.isfortran(i8)) # E: bool -reveal_type(np.isfortran(AR_i8)) # E: bool - -reveal_type(np.argwhere(i8)) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.argwhere(AR_i8)) # E: ndarray[Any, dtype[{intp}]] - -reveal_type(np.flatnonzero(i8)) # E: ndarray[Any, dtype[{intp}]] -reveal_type(np.flatnonzero(AR_i8)) # E: ndarray[Any, dtype[{intp}]] - -reveal_type(np.correlate(B, AR_i8, mode="valid")) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.correlate(AR_i8, AR_i8, mode="same")) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.correlate(AR_b, AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.correlate(AR_b, AR_u8)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.correlate(AR_i8, AR_b)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.correlate(AR_i8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.correlate(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.correlate(AR_i8, AR_m)) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.correlate(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.convolve(B, AR_i8, mode="valid")) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.convolve(AR_i8, AR_i8, mode="same")) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.convolve(AR_b, AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.convolve(AR_b, AR_u8)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.convolve(AR_i8, AR_b)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.convolve(AR_i8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.convolve(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.convolve(AR_i8, AR_m)) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.convolve(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.outer(i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.outer(B, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.outer(AR_i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.outer(AR_i8, AR_i8, out=C)) # E: SubClass -reveal_type(np.outer(AR_b, AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.outer(AR_b, AR_u8)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.outer(AR_i8, AR_b)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.convolve(AR_i8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.outer(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.outer(AR_i8, AR_m)) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.outer(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.tensordot(B, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.tensordot(AR_i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.tensordot(AR_i8, AR_i8, axes=0)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.tensordot(AR_i8, AR_i8, axes=(0, 1))) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.tensordot(AR_b, AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.tensordot(AR_b, AR_u8)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.tensordot(AR_i8, AR_b)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.tensordot(AR_i8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.tensordot(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.tensordot(AR_i8, AR_m)) # E: ndarray[Any, dtype[timedelta64]] -reveal_type(np.tensordot(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.isscalar(i8)) # E: bool -reveal_type(np.isscalar(AR_i8)) # E: bool -reveal_type(np.isscalar(B)) # E: bool - -reveal_type(np.roll(AR_i8, 1)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.roll(AR_i8, (1, 2))) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.roll(B, 1)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.rollaxis(AR_i8, 0, 1)) # E: ndarray[Any, dtype[{int64}]] - -reveal_type(np.moveaxis(AR_i8, 0, 1)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.moveaxis(AR_i8, (0, 1), (1, 2))) # E: ndarray[Any, dtype[{int64}]] - -reveal_type(np.cross(B, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.cross(AR_i8, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.cross(AR_b, AR_u8)) # E: ndarray[Any, dtype[unsignedinteger[Any]]] -reveal_type(np.cross(AR_i8, AR_b)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.cross(AR_i8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.cross(AR_i8, AR_c16)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.cross(AR_O, AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.indices([0, 1, 2])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(np.indices([0, 1, 2], sparse=True)) # E: tuple[ndarray[Any, dtype[{int_}]], ...] -reveal_type(np.indices([0, 1, 2], dtype=np.float64)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.indices([0, 1, 2], sparse=True, dtype=np.float64)) # E: tuple[ndarray[Any, dtype[{float64}]], ...] -reveal_type(np.indices([0, 1, 2], dtype=float)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.indices([0, 1, 2], sparse=True, dtype=float)) # E: tuple[ndarray[Any, dtype[Any]], ...] - -reveal_type(np.binary_repr(1)) # E: str - -reveal_type(np.base_repr(1)) # E: str - -reveal_type(np.allclose(i8, AR_i8)) # E: bool -reveal_type(np.allclose(B, AR_i8)) # E: bool -reveal_type(np.allclose(AR_i8, AR_i8)) # E: bool - -reveal_type(np.isclose(i8, i8)) # E: bool_ -reveal_type(np.isclose(i8, AR_i8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isclose(B, AR_i8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isclose(AR_i8, AR_i8)) # E: ndarray[Any, dtype[bool_]] - -reveal_type(np.array_equal(i8, AR_i8)) # E: bool -reveal_type(np.array_equal(B, AR_i8)) # E: bool -reveal_type(np.array_equal(AR_i8, AR_i8)) # E: bool - -reveal_type(np.array_equiv(i8, AR_i8)) # E: bool -reveal_type(np.array_equiv(B, AR_i8)) # E: bool -reveal_type(np.array_equiv(AR_i8, AR_i8)) # E: bool +assert_type(np.count_nonzero(i8), int) +assert_type(np.count_nonzero(AR_i8), int) +assert_type(np.count_nonzero(B), int) +assert_type(np.count_nonzero(AR_i8, keepdims=True), Any) +assert_type(np.count_nonzero(AR_i8, axis=0), Any) + +assert_type(np.isfortran(i8), bool) +assert_type(np.isfortran(AR_i8), bool) + +assert_type(np.argwhere(i8), npt.NDArray[np.intp]) +assert_type(np.argwhere(AR_i8), npt.NDArray[np.intp]) + +assert_type(np.flatnonzero(i8), npt.NDArray[np.intp]) +assert_type(np.flatnonzero(AR_i8), npt.NDArray[np.intp]) + +assert_type(np.correlate(B, AR_i8, mode="valid"), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.correlate(AR_i8, AR_i8, mode="same"), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.correlate(AR_b, AR_b), npt.NDArray[np.bool_]) +assert_type(np.correlate(AR_b, AR_u8), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.correlate(AR_i8, AR_b), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.correlate(AR_i8, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.correlate(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.correlate(AR_i8, AR_m), npt.NDArray[np.timedelta64]) +assert_type(np.correlate(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.convolve(B, AR_i8, mode="valid"), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.convolve(AR_i8, AR_i8, mode="same"), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.convolve(AR_b, AR_b), npt.NDArray[np.bool_]) +assert_type(np.convolve(AR_b, AR_u8), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.convolve(AR_i8, AR_b), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.convolve(AR_i8, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.convolve(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.convolve(AR_i8, AR_m), npt.NDArray[np.timedelta64]) +assert_type(np.convolve(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.outer(i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.outer(B, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.outer(AR_i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.outer(AR_i8, AR_i8, out=C), SubClass) +assert_type(np.outer(AR_b, AR_b), npt.NDArray[np.bool_]) +assert_type(np.outer(AR_b, AR_u8), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.outer(AR_i8, AR_b), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.convolve(AR_i8, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.outer(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.outer(AR_i8, AR_m), npt.NDArray[np.timedelta64]) +assert_type(np.outer(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.tensordot(B, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.tensordot(AR_i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.tensordot(AR_i8, AR_i8, axes=0), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.tensordot(AR_i8, AR_i8, axes=(0, 1)), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.tensordot(AR_b, AR_b), npt.NDArray[np.bool_]) +assert_type(np.tensordot(AR_b, AR_u8), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.tensordot(AR_i8, AR_b), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.tensordot(AR_i8, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.tensordot(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.tensordot(AR_i8, AR_m), npt.NDArray[np.timedelta64]) +assert_type(np.tensordot(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.isscalar(i8), bool) +assert_type(np.isscalar(AR_i8), bool) +assert_type(np.isscalar(B), bool) + +assert_type(np.roll(AR_i8, 1), npt.NDArray[np.int64]) +assert_type(np.roll(AR_i8, (1, 2)), npt.NDArray[np.int64]) +assert_type(np.roll(B, 1), npt.NDArray[Any]) + +assert_type(np.rollaxis(AR_i8, 0, 1), npt.NDArray[np.int64]) + +assert_type(np.moveaxis(AR_i8, 0, 1), npt.NDArray[np.int64]) +assert_type(np.moveaxis(AR_i8, (0, 1), (1, 2)), npt.NDArray[np.int64]) + +assert_type(np.cross(B, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.cross(AR_i8, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.cross(AR_b, AR_u8), npt.NDArray[np.unsignedinteger[Any]]) +assert_type(np.cross(AR_i8, AR_b), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.cross(AR_i8, AR_f8), npt.NDArray[np.floating[Any]]) +assert_type(np.cross(AR_i8, AR_c16), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.cross(AR_O, AR_O), npt.NDArray[np.object_]) + +assert_type(np.indices([0, 1, 2]), npt.NDArray[np.int_]) +assert_type(np.indices([0, 1, 2], sparse=True), tuple[npt.NDArray[np.int_], ...]) +assert_type(np.indices([0, 1, 2], dtype=np.float64), npt.NDArray[np.float64]) +assert_type(np.indices([0, 1, 2], sparse=True, dtype=np.float64), tuple[npt.NDArray[np.float64], ...]) +assert_type(np.indices([0, 1, 2], dtype=float), npt.NDArray[Any]) +assert_type(np.indices([0, 1, 2], sparse=True, dtype=float), tuple[npt.NDArray[Any], ...]) + +assert_type(np.binary_repr(1), str) + +assert_type(np.base_repr(1), str) + +assert_type(np.allclose(i8, AR_i8), bool) +assert_type(np.allclose(B, AR_i8), bool) +assert_type(np.allclose(AR_i8, AR_i8), bool) + +assert_type(np.isclose(i8, i8), np.bool_) +assert_type(np.isclose(i8, AR_i8), npt.NDArray[np.bool_]) +assert_type(np.isclose(B, AR_i8), npt.NDArray[np.bool_]) +assert_type(np.isclose(AR_i8, AR_i8), npt.NDArray[np.bool_]) + +assert_type(np.array_equal(i8, AR_i8), bool) +assert_type(np.array_equal(B, AR_i8), bool) +assert_type(np.array_equal(AR_i8, AR_i8), bool) + +assert_type(np.array_equiv(i8, AR_i8), bool) +assert_type(np.array_equiv(B, AR_i8), bool) +assert_type(np.array_equiv(AR_i8, AR_i8), bool) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numerictypes.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numerictypes.pyi index d4399e2b12..5d5a7a7af4 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numerictypes.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/numerictypes.pyi @@ -1,40 +1,84 @@ +import sys +from typing import Literal, Any + import numpy as np +from numpy.core.numerictypes import _CastFunc + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type -reveal_type(np.maximum_sctype(np.float64)) # E: Type[{float64}] -reveal_type(np.maximum_sctype("f8")) # E: Type[Any] +assert_type(np.cast[int], _CastFunc) +assert_type(np.cast["i8"], _CastFunc) +assert_type(np.cast[np.int64], _CastFunc) -reveal_type(np.issctype(np.float64)) # E: bool -reveal_type(np.issctype("foo")) # E: Literal[False] +assert_type(np.maximum_sctype(np.float64), type[np.float64]) +assert_type(np.maximum_sctype("f8"), type[Any]) -reveal_type(np.obj2sctype(np.float64)) # E: Union[None, Type[{float64}]] -reveal_type(np.obj2sctype(np.float64, default=False)) # E: Union[builtins.bool, Type[{float64}]] -reveal_type(np.obj2sctype("S8")) # E: Union[None, Type[Any]] -reveal_type(np.obj2sctype("S8", default=None)) # E: Union[None, Type[Any]] -reveal_type(np.obj2sctype("foo", default=False)) # E: Union[builtins.bool, Type[Any]] -reveal_type(np.obj2sctype(1)) # E: None -reveal_type(np.obj2sctype(1, default=False)) # E: bool +assert_type(np.issctype(np.float64), bool) +assert_type(np.issctype("foo"), Literal[False]) -reveal_type(np.issubclass_(np.float64, float)) # E: bool -reveal_type(np.issubclass_(np.float64, (int, float))) # E: bool -reveal_type(np.issubclass_(1, 1)) # E: Literal[False] +assert_type(np.obj2sctype(np.float64), None | type[np.float64]) +assert_type(np.obj2sctype(np.float64, default=False), bool | type[np.float64]) +assert_type(np.obj2sctype("S8"), None | type[Any]) +assert_type(np.obj2sctype("S8", default=None), None | type[Any]) +assert_type(np.obj2sctype("foo", default=False), bool | type[Any]) +assert_type(np.obj2sctype(1), None) +assert_type(np.obj2sctype(1, default=False), bool) -reveal_type(np.sctype2char("S8")) # E: str -reveal_type(np.sctype2char(list)) # E: str +assert_type(np.issubclass_(np.float64, float), bool) +assert_type(np.issubclass_(np.float64, (int, float)), bool) +assert_type(np.issubclass_(1, 1), Literal[False]) -reveal_type(np.cast[int]) # E: _CastFunc -reveal_type(np.cast["i8"]) # E: _CastFunc -reveal_type(np.cast[np.int64]) # E: _CastFunc +assert_type(np.sctype2char("S8"), str) +assert_type(np.sctype2char(list), str) -reveal_type(np.nbytes[int]) # E: int -reveal_type(np.nbytes["i8"]) # E: int -reveal_type(np.nbytes[np.int64]) # E: int +assert_type(np.nbytes[int], int) +assert_type(np.nbytes["i8"], int) +assert_type(np.nbytes[np.int64], int) -reveal_type(np.ScalarType) # E: Tuple -reveal_type(np.ScalarType[0]) # E: Type[builtins.int] -reveal_type(np.ScalarType[3]) # E: Type[builtins.bool] -reveal_type(np.ScalarType[8]) # E: Type[{csingle}] -reveal_type(np.ScalarType[10]) # E: Type[{clongdouble}] +assert_type( + np.ScalarType, + tuple[ + type[int], + type[float], + type[complex], + type[bool], + type[bytes], + type[str], + type[memoryview], + type[np.bool_], + type[np.csingle], + type[np.cdouble], + type[np.clongdouble], + type[np.half], + type[np.single], + type[np.double], + type[np.longdouble], + type[np.byte], + type[np.short], + type[np.intc], + type[np.int_], + type[np.longlong], + type[np.timedelta64], + type[np.datetime64], + type[np.object_], + type[np.bytes_], + type[np.str_], + type[np.ubyte], + type[np.ushort], + type[np.uintc], + type[np.uint], + type[np.ulonglong], + type[np.void], + ], +) +assert_type(np.ScalarType[0], type[int]) +assert_type(np.ScalarType[3], type[bool]) +assert_type(np.ScalarType[8], type[np.csingle]) +assert_type(np.ScalarType[10], type[np.clongdouble]) -reveal_type(np.typecodes["Character"]) # E: Literal['c'] -reveal_type(np.typecodes["Complex"]) # E: Literal['FDG'] -reveal_type(np.typecodes["All"]) # E: Literal['?bhilqpBHILQPefdgFDGSUVOMm'] +assert_type(np.typecodes["Character"], Literal["c"]) +assert_type(np.typecodes["Complex"], Literal["FDG"]) +assert_type(np.typecodes["All"], Literal["?bhilqpBHILQPefdgFDGSUVOMm"]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/random.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/random.pyi index 67a5d3e7aa..4aefc01cf6 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/random.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/random.pyi @@ -1,8 +1,21 @@ -from __future__ import annotations - +import sys +import threading from typing import Any +from collections.abc import Sequence import numpy as np +import numpy.typing as npt +from numpy.random._generator import Generator +from numpy.random._mt19937 import MT19937 +from numpy.random._pcg64 import PCG64 +from numpy.random._sfc64 import SFC64 +from numpy.random._philox import Philox +from numpy.random.bit_generator import SeedSequence, SeedlessSeedSequence + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type def_rng = np.random.default_rng() seed_seq = np.random.SeedSequence() @@ -10,26 +23,26 @@ mt19937 = np.random.MT19937() pcg64 = np.random.PCG64() sfc64 = np.random.SFC64() philox = np.random.Philox() -seedless_seq = np.random.bit_generator.SeedlessSeedSequence() +seedless_seq = SeedlessSeedSequence() -reveal_type(def_rng) # E: random._generator.Generator -reveal_type(mt19937) # E: random._mt19937.MT19937 -reveal_type(pcg64) # E: random._pcg64.PCG64 -reveal_type(sfc64) # E: random._sfc64.SFC64 -reveal_type(philox) # E: random._philox.Philox -reveal_type(seed_seq) # E: random.bit_generator.SeedSequence -reveal_type(seedless_seq) # E: random.bit_generator.SeedlessSeedSequence +assert_type(def_rng, Generator) +assert_type(mt19937, MT19937) +assert_type(pcg64, PCG64) +assert_type(sfc64, SFC64) +assert_type(philox, Philox) +assert_type(seed_seq, SeedSequence) +assert_type(seedless_seq, SeedlessSeedSequence) mt19937_jumped = mt19937.jumped() mt19937_jumped3 = mt19937.jumped(3) mt19937_raw = mt19937.random_raw() mt19937_raw_arr = mt19937.random_raw(5) -reveal_type(mt19937_jumped) # E: random._mt19937.MT19937 -reveal_type(mt19937_jumped3) # E: random._mt19937.MT19937 -reveal_type(mt19937_raw) # E: int -reveal_type(mt19937_raw_arr) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(mt19937.lock) # E: threading.Lock +assert_type(mt19937_jumped, MT19937) +assert_type(mt19937_jumped3, MT19937) +assert_type(mt19937_raw, int) +assert_type(mt19937_raw_arr, npt.NDArray[np.uint64]) +assert_type(mt19937.lock, threading.Lock) pcg64_jumped = pcg64.jumped() pcg64_jumped3 = pcg64.jumped(3) @@ -37,12 +50,12 @@ pcg64_adv = pcg64.advance(3) pcg64_raw = pcg64.random_raw() pcg64_raw_arr = pcg64.random_raw(5) -reveal_type(pcg64_jumped) # E: random._pcg64.PCG64 -reveal_type(pcg64_jumped3) # E: random._pcg64.PCG64 -reveal_type(pcg64_adv) # E: random._pcg64.PCG64 -reveal_type(pcg64_raw) # E: int -reveal_type(pcg64_raw_arr) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(pcg64.lock) # E: threading.Lock +assert_type(pcg64_jumped, PCG64) +assert_type(pcg64_jumped3, PCG64) +assert_type(pcg64_adv, PCG64) +assert_type(pcg64_raw, int) +assert_type(pcg64_raw_arr, npt.NDArray[np.uint64]) +assert_type(pcg64.lock, threading.Lock) philox_jumped = philox.jumped() philox_jumped3 = philox.jumped(3) @@ -50,33 +63,33 @@ philox_adv = philox.advance(3) philox_raw = philox.random_raw() philox_raw_arr = philox.random_raw(5) -reveal_type(philox_jumped) # E: random._philox.Philox -reveal_type(philox_jumped3) # E: random._philox.Philox -reveal_type(philox_adv) # E: random._philox.Philox -reveal_type(philox_raw) # E: int -reveal_type(philox_raw_arr) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(philox.lock) # E: threading.Lock +assert_type(philox_jumped, Philox) +assert_type(philox_jumped3, Philox) +assert_type(philox_adv, Philox) +assert_type(philox_raw, int) +assert_type(philox_raw_arr, npt.NDArray[np.uint64]) +assert_type(philox.lock, threading.Lock) sfc64_raw = sfc64.random_raw() sfc64_raw_arr = sfc64.random_raw(5) -reveal_type(sfc64_raw) # E: int -reveal_type(sfc64_raw_arr) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(sfc64.lock) # E: threading.Lock +assert_type(sfc64_raw, int) +assert_type(sfc64_raw_arr, npt.NDArray[np.uint64]) +assert_type(sfc64.lock, threading.Lock) -reveal_type(seed_seq.pool) # ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(seed_seq.entropy) # E:Union[None, int, Sequence[int]] -reveal_type(seed_seq.spawn(1)) # E: list[random.bit_generator.SeedSequence] -reveal_type(seed_seq.generate_state(8, "uint32")) # E: ndarray[Any, dtype[Union[unsignedinteger[typing._32Bit], unsignedinteger[typing._64Bit]]]] -reveal_type(seed_seq.generate_state(8, "uint64")) # E: ndarray[Any, dtype[Union[unsignedinteger[typing._32Bit], unsignedinteger[typing._64Bit]]]] +assert_type(seed_seq.pool, npt.NDArray[np.uint32]) +assert_type(seed_seq.entropy, None | int | Sequence[int]) +assert_type(seed_seq.spawn(1), list[np.random.SeedSequence]) +assert_type(seed_seq.generate_state(8, "uint32"), npt.NDArray[np.uint32 | np.uint64]) +assert_type(seed_seq.generate_state(8, "uint64"), npt.NDArray[np.uint32 | np.uint64]) def_gen: np.random.Generator = np.random.default_rng() -D_arr_0p1: np.ndarray[Any, np.dtype[np.float64]] = np.array([0.1]) -D_arr_0p5: np.ndarray[Any, np.dtype[np.float64]] = np.array([0.5]) -D_arr_0p9: np.ndarray[Any, np.dtype[np.float64]] = np.array([0.9]) -D_arr_1p5: np.ndarray[Any, np.dtype[np.float64]] = np.array([1.5]) +D_arr_0p1: npt.NDArray[np.float64] = np.array([0.1]) +D_arr_0p5: npt.NDArray[np.float64] = np.array([0.5]) +D_arr_0p9: npt.NDArray[np.float64] = np.array([0.9]) +D_arr_1p5: npt.NDArray[np.float64] = np.array([1.5]) I_arr_10: np.ndarray[Any, np.dtype[np.int_]] = np.array([10], dtype=np.int_) I_arr_20: np.ndarray[Any, np.dtype[np.int_]] = np.array([20], dtype=np.int_) D_arr_like_0p1: list[float] = [0.1] @@ -86,1457 +99,1457 @@ D_arr_like_1p5: list[float] = [1.5] I_arr_like_10: list[int] = [10] I_arr_like_20: list[int] = [20] D_2D_like: list[list[float]] = [[1, 2], [2, 3], [3, 4], [4, 5.1]] -D_2D: np.ndarray[Any, np.dtype[np.float64]] = np.array(D_2D_like) -S_out: np.ndarray[Any, np.dtype[np.float32]] = np.empty(1, dtype=np.float32) -D_out: np.ndarray[Any, np.dtype[np.float64]] = np.empty(1) - -reveal_type(def_gen.standard_normal()) # E: float -reveal_type(def_gen.standard_normal(dtype=np.float32)) # E: float -reveal_type(def_gen.standard_normal(dtype="float32")) # E: float -reveal_type(def_gen.standard_normal(dtype="double")) # E: float -reveal_type(def_gen.standard_normal(dtype=np.float64)) # E: float -reveal_type(def_gen.standard_normal(size=None)) # E: float -reveal_type(def_gen.standard_normal(size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype=np.float32)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype="f4")) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype="float32", out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_normal(dtype=np.float32, out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype=np.float64)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype="float64")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype="f8")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_normal(out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype="float64")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_normal(size=1, dtype="float64", out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(def_gen.random()) # E: float -reveal_type(def_gen.random(dtype=np.float32)) # E: float -reveal_type(def_gen.random(dtype="float32")) # E: float -reveal_type(def_gen.random(dtype="double")) # E: float -reveal_type(def_gen.random(dtype=np.float64)) # E: float -reveal_type(def_gen.random(size=None)) # E: float -reveal_type(def_gen.random(size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.random(size=1, dtype=np.float32)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.random(size=1, dtype="f4")) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.random(size=1, dtype="float32", out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.random(dtype=np.float32, out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.random(size=1, dtype=np.float64)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.random(size=1, dtype="float64")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.random(size=1, dtype="f8")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.random(out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.random(size=1, dtype="float64")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.random(size=1, dtype="float64", out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(def_gen.standard_cauchy()) # E: float -reveal_type(def_gen.standard_cauchy(size=None)) # E: float -reveal_type(def_gen.standard_cauchy(size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.standard_exponential()) # E: float -reveal_type(def_gen.standard_exponential(method="inv")) # E: float -reveal_type(def_gen.standard_exponential(dtype=np.float32)) # E: float -reveal_type(def_gen.standard_exponential(dtype="float32")) # E: float -reveal_type(def_gen.standard_exponential(dtype="double")) # E: float -reveal_type(def_gen.standard_exponential(dtype=np.float64)) # E: float -reveal_type(def_gen.standard_exponential(size=None)) # E: float -reveal_type(def_gen.standard_exponential(size=None, method="inv")) # E: float -reveal_type(def_gen.standard_exponential(size=1, method="inv")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype=np.float32)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype="f4", method="inv")) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype="float32", out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_exponential(dtype=np.float32, out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype=np.float64, method="inv")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype="float64")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype="f8")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_exponential(out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype="float64")) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_exponential(size=1, dtype="float64", out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(def_gen.zipf(1.5)) # E: int -reveal_type(def_gen.zipf(1.5, size=None)) # E: int -reveal_type(def_gen.zipf(1.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.zipf(D_arr_1p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.zipf(D_arr_1p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.zipf(D_arr_like_1p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.zipf(D_arr_like_1p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.weibull(0.5)) # E: float -reveal_type(def_gen.weibull(0.5, size=None)) # E: float -reveal_type(def_gen.weibull(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.weibull(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.weibull(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.weibull(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.weibull(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.standard_t(0.5)) # E: float -reveal_type(def_gen.standard_t(0.5, size=None)) # E: float -reveal_type(def_gen.standard_t(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.standard_t(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.standard_t(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.standard_t(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.standard_t(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.poisson(0.5)) # E: int -reveal_type(def_gen.poisson(0.5, size=None)) # E: int -reveal_type(def_gen.poisson(0.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.poisson(D_arr_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.poisson(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.poisson(D_arr_like_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.poisson(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.power(0.5)) # E: float -reveal_type(def_gen.power(0.5, size=None)) # E: float -reveal_type(def_gen.power(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.power(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.power(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.power(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.power(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.pareto(0.5)) # E: float -reveal_type(def_gen.pareto(0.5, size=None)) # E: float -reveal_type(def_gen.pareto(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.pareto(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.pareto(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.pareto(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.pareto(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.chisquare(0.5)) # E: float -reveal_type(def_gen.chisquare(0.5, size=None)) # E: float -reveal_type(def_gen.chisquare(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.chisquare(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.chisquare(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.chisquare(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.chisquare(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.exponential(0.5)) # E: float -reveal_type(def_gen.exponential(0.5, size=None)) # E: float -reveal_type(def_gen.exponential(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.exponential(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.exponential(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.exponential(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.exponential(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.geometric(0.5)) # E: int -reveal_type(def_gen.geometric(0.5, size=None)) # E: int -reveal_type(def_gen.geometric(0.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.geometric(D_arr_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.geometric(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.geometric(D_arr_like_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.geometric(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.logseries(0.5)) # E: int -reveal_type(def_gen.logseries(0.5, size=None)) # E: int -reveal_type(def_gen.logseries(0.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.logseries(D_arr_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.logseries(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.logseries(D_arr_like_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.logseries(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.rayleigh(0.5)) # E: float -reveal_type(def_gen.rayleigh(0.5, size=None)) # E: float -reveal_type(def_gen.rayleigh(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.rayleigh(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.rayleigh(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.rayleigh(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.rayleigh(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.standard_gamma(0.5)) # E: float -reveal_type(def_gen.standard_gamma(0.5, size=None)) # E: float -reveal_type(def_gen.standard_gamma(0.5, dtype="float32")) # E: float -reveal_type(def_gen.standard_gamma(0.5, size=None, dtype="float32")) # E: float -reveal_type(def_gen.standard_gamma(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_0p5, dtype="f4")) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_gamma(0.5, size=1, dtype="float32", out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_0p5, dtype=np.float32, out=S_out)) # E: ndarray[Any, dtype[floating[typing._32Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(0.5, out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_like_0p5, out=D_out)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(def_gen.standard_gamma(D_arr_like_0p5, size=1, out=D_out, dtype=np.float64)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(def_gen.vonmises(0.5, 0.5)) # E: float -reveal_type(def_gen.vonmises(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.vonmises(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.vonmises(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.wald(0.5, 0.5)) # E: float -reveal_type(def_gen.wald(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.wald(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.wald(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.uniform(0.5, 0.5)) # E: float -reveal_type(def_gen.uniform(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.uniform(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.uniform(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.beta(0.5, 0.5)) # E: float -reveal_type(def_gen.beta(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.beta(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.beta(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.f(0.5, 0.5)) # E: float -reveal_type(def_gen.f(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.f(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.f(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.gamma(0.5, 0.5)) # E: float -reveal_type(def_gen.gamma(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.gamma(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gamma(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.gumbel(0.5, 0.5)) # E: float -reveal_type(def_gen.gumbel(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.gumbel(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.gumbel(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.laplace(0.5, 0.5)) # E: float -reveal_type(def_gen.laplace(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.laplace(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.laplace(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.logistic(0.5, 0.5)) # E: float -reveal_type(def_gen.logistic(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.logistic(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.logistic(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.lognormal(0.5, 0.5)) # E: float -reveal_type(def_gen.lognormal(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.lognormal(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.lognormal(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.noncentral_chisquare(0.5, 0.5)) # E: float -reveal_type(def_gen.noncentral_chisquare(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.noncentral_chisquare(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.normal(0.5, 0.5)) # E: float -reveal_type(def_gen.normal(0.5, 0.5, size=None)) # E: float -reveal_type(def_gen.normal(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.normal(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.triangular(0.1, 0.5, 0.9)) # E: float -reveal_type(def_gen.triangular(0.1, 0.5, 0.9, size=None)) # E: float -reveal_type(def_gen.triangular(0.1, 0.5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(D_arr_0p1, 0.5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(0.1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(0.1, D_arr_0p5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(D_arr_like_0p1, 0.5, D_arr_0p9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(0.5, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(D_arr_0p1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(D_arr_like_0p1, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.triangular(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.noncentral_f(0.1, 0.5, 0.9)) # E: float -reveal_type(def_gen.noncentral_f(0.1, 0.5, 0.9, size=None)) # E: float -reveal_type(def_gen.noncentral_f(0.1, 0.5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(D_arr_0p1, 0.5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(0.1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(0.1, D_arr_0p5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(D_arr_like_0p1, 0.5, D_arr_0p9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(0.5, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(D_arr_0p1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.binomial(10, 0.5)) # E: int -reveal_type(def_gen.binomial(10, 0.5, size=None)) # E: int -reveal_type(def_gen.binomial(10, 0.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(I_arr_10, 0.5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(10, D_arr_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(I_arr_10, 0.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(I_arr_like_10, 0.5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(10, D_arr_like_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(I_arr_10, D_arr_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(I_arr_like_10, D_arr_like_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(I_arr_10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.binomial(I_arr_like_10, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.negative_binomial(10, 0.5)) # E: int -reveal_type(def_gen.negative_binomial(10, 0.5, size=None)) # E: int -reveal_type(def_gen.negative_binomial(10, 0.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(I_arr_10, 0.5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(10, D_arr_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(I_arr_10, 0.5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(I_arr_like_10, 0.5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(10, D_arr_like_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(I_arr_10, D_arr_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(I_arr_like_10, D_arr_like_0p5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(I_arr_10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.negative_binomial(I_arr_like_10, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.hypergeometric(20, 20, 10)) # E: int -reveal_type(def_gen.hypergeometric(20, 20, 10, size=None)) # E: int -reveal_type(def_gen.hypergeometric(20, 20, 10, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(I_arr_20, 20, 10)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(20, I_arr_20, 10)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(I_arr_20, 20, I_arr_like_10, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(20, I_arr_20, 10, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(I_arr_like_20, 20, I_arr_10)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(20, I_arr_like_20, 10)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(I_arr_20, I_arr_20, 10)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(I_arr_like_20, I_arr_like_20, 10)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(I_arr_20, I_arr_20, I_arr_10, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.hypergeometric(I_arr_like_20, I_arr_like_20, I_arr_like_10, size=1)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] +D_2D: npt.NDArray[np.float64] = np.array(D_2D_like) +S_out: npt.NDArray[np.float32] = np.empty(1, dtype=np.float32) +D_out: npt.NDArray[np.float64] = np.empty(1) + +assert_type(def_gen.standard_normal(), float) +assert_type(def_gen.standard_normal(dtype=np.float32), float) +assert_type(def_gen.standard_normal(dtype="float32"), float) +assert_type(def_gen.standard_normal(dtype="double"), float) +assert_type(def_gen.standard_normal(dtype=np.float64), float) +assert_type(def_gen.standard_normal(size=None), float) +assert_type(def_gen.standard_normal(size=1), npt.NDArray[np.float64]) +assert_type(def_gen.standard_normal(size=1, dtype=np.float32), npt.NDArray[np.float32]) +assert_type(def_gen.standard_normal(size=1, dtype="f4"), npt.NDArray[np.float32]) +assert_type(def_gen.standard_normal(size=1, dtype="float32", out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.standard_normal(dtype=np.float32, out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.standard_normal(size=1, dtype=np.float64), npt.NDArray[np.float64]) +assert_type(def_gen.standard_normal(size=1, dtype="float64"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_normal(size=1, dtype="f8"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_normal(out=D_out), npt.NDArray[np.float64]) +assert_type(def_gen.standard_normal(size=1, dtype="float64"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_normal(size=1, dtype="float64", out=D_out), npt.NDArray[np.float64]) + +assert_type(def_gen.random(), float) +assert_type(def_gen.random(dtype=np.float32), float) +assert_type(def_gen.random(dtype="float32"), float) +assert_type(def_gen.random(dtype="double"), float) +assert_type(def_gen.random(dtype=np.float64), float) +assert_type(def_gen.random(size=None), float) +assert_type(def_gen.random(size=1), npt.NDArray[np.float64]) +assert_type(def_gen.random(size=1, dtype=np.float32), npt.NDArray[np.float32]) +assert_type(def_gen.random(size=1, dtype="f4"), npt.NDArray[np.float32]) +assert_type(def_gen.random(size=1, dtype="float32", out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.random(dtype=np.float32, out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.random(size=1, dtype=np.float64), npt.NDArray[np.float64]) +assert_type(def_gen.random(size=1, dtype="float64"), npt.NDArray[np.float64]) +assert_type(def_gen.random(size=1, dtype="f8"), npt.NDArray[np.float64]) +assert_type(def_gen.random(out=D_out), npt.NDArray[np.float64]) +assert_type(def_gen.random(size=1, dtype="float64"), npt.NDArray[np.float64]) +assert_type(def_gen.random(size=1, dtype="float64", out=D_out), npt.NDArray[np.float64]) + +assert_type(def_gen.standard_cauchy(), float) +assert_type(def_gen.standard_cauchy(size=None), float) +assert_type(def_gen.standard_cauchy(size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.standard_exponential(), float) +assert_type(def_gen.standard_exponential(method="inv"), float) +assert_type(def_gen.standard_exponential(dtype=np.float32), float) +assert_type(def_gen.standard_exponential(dtype="float32"), float) +assert_type(def_gen.standard_exponential(dtype="double"), float) +assert_type(def_gen.standard_exponential(dtype=np.float64), float) +assert_type(def_gen.standard_exponential(size=None), float) +assert_type(def_gen.standard_exponential(size=None, method="inv"), float) +assert_type(def_gen.standard_exponential(size=1, method="inv"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_exponential(size=1, dtype=np.float32), npt.NDArray[np.float32]) +assert_type(def_gen.standard_exponential(size=1, dtype="f4", method="inv"), npt.NDArray[np.float32]) +assert_type(def_gen.standard_exponential(size=1, dtype="float32", out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.standard_exponential(dtype=np.float32, out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.standard_exponential(size=1, dtype=np.float64, method="inv"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_exponential(size=1, dtype="float64"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_exponential(size=1, dtype="f8"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_exponential(out=D_out), npt.NDArray[np.float64]) +assert_type(def_gen.standard_exponential(size=1, dtype="float64"), npt.NDArray[np.float64]) +assert_type(def_gen.standard_exponential(size=1, dtype="float64", out=D_out), npt.NDArray[np.float64]) + +assert_type(def_gen.zipf(1.5), int) +assert_type(def_gen.zipf(1.5, size=None), int) +assert_type(def_gen.zipf(1.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.zipf(D_arr_1p5), npt.NDArray[np.int64]) +assert_type(def_gen.zipf(D_arr_1p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.zipf(D_arr_like_1p5), npt.NDArray[np.int64]) +assert_type(def_gen.zipf(D_arr_like_1p5, size=1), npt.NDArray[np.int64]) + +assert_type(def_gen.weibull(0.5), float) +assert_type(def_gen.weibull(0.5, size=None), float) +assert_type(def_gen.weibull(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.weibull(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.weibull(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.weibull(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.weibull(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.standard_t(0.5), float) +assert_type(def_gen.standard_t(0.5, size=None), float) +assert_type(def_gen.standard_t(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.standard_t(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.standard_t(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.standard_t(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.standard_t(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.poisson(0.5), int) +assert_type(def_gen.poisson(0.5, size=None), int) +assert_type(def_gen.poisson(0.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.poisson(D_arr_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.poisson(D_arr_0p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.poisson(D_arr_like_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.poisson(D_arr_like_0p5, size=1), npt.NDArray[np.int64]) + +assert_type(def_gen.power(0.5), float) +assert_type(def_gen.power(0.5, size=None), float) +assert_type(def_gen.power(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.power(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.power(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.power(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.power(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.pareto(0.5), float) +assert_type(def_gen.pareto(0.5, size=None), float) +assert_type(def_gen.pareto(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.pareto(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.pareto(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.pareto(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.pareto(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.chisquare(0.5), float) +assert_type(def_gen.chisquare(0.5, size=None), float) +assert_type(def_gen.chisquare(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.chisquare(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.chisquare(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.chisquare(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.chisquare(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.exponential(0.5), float) +assert_type(def_gen.exponential(0.5, size=None), float) +assert_type(def_gen.exponential(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.exponential(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.exponential(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.exponential(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.exponential(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.geometric(0.5), int) +assert_type(def_gen.geometric(0.5, size=None), int) +assert_type(def_gen.geometric(0.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.geometric(D_arr_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.geometric(D_arr_0p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.geometric(D_arr_like_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.geometric(D_arr_like_0p5, size=1), npt.NDArray[np.int64]) + +assert_type(def_gen.logseries(0.5), int) +assert_type(def_gen.logseries(0.5, size=None), int) +assert_type(def_gen.logseries(0.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.logseries(D_arr_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.logseries(D_arr_0p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.logseries(D_arr_like_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.logseries(D_arr_like_0p5, size=1), npt.NDArray[np.int64]) + +assert_type(def_gen.rayleigh(0.5), float) +assert_type(def_gen.rayleigh(0.5, size=None), float) +assert_type(def_gen.rayleigh(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.rayleigh(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.rayleigh(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.rayleigh(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.rayleigh(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.standard_gamma(0.5), float) +assert_type(def_gen.standard_gamma(0.5, size=None), float) +assert_type(def_gen.standard_gamma(0.5, dtype="float32"), float) +assert_type(def_gen.standard_gamma(0.5, size=None, dtype="float32"), float) +assert_type(def_gen.standard_gamma(0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(D_arr_0p5, dtype="f4"), npt.NDArray[np.float32]) +assert_type(def_gen.standard_gamma(0.5, size=1, dtype="float32", out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.standard_gamma(D_arr_0p5, dtype=np.float32, out=S_out), npt.NDArray[np.float32]) +assert_type(def_gen.standard_gamma(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(0.5, out=D_out), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(D_arr_like_0p5, out=D_out), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.standard_gamma(D_arr_like_0p5, size=1, out=D_out, dtype=np.float64), npt.NDArray[np.float64]) + +assert_type(def_gen.vonmises(0.5, 0.5), float) +assert_type(def_gen.vonmises(0.5, 0.5, size=None), float) +assert_type(def_gen.vonmises(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.vonmises(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.wald(0.5, 0.5), float) +assert_type(def_gen.wald(0.5, 0.5, size=None), float) +assert_type(def_gen.wald(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.wald(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.wald(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.wald(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.wald(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.wald(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.wald(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.wald(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.wald(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.wald(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.wald(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.uniform(0.5, 0.5), float) +assert_type(def_gen.uniform(0.5, 0.5, size=None), float) +assert_type(def_gen.uniform(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.uniform(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.beta(0.5, 0.5), float) +assert_type(def_gen.beta(0.5, 0.5, size=None), float) +assert_type(def_gen.beta(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.beta(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.beta(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.beta(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.beta(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.beta(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.beta(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.beta(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.beta(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.beta(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.beta(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.f(0.5, 0.5), float) +assert_type(def_gen.f(0.5, 0.5, size=None), float) +assert_type(def_gen.f(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.f(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.f(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.f(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.f(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.f(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.f(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.f(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.f(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.f(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.f(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.gamma(0.5, 0.5), float) +assert_type(def_gen.gamma(0.5, 0.5, size=None), float) +assert_type(def_gen.gamma(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gamma(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.gumbel(0.5, 0.5), float) +assert_type(def_gen.gumbel(0.5, 0.5, size=None), float) +assert_type(def_gen.gumbel(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.gumbel(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.laplace(0.5, 0.5), float) +assert_type(def_gen.laplace(0.5, 0.5, size=None), float) +assert_type(def_gen.laplace(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.laplace(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.logistic(0.5, 0.5), float) +assert_type(def_gen.logistic(0.5, 0.5, size=None), float) +assert_type(def_gen.logistic(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.logistic(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.lognormal(0.5, 0.5), float) +assert_type(def_gen.lognormal(0.5, 0.5, size=None), float) +assert_type(def_gen.lognormal(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.lognormal(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.noncentral_chisquare(0.5, 0.5), float) +assert_type(def_gen.noncentral_chisquare(0.5, 0.5, size=None), float) +assert_type(def_gen.noncentral_chisquare(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.normal(0.5, 0.5), float) +assert_type(def_gen.normal(0.5, 0.5, size=None), float) +assert_type(def_gen.normal(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.normal(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.normal(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.normal(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.normal(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.normal(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(def_gen.normal(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.normal(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.normal(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(def_gen.normal(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.normal(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.triangular(0.1, 0.5, 0.9), float) +assert_type(def_gen.triangular(0.1, 0.5, 0.9, size=None), float) +assert_type(def_gen.triangular(0.1, 0.5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(D_arr_0p1, 0.5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(0.1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(D_arr_0p1, 0.5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(0.1, D_arr_0p5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(D_arr_like_0p1, 0.5, D_arr_0p9), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(0.5, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(D_arr_0p1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(D_arr_like_0p1, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.triangular(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.noncentral_f(0.1, 0.5, 0.9), float) +assert_type(def_gen.noncentral_f(0.1, 0.5, 0.9, size=None), float) +assert_type(def_gen.noncentral_f(0.1, 0.5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(D_arr_0p1, 0.5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(0.1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(D_arr_0p1, 0.5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(0.1, D_arr_0p5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(D_arr_like_0p1, 0.5, D_arr_0p9), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(0.5, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(D_arr_0p1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1), npt.NDArray[np.float64]) +assert_type(def_gen.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) + +assert_type(def_gen.binomial(10, 0.5), int) +assert_type(def_gen.binomial(10, 0.5, size=None), int) +assert_type(def_gen.binomial(10, 0.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(I_arr_10, 0.5), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(10, D_arr_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(I_arr_10, 0.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(10, D_arr_0p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(I_arr_like_10, 0.5), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(10, D_arr_like_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(I_arr_10, D_arr_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(I_arr_like_10, D_arr_like_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(I_arr_10, D_arr_0p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.binomial(I_arr_like_10, D_arr_like_0p5, size=1), npt.NDArray[np.int64]) + +assert_type(def_gen.negative_binomial(10, 0.5), int) +assert_type(def_gen.negative_binomial(10, 0.5, size=None), int) +assert_type(def_gen.negative_binomial(10, 0.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(I_arr_10, 0.5), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(10, D_arr_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(I_arr_10, 0.5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(10, D_arr_0p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(I_arr_like_10, 0.5), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(10, D_arr_like_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(I_arr_10, D_arr_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(I_arr_like_10, D_arr_like_0p5), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(I_arr_10, D_arr_0p5, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.negative_binomial(I_arr_like_10, D_arr_like_0p5, size=1), npt.NDArray[np.int64]) + +assert_type(def_gen.hypergeometric(20, 20, 10), int) +assert_type(def_gen.hypergeometric(20, 20, 10, size=None), int) +assert_type(def_gen.hypergeometric(20, 20, 10, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(I_arr_20, 20, 10), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(20, I_arr_20, 10), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(I_arr_20, 20, I_arr_like_10, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(20, I_arr_20, 10, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(I_arr_like_20, 20, I_arr_10), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(20, I_arr_like_20, 10), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(I_arr_20, I_arr_20, 10), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(I_arr_like_20, I_arr_like_20, 10), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(I_arr_20, I_arr_20, I_arr_10, size=1), npt.NDArray[np.int64]) +assert_type(def_gen.hypergeometric(I_arr_like_20, I_arr_like_20, I_arr_like_10, size=1), npt.NDArray[np.int64]) I_int64_100: np.ndarray[Any, np.dtype[np.int64]] = np.array([100], dtype=np.int64) -reveal_type(def_gen.integers(0, 100)) # E: int -reveal_type(def_gen.integers(100)) # E: int -reveal_type(def_gen.integers([100])) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(0, [100])) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] +assert_type(def_gen.integers(0, 100), int) +assert_type(def_gen.integers(100), int) +assert_type(def_gen.integers([100]), npt.NDArray[np.int64]) +assert_type(def_gen.integers(0, [100]), npt.NDArray[np.int64]) -I_bool_low: np.ndarray[Any, np.dtype[np.bool_]] = np.array([0], dtype=np.bool_) +I_bool_low: npt.NDArray[np.bool_] = np.array([0], dtype=np.bool_) I_bool_low_like: list[int] = [0] -I_bool_high_open: np.ndarray[Any, np.dtype[np.bool_]] = np.array([1], dtype=np.bool_) -I_bool_high_closed: np.ndarray[Any, np.dtype[np.bool_]] = np.array([1], dtype=np.bool_) - -reveal_type(def_gen.integers(2, dtype=bool)) # E: builtins.bool -reveal_type(def_gen.integers(0, 2, dtype=bool)) # E: builtins.bool -reveal_type(def_gen.integers(1, dtype=bool, endpoint=True)) # E: builtins.bool -reveal_type(def_gen.integers(0, 1, dtype=bool, endpoint=True)) # E: builtins.bool -reveal_type(def_gen.integers(I_bool_low_like, 1, dtype=bool, endpoint=True)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_high_open, dtype=bool)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_low, I_bool_high_open, dtype=bool)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(0, I_bool_high_open, dtype=bool)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_high_closed, dtype=bool, endpoint=True)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_low, I_bool_high_closed, dtype=bool, endpoint=True)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(0, I_bool_high_closed, dtype=bool, endpoint=True)) # E: ndarray[Any, dtype[bool_] - -reveal_type(def_gen.integers(2, dtype=np.bool_)) # E: builtins.bool -reveal_type(def_gen.integers(0, 2, dtype=np.bool_)) # E: builtins.bool -reveal_type(def_gen.integers(1, dtype=np.bool_, endpoint=True)) # E: builtins.bool -reveal_type(def_gen.integers(0, 1, dtype=np.bool_, endpoint=True)) # E: builtins.bool -reveal_type(def_gen.integers(I_bool_low_like, 1, dtype=np.bool_, endpoint=True)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_high_open, dtype=np.bool_)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_low, I_bool_high_open, dtype=np.bool_)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(0, I_bool_high_open, dtype=np.bool_)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_high_closed, dtype=np.bool_, endpoint=True)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(I_bool_low, I_bool_high_closed, dtype=np.bool_, endpoint=True)) # E: ndarray[Any, dtype[bool_] -reveal_type(def_gen.integers(0, I_bool_high_closed, dtype=np.bool_, endpoint=True)) # E: ndarray[Any, dtype[bool_] +I_bool_high_open: npt.NDArray[np.bool_] = np.array([1], dtype=np.bool_) +I_bool_high_closed: npt.NDArray[np.bool_] = np.array([1], dtype=np.bool_) + +assert_type(def_gen.integers(2, dtype=bool), bool) +assert_type(def_gen.integers(0, 2, dtype=bool), bool) +assert_type(def_gen.integers(1, dtype=bool, endpoint=True), bool) +assert_type(def_gen.integers(0, 1, dtype=bool, endpoint=True), bool) +assert_type(def_gen.integers(I_bool_low_like, 1, dtype=bool, endpoint=True), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_high_open, dtype=bool), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_low, I_bool_high_open, dtype=bool), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(0, I_bool_high_open, dtype=bool), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_high_closed, dtype=bool, endpoint=True), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_low, I_bool_high_closed, dtype=bool, endpoint=True), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(0, I_bool_high_closed, dtype=bool, endpoint=True), npt.NDArray[np.bool_]) + +assert_type(def_gen.integers(2, dtype=np.bool_), bool) +assert_type(def_gen.integers(0, 2, dtype=np.bool_), bool) +assert_type(def_gen.integers(1, dtype=np.bool_, endpoint=True), bool) +assert_type(def_gen.integers(0, 1, dtype=np.bool_, endpoint=True), bool) +assert_type(def_gen.integers(I_bool_low_like, 1, dtype=np.bool_, endpoint=True), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_high_open, dtype=np.bool_), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_low, I_bool_high_open, dtype=np.bool_), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(0, I_bool_high_open, dtype=np.bool_), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_high_closed, dtype=np.bool_, endpoint=True), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(I_bool_low, I_bool_high_closed, dtype=np.bool_, endpoint=True), npt.NDArray[np.bool_]) +assert_type(def_gen.integers(0, I_bool_high_closed, dtype=np.bool_, endpoint=True), npt.NDArray[np.bool_]) I_u1_low: np.ndarray[Any, np.dtype[np.uint8]] = np.array([0], dtype=np.uint8) I_u1_low_like: list[int] = [0] I_u1_high_open: np.ndarray[Any, np.dtype[np.uint8]] = np.array([255], dtype=np.uint8) I_u1_high_closed: np.ndarray[Any, np.dtype[np.uint8]] = np.array([255], dtype=np.uint8) -reveal_type(def_gen.integers(256, dtype="u1")) # E: int -reveal_type(def_gen.integers(0, 256, dtype="u1")) # E: int -reveal_type(def_gen.integers(255, dtype="u1", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 255, dtype="u1", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u1_low_like, 255, dtype="u1", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_high_open, dtype="u1")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_low, I_u1_high_open, dtype="u1")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(0, I_u1_high_open, dtype="u1")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_high_closed, dtype="u1", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_low, I_u1_high_closed, dtype="u1", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(0, I_u1_high_closed, dtype="u1", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] - -reveal_type(def_gen.integers(256, dtype="uint8")) # E: int -reveal_type(def_gen.integers(0, 256, dtype="uint8")) # E: int -reveal_type(def_gen.integers(255, dtype="uint8", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 255, dtype="uint8", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u1_low_like, 255, dtype="uint8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_high_open, dtype="uint8")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_low, I_u1_high_open, dtype="uint8")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(0, I_u1_high_open, dtype="uint8")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_high_closed, dtype="uint8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_low, I_u1_high_closed, dtype="uint8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(0, I_u1_high_closed, dtype="uint8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] - -reveal_type(def_gen.integers(256, dtype=np.uint8)) # E: int -reveal_type(def_gen.integers(0, 256, dtype=np.uint8)) # E: int -reveal_type(def_gen.integers(255, dtype=np.uint8, endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 255, dtype=np.uint8, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u1_low_like, 255, dtype=np.uint8, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_high_open, dtype=np.uint8)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_low, I_u1_high_open, dtype=np.uint8)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(0, I_u1_high_open, dtype=np.uint8)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_high_closed, dtype=np.uint8, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_u1_low, I_u1_high_closed, dtype=np.uint8, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(0, I_u1_high_closed, dtype=np.uint8, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] +assert_type(def_gen.integers(256, dtype="u1"), int) +assert_type(def_gen.integers(0, 256, dtype="u1"), int) +assert_type(def_gen.integers(255, dtype="u1", endpoint=True), int) +assert_type(def_gen.integers(0, 255, dtype="u1", endpoint=True), int) +assert_type(def_gen.integers(I_u1_low_like, 255, dtype="u1", endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_high_open, dtype="u1"), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_low, I_u1_high_open, dtype="u1"), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(0, I_u1_high_open, dtype="u1"), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_high_closed, dtype="u1", endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_low, I_u1_high_closed, dtype="u1", endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(0, I_u1_high_closed, dtype="u1", endpoint=True), npt.NDArray[np.uint8]) + +assert_type(def_gen.integers(256, dtype="uint8"), int) +assert_type(def_gen.integers(0, 256, dtype="uint8"), int) +assert_type(def_gen.integers(255, dtype="uint8", endpoint=True), int) +assert_type(def_gen.integers(0, 255, dtype="uint8", endpoint=True), int) +assert_type(def_gen.integers(I_u1_low_like, 255, dtype="uint8", endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_high_open, dtype="uint8"), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_low, I_u1_high_open, dtype="uint8"), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(0, I_u1_high_open, dtype="uint8"), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_high_closed, dtype="uint8", endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_low, I_u1_high_closed, dtype="uint8", endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(0, I_u1_high_closed, dtype="uint8", endpoint=True), npt.NDArray[np.uint8]) + +assert_type(def_gen.integers(256, dtype=np.uint8), int) +assert_type(def_gen.integers(0, 256, dtype=np.uint8), int) +assert_type(def_gen.integers(255, dtype=np.uint8, endpoint=True), int) +assert_type(def_gen.integers(0, 255, dtype=np.uint8, endpoint=True), int) +assert_type(def_gen.integers(I_u1_low_like, 255, dtype=np.uint8, endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_high_open, dtype=np.uint8), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_low, I_u1_high_open, dtype=np.uint8), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(0, I_u1_high_open, dtype=np.uint8), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_high_closed, dtype=np.uint8, endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(I_u1_low, I_u1_high_closed, dtype=np.uint8, endpoint=True), npt.NDArray[np.uint8]) +assert_type(def_gen.integers(0, I_u1_high_closed, dtype=np.uint8, endpoint=True), npt.NDArray[np.uint8]) I_u2_low: np.ndarray[Any, np.dtype[np.uint16]] = np.array([0], dtype=np.uint16) I_u2_low_like: list[int] = [0] I_u2_high_open: np.ndarray[Any, np.dtype[np.uint16]] = np.array([65535], dtype=np.uint16) I_u2_high_closed: np.ndarray[Any, np.dtype[np.uint16]] = np.array([65535], dtype=np.uint16) -reveal_type(def_gen.integers(65536, dtype="u2")) # E: int -reveal_type(def_gen.integers(0, 65536, dtype="u2")) # E: int -reveal_type(def_gen.integers(65535, dtype="u2", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 65535, dtype="u2", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u2_low_like, 65535, dtype="u2", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_high_open, dtype="u2")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_low, I_u2_high_open, dtype="u2")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(0, I_u2_high_open, dtype="u2")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_high_closed, dtype="u2", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_low, I_u2_high_closed, dtype="u2", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(0, I_u2_high_closed, dtype="u2", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] - -reveal_type(def_gen.integers(65536, dtype="uint16")) # E: int -reveal_type(def_gen.integers(0, 65536, dtype="uint16")) # E: int -reveal_type(def_gen.integers(65535, dtype="uint16", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 65535, dtype="uint16", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u2_low_like, 65535, dtype="uint16", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_high_open, dtype="uint16")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_low, I_u2_high_open, dtype="uint16")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(0, I_u2_high_open, dtype="uint16")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_high_closed, dtype="uint16", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_low, I_u2_high_closed, dtype="uint16", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(0, I_u2_high_closed, dtype="uint16", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] - -reveal_type(def_gen.integers(65536, dtype=np.uint16)) # E: int -reveal_type(def_gen.integers(0, 65536, dtype=np.uint16)) # E: int -reveal_type(def_gen.integers(65535, dtype=np.uint16, endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 65535, dtype=np.uint16, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u2_low_like, 65535, dtype=np.uint16, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_high_open, dtype=np.uint16)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_low, I_u2_high_open, dtype=np.uint16)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(0, I_u2_high_open, dtype=np.uint16)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_high_closed, dtype=np.uint16, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_u2_low, I_u2_high_closed, dtype=np.uint16, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(0, I_u2_high_closed, dtype=np.uint16, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] +assert_type(def_gen.integers(65536, dtype="u2"), int) +assert_type(def_gen.integers(0, 65536, dtype="u2"), int) +assert_type(def_gen.integers(65535, dtype="u2", endpoint=True), int) +assert_type(def_gen.integers(0, 65535, dtype="u2", endpoint=True), int) +assert_type(def_gen.integers(I_u2_low_like, 65535, dtype="u2", endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_high_open, dtype="u2"), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_low, I_u2_high_open, dtype="u2"), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(0, I_u2_high_open, dtype="u2"), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_high_closed, dtype="u2", endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_low, I_u2_high_closed, dtype="u2", endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(0, I_u2_high_closed, dtype="u2", endpoint=True), npt.NDArray[np.uint16]) + +assert_type(def_gen.integers(65536, dtype="uint16"), int) +assert_type(def_gen.integers(0, 65536, dtype="uint16"), int) +assert_type(def_gen.integers(65535, dtype="uint16", endpoint=True), int) +assert_type(def_gen.integers(0, 65535, dtype="uint16", endpoint=True), int) +assert_type(def_gen.integers(I_u2_low_like, 65535, dtype="uint16", endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_high_open, dtype="uint16"), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_low, I_u2_high_open, dtype="uint16"), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(0, I_u2_high_open, dtype="uint16"), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_high_closed, dtype="uint16", endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_low, I_u2_high_closed, dtype="uint16", endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(0, I_u2_high_closed, dtype="uint16", endpoint=True), npt.NDArray[np.uint16]) + +assert_type(def_gen.integers(65536, dtype=np.uint16), int) +assert_type(def_gen.integers(0, 65536, dtype=np.uint16), int) +assert_type(def_gen.integers(65535, dtype=np.uint16, endpoint=True), int) +assert_type(def_gen.integers(0, 65535, dtype=np.uint16, endpoint=True), int) +assert_type(def_gen.integers(I_u2_low_like, 65535, dtype=np.uint16, endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_high_open, dtype=np.uint16), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_low, I_u2_high_open, dtype=np.uint16), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(0, I_u2_high_open, dtype=np.uint16), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_high_closed, dtype=np.uint16, endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(I_u2_low, I_u2_high_closed, dtype=np.uint16, endpoint=True), npt.NDArray[np.uint16]) +assert_type(def_gen.integers(0, I_u2_high_closed, dtype=np.uint16, endpoint=True), npt.NDArray[np.uint16]) I_u4_low: np.ndarray[Any, np.dtype[np.uint32]] = np.array([0], dtype=np.uint32) I_u4_low_like: list[int] = [0] I_u4_high_open: np.ndarray[Any, np.dtype[np.uint32]] = np.array([4294967295], dtype=np.uint32) I_u4_high_closed: np.ndarray[Any, np.dtype[np.uint32]] = np.array([4294967295], dtype=np.uint32) -reveal_type(def_gen.integers(4294967296, dtype=np.int_)) # E: int -reveal_type(def_gen.integers(0, 4294967296, dtype=np.int_)) # E: int -reveal_type(def_gen.integers(4294967295, dtype=np.int_, endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 4294967295, dtype=np.int_, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u4_low_like, 4294967295, dtype=np.int_, endpoint=True)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(def_gen.integers(I_u4_high_open, dtype=np.int_)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype=np.int_)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(def_gen.integers(0, I_u4_high_open, dtype=np.int_)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(def_gen.integers(I_u4_high_closed, dtype=np.int_, endpoint=True)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype=np.int_, endpoint=True)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(def_gen.integers(0, I_u4_high_closed, dtype=np.int_, endpoint=True)) # E: ndarray[Any, dtype[{int_}]] - - -reveal_type(def_gen.integers(4294967296, dtype="u4")) # E: int -reveal_type(def_gen.integers(0, 4294967296, dtype="u4")) # E: int -reveal_type(def_gen.integers(4294967295, dtype="u4", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 4294967295, dtype="u4", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u4_low_like, 4294967295, dtype="u4", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_high_open, dtype="u4")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype="u4")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(0, I_u4_high_open, dtype="u4")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_high_closed, dtype="u4", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype="u4", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(0, I_u4_high_closed, dtype="u4", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] - -reveal_type(def_gen.integers(4294967296, dtype="uint32")) # E: int -reveal_type(def_gen.integers(0, 4294967296, dtype="uint32")) # E: int -reveal_type(def_gen.integers(4294967295, dtype="uint32", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 4294967295, dtype="uint32", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u4_low_like, 4294967295, dtype="uint32", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_high_open, dtype="uint32")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype="uint32")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(0, I_u4_high_open, dtype="uint32")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_high_closed, dtype="uint32", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype="uint32", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(0, I_u4_high_closed, dtype="uint32", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] - -reveal_type(def_gen.integers(4294967296, dtype=np.uint32)) # E: int -reveal_type(def_gen.integers(0, 4294967296, dtype=np.uint32)) # E: int -reveal_type(def_gen.integers(4294967295, dtype=np.uint32, endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 4294967295, dtype=np.uint32, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u4_low_like, 4294967295, dtype=np.uint32, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_high_open, dtype=np.uint32)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype=np.uint32)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(0, I_u4_high_open, dtype=np.uint32)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_high_closed, dtype=np.uint32, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype=np.uint32, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(0, I_u4_high_closed, dtype=np.uint32, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] - -reveal_type(def_gen.integers(4294967296, dtype=np.uint)) # E: int -reveal_type(def_gen.integers(0, 4294967296, dtype=np.uint)) # E: int -reveal_type(def_gen.integers(4294967295, dtype=np.uint, endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 4294967295, dtype=np.uint, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u4_low_like, 4294967295, dtype=np.uint, endpoint=True)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(def_gen.integers(I_u4_high_open, dtype=np.uint)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype=np.uint)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(def_gen.integers(0, I_u4_high_open, dtype=np.uint)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(def_gen.integers(I_u4_high_closed, dtype=np.uint, endpoint=True)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype=np.uint, endpoint=True)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(def_gen.integers(0, I_u4_high_closed, dtype=np.uint, endpoint=True)) # E: ndarray[Any, dtype[{uint}]] +assert_type(def_gen.integers(4294967296, dtype=np.int_), int) +assert_type(def_gen.integers(0, 4294967296, dtype=np.int_), int) +assert_type(def_gen.integers(4294967295, dtype=np.int_, endpoint=True), int) +assert_type(def_gen.integers(0, 4294967295, dtype=np.int_, endpoint=True), int) +assert_type(def_gen.integers(I_u4_low_like, 4294967295, dtype=np.int_, endpoint=True), npt.NDArray[np.int_]) +assert_type(def_gen.integers(I_u4_high_open, dtype=np.int_), npt.NDArray[np.int_]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype=np.int_), npt.NDArray[np.int_]) +assert_type(def_gen.integers(0, I_u4_high_open, dtype=np.int_), npt.NDArray[np.int_]) +assert_type(def_gen.integers(I_u4_high_closed, dtype=np.int_, endpoint=True), npt.NDArray[np.int_]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype=np.int_, endpoint=True), npt.NDArray[np.int_]) +assert_type(def_gen.integers(0, I_u4_high_closed, dtype=np.int_, endpoint=True), npt.NDArray[np.int_]) + + +assert_type(def_gen.integers(4294967296, dtype="u4"), int) +assert_type(def_gen.integers(0, 4294967296, dtype="u4"), int) +assert_type(def_gen.integers(4294967295, dtype="u4", endpoint=True), int) +assert_type(def_gen.integers(0, 4294967295, dtype="u4", endpoint=True), int) +assert_type(def_gen.integers(I_u4_low_like, 4294967295, dtype="u4", endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_high_open, dtype="u4"), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype="u4"), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(0, I_u4_high_open, dtype="u4"), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_high_closed, dtype="u4", endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype="u4", endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(0, I_u4_high_closed, dtype="u4", endpoint=True), npt.NDArray[np.uint32]) + +assert_type(def_gen.integers(4294967296, dtype="uint32"), int) +assert_type(def_gen.integers(0, 4294967296, dtype="uint32"), int) +assert_type(def_gen.integers(4294967295, dtype="uint32", endpoint=True), int) +assert_type(def_gen.integers(0, 4294967295, dtype="uint32", endpoint=True), int) +assert_type(def_gen.integers(I_u4_low_like, 4294967295, dtype="uint32", endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_high_open, dtype="uint32"), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype="uint32"), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(0, I_u4_high_open, dtype="uint32"), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_high_closed, dtype="uint32", endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype="uint32", endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(0, I_u4_high_closed, dtype="uint32", endpoint=True), npt.NDArray[np.uint32]) + +assert_type(def_gen.integers(4294967296, dtype=np.uint32), int) +assert_type(def_gen.integers(0, 4294967296, dtype=np.uint32), int) +assert_type(def_gen.integers(4294967295, dtype=np.uint32, endpoint=True), int) +assert_type(def_gen.integers(0, 4294967295, dtype=np.uint32, endpoint=True), int) +assert_type(def_gen.integers(I_u4_low_like, 4294967295, dtype=np.uint32, endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_high_open, dtype=np.uint32), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype=np.uint32), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(0, I_u4_high_open, dtype=np.uint32), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_high_closed, dtype=np.uint32, endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype=np.uint32, endpoint=True), npt.NDArray[np.uint32]) +assert_type(def_gen.integers(0, I_u4_high_closed, dtype=np.uint32, endpoint=True), npt.NDArray[np.uint32]) + +assert_type(def_gen.integers(4294967296, dtype=np.uint), int) +assert_type(def_gen.integers(0, 4294967296, dtype=np.uint), int) +assert_type(def_gen.integers(4294967295, dtype=np.uint, endpoint=True), int) +assert_type(def_gen.integers(0, 4294967295, dtype=np.uint, endpoint=True), int) +assert_type(def_gen.integers(I_u4_low_like, 4294967295, dtype=np.uint, endpoint=True), npt.NDArray[np.uint]) +assert_type(def_gen.integers(I_u4_high_open, dtype=np.uint), npt.NDArray[np.uint]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_open, dtype=np.uint), npt.NDArray[np.uint]) +assert_type(def_gen.integers(0, I_u4_high_open, dtype=np.uint), npt.NDArray[np.uint]) +assert_type(def_gen.integers(I_u4_high_closed, dtype=np.uint, endpoint=True), npt.NDArray[np.uint]) +assert_type(def_gen.integers(I_u4_low, I_u4_high_closed, dtype=np.uint, endpoint=True), npt.NDArray[np.uint]) +assert_type(def_gen.integers(0, I_u4_high_closed, dtype=np.uint, endpoint=True), npt.NDArray[np.uint]) I_u8_low: np.ndarray[Any, np.dtype[np.uint64]] = np.array([0], dtype=np.uint64) I_u8_low_like: list[int] = [0] I_u8_high_open: np.ndarray[Any, np.dtype[np.uint64]] = np.array([18446744073709551615], dtype=np.uint64) I_u8_high_closed: np.ndarray[Any, np.dtype[np.uint64]] = np.array([18446744073709551615], dtype=np.uint64) -reveal_type(def_gen.integers(18446744073709551616, dtype="u8")) # E: int -reveal_type(def_gen.integers(0, 18446744073709551616, dtype="u8")) # E: int -reveal_type(def_gen.integers(18446744073709551615, dtype="u8", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 18446744073709551615, dtype="u8", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u8_low_like, 18446744073709551615, dtype="u8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_high_open, dtype="u8")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_low, I_u8_high_open, dtype="u8")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(0, I_u8_high_open, dtype="u8")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_high_closed, dtype="u8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_low, I_u8_high_closed, dtype="u8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(0, I_u8_high_closed, dtype="u8", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] - -reveal_type(def_gen.integers(18446744073709551616, dtype="uint64")) # E: int -reveal_type(def_gen.integers(0, 18446744073709551616, dtype="uint64")) # E: int -reveal_type(def_gen.integers(18446744073709551615, dtype="uint64", endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 18446744073709551615, dtype="uint64", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u8_low_like, 18446744073709551615, dtype="uint64", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_high_open, dtype="uint64")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_low, I_u8_high_open, dtype="uint64")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(0, I_u8_high_open, dtype="uint64")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_high_closed, dtype="uint64", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_low, I_u8_high_closed, dtype="uint64", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(0, I_u8_high_closed, dtype="uint64", endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] - -reveal_type(def_gen.integers(18446744073709551616, dtype=np.uint64)) # E: int -reveal_type(def_gen.integers(0, 18446744073709551616, dtype=np.uint64)) # E: int -reveal_type(def_gen.integers(18446744073709551615, dtype=np.uint64, endpoint=True)) # E: int -reveal_type(def_gen.integers(0, 18446744073709551615, dtype=np.uint64, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_u8_low_like, 18446744073709551615, dtype=np.uint64, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_high_open, dtype=np.uint64)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_low, I_u8_high_open, dtype=np.uint64)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(0, I_u8_high_open, dtype=np.uint64)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_high_closed, dtype=np.uint64, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_u8_low, I_u8_high_closed, dtype=np.uint64, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(0, I_u8_high_closed, dtype=np.uint64, endpoint=True)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] +assert_type(def_gen.integers(18446744073709551616, dtype="u8"), int) +assert_type(def_gen.integers(0, 18446744073709551616, dtype="u8"), int) +assert_type(def_gen.integers(18446744073709551615, dtype="u8", endpoint=True), int) +assert_type(def_gen.integers(0, 18446744073709551615, dtype="u8", endpoint=True), int) +assert_type(def_gen.integers(I_u8_low_like, 18446744073709551615, dtype="u8", endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_high_open, dtype="u8"), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_low, I_u8_high_open, dtype="u8"), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(0, I_u8_high_open, dtype="u8"), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_high_closed, dtype="u8", endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_low, I_u8_high_closed, dtype="u8", endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(0, I_u8_high_closed, dtype="u8", endpoint=True), npt.NDArray[np.uint64]) + +assert_type(def_gen.integers(18446744073709551616, dtype="uint64"), int) +assert_type(def_gen.integers(0, 18446744073709551616, dtype="uint64"), int) +assert_type(def_gen.integers(18446744073709551615, dtype="uint64", endpoint=True), int) +assert_type(def_gen.integers(0, 18446744073709551615, dtype="uint64", endpoint=True), int) +assert_type(def_gen.integers(I_u8_low_like, 18446744073709551615, dtype="uint64", endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_high_open, dtype="uint64"), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_low, I_u8_high_open, dtype="uint64"), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(0, I_u8_high_open, dtype="uint64"), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_high_closed, dtype="uint64", endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_low, I_u8_high_closed, dtype="uint64", endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(0, I_u8_high_closed, dtype="uint64", endpoint=True), npt.NDArray[np.uint64]) + +assert_type(def_gen.integers(18446744073709551616, dtype=np.uint64), int) +assert_type(def_gen.integers(0, 18446744073709551616, dtype=np.uint64), int) +assert_type(def_gen.integers(18446744073709551615, dtype=np.uint64, endpoint=True), int) +assert_type(def_gen.integers(0, 18446744073709551615, dtype=np.uint64, endpoint=True), int) +assert_type(def_gen.integers(I_u8_low_like, 18446744073709551615, dtype=np.uint64, endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_high_open, dtype=np.uint64), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_low, I_u8_high_open, dtype=np.uint64), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(0, I_u8_high_open, dtype=np.uint64), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_high_closed, dtype=np.uint64, endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(I_u8_low, I_u8_high_closed, dtype=np.uint64, endpoint=True), npt.NDArray[np.uint64]) +assert_type(def_gen.integers(0, I_u8_high_closed, dtype=np.uint64, endpoint=True), npt.NDArray[np.uint64]) I_i1_low: np.ndarray[Any, np.dtype[np.int8]] = np.array([-128], dtype=np.int8) I_i1_low_like: list[int] = [-128] I_i1_high_open: np.ndarray[Any, np.dtype[np.int8]] = np.array([127], dtype=np.int8) I_i1_high_closed: np.ndarray[Any, np.dtype[np.int8]] = np.array([127], dtype=np.int8) -reveal_type(def_gen.integers(128, dtype="i1")) # E: int -reveal_type(def_gen.integers(-128, 128, dtype="i1")) # E: int -reveal_type(def_gen.integers(127, dtype="i1", endpoint=True)) # E: int -reveal_type(def_gen.integers(-128, 127, dtype="i1", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i1_low_like, 127, dtype="i1", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_high_open, dtype="i1")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_low, I_i1_high_open, dtype="i1")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(-128, I_i1_high_open, dtype="i1")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_high_closed, dtype="i1", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_low, I_i1_high_closed, dtype="i1", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(-128, I_i1_high_closed, dtype="i1", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] - -reveal_type(def_gen.integers(128, dtype="int8")) # E: int -reveal_type(def_gen.integers(-128, 128, dtype="int8")) # E: int -reveal_type(def_gen.integers(127, dtype="int8", endpoint=True)) # E: int -reveal_type(def_gen.integers(-128, 127, dtype="int8", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i1_low_like, 127, dtype="int8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_high_open, dtype="int8")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_low, I_i1_high_open, dtype="int8")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(-128, I_i1_high_open, dtype="int8")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_high_closed, dtype="int8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_low, I_i1_high_closed, dtype="int8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(-128, I_i1_high_closed, dtype="int8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] - -reveal_type(def_gen.integers(128, dtype=np.int8)) # E: int -reveal_type(def_gen.integers(-128, 128, dtype=np.int8)) # E: int -reveal_type(def_gen.integers(127, dtype=np.int8, endpoint=True)) # E: int -reveal_type(def_gen.integers(-128, 127, dtype=np.int8, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i1_low_like, 127, dtype=np.int8, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_high_open, dtype=np.int8)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_low, I_i1_high_open, dtype=np.int8)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(-128, I_i1_high_open, dtype=np.int8)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_high_closed, dtype=np.int8, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(I_i1_low, I_i1_high_closed, dtype=np.int8, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(def_gen.integers(-128, I_i1_high_closed, dtype=np.int8, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] - -I_i2_low: np.ndarray[Any, np.dtype[np.int16]] = np.array([-32768], dtype=np.int16) +assert_type(def_gen.integers(128, dtype="i1"), int) +assert_type(def_gen.integers(-128, 128, dtype="i1"), int) +assert_type(def_gen.integers(127, dtype="i1", endpoint=True), int) +assert_type(def_gen.integers(-128, 127, dtype="i1", endpoint=True), int) +assert_type(def_gen.integers(I_i1_low_like, 127, dtype="i1", endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_high_open, dtype="i1"), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_low, I_i1_high_open, dtype="i1"), npt.NDArray[np.int8]) +assert_type(def_gen.integers(-128, I_i1_high_open, dtype="i1"), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_high_closed, dtype="i1", endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_low, I_i1_high_closed, dtype="i1", endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(-128, I_i1_high_closed, dtype="i1", endpoint=True), npt.NDArray[np.int8]) + +assert_type(def_gen.integers(128, dtype="int8"), int) +assert_type(def_gen.integers(-128, 128, dtype="int8"), int) +assert_type(def_gen.integers(127, dtype="int8", endpoint=True), int) +assert_type(def_gen.integers(-128, 127, dtype="int8", endpoint=True), int) +assert_type(def_gen.integers(I_i1_low_like, 127, dtype="int8", endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_high_open, dtype="int8"), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_low, I_i1_high_open, dtype="int8"), npt.NDArray[np.int8]) +assert_type(def_gen.integers(-128, I_i1_high_open, dtype="int8"), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_high_closed, dtype="int8", endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_low, I_i1_high_closed, dtype="int8", endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(-128, I_i1_high_closed, dtype="int8", endpoint=True), npt.NDArray[np.int8]) + +assert_type(def_gen.integers(128, dtype=np.int8), int) +assert_type(def_gen.integers(-128, 128, dtype=np.int8), int) +assert_type(def_gen.integers(127, dtype=np.int8, endpoint=True), int) +assert_type(def_gen.integers(-128, 127, dtype=np.int8, endpoint=True), int) +assert_type(def_gen.integers(I_i1_low_like, 127, dtype=np.int8, endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_high_open, dtype=np.int8), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_low, I_i1_high_open, dtype=np.int8), npt.NDArray[np.int8]) +assert_type(def_gen.integers(-128, I_i1_high_open, dtype=np.int8), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_high_closed, dtype=np.int8, endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(I_i1_low, I_i1_high_closed, dtype=np.int8, endpoint=True), npt.NDArray[np.int8]) +assert_type(def_gen.integers(-128, I_i1_high_closed, dtype=np.int8, endpoint=True), npt.NDArray[np.int8]) + +I_i2_low: npt.NDArray[np.int16] = np.array([-32768], dtype=np.int16) I_i2_low_like: list[int] = [-32768] -I_i2_high_open: np.ndarray[Any, np.dtype[np.int16]] = np.array([32767], dtype=np.int16) -I_i2_high_closed: np.ndarray[Any, np.dtype[np.int16]] = np.array([32767], dtype=np.int16) - -reveal_type(def_gen.integers(32768, dtype="i2")) # E: int -reveal_type(def_gen.integers(-32768, 32768, dtype="i2")) # E: int -reveal_type(def_gen.integers(32767, dtype="i2", endpoint=True)) # E: int -reveal_type(def_gen.integers(-32768, 32767, dtype="i2", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i2_low_like, 32767, dtype="i2", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_high_open, dtype="i2")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_low, I_i2_high_open, dtype="i2")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(-32768, I_i2_high_open, dtype="i2")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_high_closed, dtype="i2", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_low, I_i2_high_closed, dtype="i2", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(-32768, I_i2_high_closed, dtype="i2", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] - -reveal_type(def_gen.integers(32768, dtype="int16")) # E: int -reveal_type(def_gen.integers(-32768, 32768, dtype="int16")) # E: int -reveal_type(def_gen.integers(32767, dtype="int16", endpoint=True)) # E: int -reveal_type(def_gen.integers(-32768, 32767, dtype="int16", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i2_low_like, 32767, dtype="int16", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_high_open, dtype="int16")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_low, I_i2_high_open, dtype="int16")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(-32768, I_i2_high_open, dtype="int16")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_high_closed, dtype="int16", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_low, I_i2_high_closed, dtype="int16", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(-32768, I_i2_high_closed, dtype="int16", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] - -reveal_type(def_gen.integers(32768, dtype=np.int16)) # E: int -reveal_type(def_gen.integers(-32768, 32768, dtype=np.int16)) # E: int -reveal_type(def_gen.integers(32767, dtype=np.int16, endpoint=True)) # E: int -reveal_type(def_gen.integers(-32768, 32767, dtype=np.int16, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i2_low_like, 32767, dtype=np.int16, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_high_open, dtype=np.int16)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_low, I_i2_high_open, dtype=np.int16)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(-32768, I_i2_high_open, dtype=np.int16)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_high_closed, dtype=np.int16, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(I_i2_low, I_i2_high_closed, dtype=np.int16, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(def_gen.integers(-32768, I_i2_high_closed, dtype=np.int16, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] +I_i2_high_open: npt.NDArray[np.int16] = np.array([32767], dtype=np.int16) +I_i2_high_closed: npt.NDArray[np.int16] = np.array([32767], dtype=np.int16) + +assert_type(def_gen.integers(32768, dtype="i2"), int) +assert_type(def_gen.integers(-32768, 32768, dtype="i2"), int) +assert_type(def_gen.integers(32767, dtype="i2", endpoint=True), int) +assert_type(def_gen.integers(-32768, 32767, dtype="i2", endpoint=True), int) +assert_type(def_gen.integers(I_i2_low_like, 32767, dtype="i2", endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_high_open, dtype="i2"), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_low, I_i2_high_open, dtype="i2"), npt.NDArray[np.int16]) +assert_type(def_gen.integers(-32768, I_i2_high_open, dtype="i2"), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_high_closed, dtype="i2", endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_low, I_i2_high_closed, dtype="i2", endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(-32768, I_i2_high_closed, dtype="i2", endpoint=True), npt.NDArray[np.int16]) + +assert_type(def_gen.integers(32768, dtype="int16"), int) +assert_type(def_gen.integers(-32768, 32768, dtype="int16"), int) +assert_type(def_gen.integers(32767, dtype="int16", endpoint=True), int) +assert_type(def_gen.integers(-32768, 32767, dtype="int16", endpoint=True), int) +assert_type(def_gen.integers(I_i2_low_like, 32767, dtype="int16", endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_high_open, dtype="int16"), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_low, I_i2_high_open, dtype="int16"), npt.NDArray[np.int16]) +assert_type(def_gen.integers(-32768, I_i2_high_open, dtype="int16"), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_high_closed, dtype="int16", endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_low, I_i2_high_closed, dtype="int16", endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(-32768, I_i2_high_closed, dtype="int16", endpoint=True), npt.NDArray[np.int16]) + +assert_type(def_gen.integers(32768, dtype=np.int16), int) +assert_type(def_gen.integers(-32768, 32768, dtype=np.int16), int) +assert_type(def_gen.integers(32767, dtype=np.int16, endpoint=True), int) +assert_type(def_gen.integers(-32768, 32767, dtype=np.int16, endpoint=True), int) +assert_type(def_gen.integers(I_i2_low_like, 32767, dtype=np.int16, endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_high_open, dtype=np.int16), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_low, I_i2_high_open, dtype=np.int16), npt.NDArray[np.int16]) +assert_type(def_gen.integers(-32768, I_i2_high_open, dtype=np.int16), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_high_closed, dtype=np.int16, endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(I_i2_low, I_i2_high_closed, dtype=np.int16, endpoint=True), npt.NDArray[np.int16]) +assert_type(def_gen.integers(-32768, I_i2_high_closed, dtype=np.int16, endpoint=True), npt.NDArray[np.int16]) I_i4_low: np.ndarray[Any, np.dtype[np.int32]] = np.array([-2147483648], dtype=np.int32) I_i4_low_like: list[int] = [-2147483648] I_i4_high_open: np.ndarray[Any, np.dtype[np.int32]] = np.array([2147483647], dtype=np.int32) I_i4_high_closed: np.ndarray[Any, np.dtype[np.int32]] = np.array([2147483647], dtype=np.int32) -reveal_type(def_gen.integers(2147483648, dtype="i4")) # E: int -reveal_type(def_gen.integers(-2147483648, 2147483648, dtype="i4")) # E: int -reveal_type(def_gen.integers(2147483647, dtype="i4", endpoint=True)) # E: int -reveal_type(def_gen.integers(-2147483648, 2147483647, dtype="i4", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i4_low_like, 2147483647, dtype="i4", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_high_open, dtype="i4")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_low, I_i4_high_open, dtype="i4")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(-2147483648, I_i4_high_open, dtype="i4")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_high_closed, dtype="i4", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_low, I_i4_high_closed, dtype="i4", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(-2147483648, I_i4_high_closed, dtype="i4", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] - -reveal_type(def_gen.integers(2147483648, dtype="int32")) # E: int -reveal_type(def_gen.integers(-2147483648, 2147483648, dtype="int32")) # E: int -reveal_type(def_gen.integers(2147483647, dtype="int32", endpoint=True)) # E: int -reveal_type(def_gen.integers(-2147483648, 2147483647, dtype="int32", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i4_low_like, 2147483647, dtype="int32", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_high_open, dtype="int32")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_low, I_i4_high_open, dtype="int32")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(-2147483648, I_i4_high_open, dtype="int32")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_high_closed, dtype="int32", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_low, I_i4_high_closed, dtype="int32", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(-2147483648, I_i4_high_closed, dtype="int32", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] - -reveal_type(def_gen.integers(2147483648, dtype=np.int32)) # E: int -reveal_type(def_gen.integers(-2147483648, 2147483648, dtype=np.int32)) # E: int -reveal_type(def_gen.integers(2147483647, dtype=np.int32, endpoint=True)) # E: int -reveal_type(def_gen.integers(-2147483648, 2147483647, dtype=np.int32, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i4_low_like, 2147483647, dtype=np.int32, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_high_open, dtype=np.int32)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_low, I_i4_high_open, dtype=np.int32)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(-2147483648, I_i4_high_open, dtype=np.int32)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_high_closed, dtype=np.int32, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(I_i4_low, I_i4_high_closed, dtype=np.int32, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(def_gen.integers(-2147483648, I_i4_high_closed, dtype=np.int32, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] +assert_type(def_gen.integers(2147483648, dtype="i4"), int) +assert_type(def_gen.integers(-2147483648, 2147483648, dtype="i4"), int) +assert_type(def_gen.integers(2147483647, dtype="i4", endpoint=True), int) +assert_type(def_gen.integers(-2147483648, 2147483647, dtype="i4", endpoint=True), int) +assert_type(def_gen.integers(I_i4_low_like, 2147483647, dtype="i4", endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_high_open, dtype="i4"), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_low, I_i4_high_open, dtype="i4"), npt.NDArray[np.int32]) +assert_type(def_gen.integers(-2147483648, I_i4_high_open, dtype="i4"), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_high_closed, dtype="i4", endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_low, I_i4_high_closed, dtype="i4", endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(-2147483648, I_i4_high_closed, dtype="i4", endpoint=True), npt.NDArray[np.int32]) + +assert_type(def_gen.integers(2147483648, dtype="int32"), int) +assert_type(def_gen.integers(-2147483648, 2147483648, dtype="int32"), int) +assert_type(def_gen.integers(2147483647, dtype="int32", endpoint=True), int) +assert_type(def_gen.integers(-2147483648, 2147483647, dtype="int32", endpoint=True), int) +assert_type(def_gen.integers(I_i4_low_like, 2147483647, dtype="int32", endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_high_open, dtype="int32"), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_low, I_i4_high_open, dtype="int32"), npt.NDArray[np.int32]) +assert_type(def_gen.integers(-2147483648, I_i4_high_open, dtype="int32"), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_high_closed, dtype="int32", endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_low, I_i4_high_closed, dtype="int32", endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(-2147483648, I_i4_high_closed, dtype="int32", endpoint=True), npt.NDArray[np.int32]) + +assert_type(def_gen.integers(2147483648, dtype=np.int32), int) +assert_type(def_gen.integers(-2147483648, 2147483648, dtype=np.int32), int) +assert_type(def_gen.integers(2147483647, dtype=np.int32, endpoint=True), int) +assert_type(def_gen.integers(-2147483648, 2147483647, dtype=np.int32, endpoint=True), int) +assert_type(def_gen.integers(I_i4_low_like, 2147483647, dtype=np.int32, endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_high_open, dtype=np.int32), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_low, I_i4_high_open, dtype=np.int32), npt.NDArray[np.int32]) +assert_type(def_gen.integers(-2147483648, I_i4_high_open, dtype=np.int32), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_high_closed, dtype=np.int32, endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(I_i4_low, I_i4_high_closed, dtype=np.int32, endpoint=True), npt.NDArray[np.int32]) +assert_type(def_gen.integers(-2147483648, I_i4_high_closed, dtype=np.int32, endpoint=True), npt.NDArray[np.int32]) I_i8_low: np.ndarray[Any, np.dtype[np.int64]] = np.array([-9223372036854775808], dtype=np.int64) I_i8_low_like: list[int] = [-9223372036854775808] I_i8_high_open: np.ndarray[Any, np.dtype[np.int64]] = np.array([9223372036854775807], dtype=np.int64) I_i8_high_closed: np.ndarray[Any, np.dtype[np.int64]] = np.array([9223372036854775807], dtype=np.int64) -reveal_type(def_gen.integers(9223372036854775808, dtype="i8")) # E: int -reveal_type(def_gen.integers(-9223372036854775808, 9223372036854775808, dtype="i8")) # E: int -reveal_type(def_gen.integers(9223372036854775807, dtype="i8", endpoint=True)) # E: int -reveal_type(def_gen.integers(-9223372036854775808, 9223372036854775807, dtype="i8", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i8_low_like, 9223372036854775807, dtype="i8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_high_open, dtype="i8")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_low, I_i8_high_open, dtype="i8")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(-9223372036854775808, I_i8_high_open, dtype="i8")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_high_closed, dtype="i8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_low, I_i8_high_closed, dtype="i8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype="i8", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.integers(9223372036854775808, dtype="int64")) # E: int -reveal_type(def_gen.integers(-9223372036854775808, 9223372036854775808, dtype="int64")) # E: int -reveal_type(def_gen.integers(9223372036854775807, dtype="int64", endpoint=True)) # E: int -reveal_type(def_gen.integers(-9223372036854775808, 9223372036854775807, dtype="int64", endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i8_low_like, 9223372036854775807, dtype="int64", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_high_open, dtype="int64")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_low, I_i8_high_open, dtype="int64")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(-9223372036854775808, I_i8_high_open, dtype="int64")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_high_closed, dtype="int64", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_low, I_i8_high_closed, dtype="int64", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype="int64", endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.integers(9223372036854775808, dtype=np.int64)) # E: int -reveal_type(def_gen.integers(-9223372036854775808, 9223372036854775808, dtype=np.int64)) # E: int -reveal_type(def_gen.integers(9223372036854775807, dtype=np.int64, endpoint=True)) # E: int -reveal_type(def_gen.integers(-9223372036854775808, 9223372036854775807, dtype=np.int64, endpoint=True)) # E: int -reveal_type(def_gen.integers(I_i8_low_like, 9223372036854775807, dtype=np.int64, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_high_open, dtype=np.int64)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_low, I_i8_high_open, dtype=np.int64)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(-9223372036854775808, I_i8_high_open, dtype=np.int64)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_high_closed, dtype=np.int64, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(I_i8_low, I_i8_high_closed, dtype=np.int64, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype=np.int64, endpoint=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - - -reveal_type(def_gen.bit_generator) # E: BitGenerator - -reveal_type(def_gen.bytes(2)) # E: bytes - -reveal_type(def_gen.choice(5)) # E: int -reveal_type(def_gen.choice(5, 3)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.choice(5, 3, replace=True)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.choice(5, 3, p=[1 / 5] * 5)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.choice(5, 3, p=[1 / 5] * 5, replace=False)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"])) # E: Any -reveal_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3)) # E: ndarray[Any, Any] -reveal_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, p=[1 / 4] * 4)) # E: ndarray[Any, Any] -reveal_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=True)) # E: ndarray[Any, Any] -reveal_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=False, p=np.array([1 / 8, 1 / 8, 1 / 2, 1 / 4]))) # E: ndarray[Any, Any] - -reveal_type(def_gen.dirichlet([0.5, 0.5])) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.dirichlet(np.array([0.5, 0.5]))) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.dirichlet(np.array([0.5, 0.5]), size=3)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.multinomial(20, [1 / 6.0] * 6)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multinomial(20, np.array([0.5, 0.5]))) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multinomial(20, [1 / 6.0] * 6, size=2)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multinomial([[10], [20]], [1 / 6.0] * 6, size=(2, 2))) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multinomial(np.array([[10], [20]]), np.array([0.5, 0.5]), size=(2, 2))) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.multivariate_hypergeometric([3, 5, 7], 2)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, size=4)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, size=(4, 7))) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multivariate_hypergeometric([3, 5, 7], 2, method="count")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, method="marginals")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(def_gen.multivariate_normal([0.0], [[1.0]])) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.multivariate_normal([0.0], np.array([[1.0]]))) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.multivariate_normal(np.array([0.0]), [[1.0]])) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(def_gen.multivariate_normal([0.0], np.array([[1.0]]))) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(def_gen.permutation(10)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(def_gen.permutation([1, 2, 3, 4])) # E: ndarray[Any, Any] -reveal_type(def_gen.permutation(np.array([1, 2, 3, 4]))) # E: ndarray[Any, Any] -reveal_type(def_gen.permutation(D_2D, axis=1)) # E: ndarray[Any, Any] -reveal_type(def_gen.permuted(D_2D)) # E: ndarray[Any, Any] -reveal_type(def_gen.permuted(D_2D_like)) # E: ndarray[Any, Any] -reveal_type(def_gen.permuted(D_2D, axis=1)) # E: ndarray[Any, Any] -reveal_type(def_gen.permuted(D_2D, out=D_2D)) # E: ndarray[Any, Any] -reveal_type(def_gen.permuted(D_2D_like, out=D_2D)) # E: ndarray[Any, Any] -reveal_type(def_gen.permuted(D_2D_like, out=D_2D)) # E: ndarray[Any, Any] -reveal_type(def_gen.permuted(D_2D, axis=1, out=D_2D)) # E: ndarray[Any, Any] - -reveal_type(def_gen.shuffle(np.arange(10))) # E: None -reveal_type(def_gen.shuffle([1, 2, 3, 4, 5])) # E: None -reveal_type(def_gen.shuffle(D_2D, axis=1)) # E: None - -reveal_type(np.random.Generator(pcg64)) # E: Generator -reveal_type(def_gen.__str__()) # E: str -reveal_type(def_gen.__repr__()) # E: str +assert_type(def_gen.integers(9223372036854775808, dtype="i8"), int) +assert_type(def_gen.integers(-9223372036854775808, 9223372036854775808, dtype="i8"), int) +assert_type(def_gen.integers(9223372036854775807, dtype="i8", endpoint=True), int) +assert_type(def_gen.integers(-9223372036854775808, 9223372036854775807, dtype="i8", endpoint=True), int) +assert_type(def_gen.integers(I_i8_low_like, 9223372036854775807, dtype="i8", endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_high_open, dtype="i8"), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_low, I_i8_high_open, dtype="i8"), npt.NDArray[np.int64]) +assert_type(def_gen.integers(-9223372036854775808, I_i8_high_open, dtype="i8"), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_high_closed, dtype="i8", endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_low, I_i8_high_closed, dtype="i8", endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype="i8", endpoint=True), npt.NDArray[np.int64]) + +assert_type(def_gen.integers(9223372036854775808, dtype="int64"), int) +assert_type(def_gen.integers(-9223372036854775808, 9223372036854775808, dtype="int64"), int) +assert_type(def_gen.integers(9223372036854775807, dtype="int64", endpoint=True), int) +assert_type(def_gen.integers(-9223372036854775808, 9223372036854775807, dtype="int64", endpoint=True), int) +assert_type(def_gen.integers(I_i8_low_like, 9223372036854775807, dtype="int64", endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_high_open, dtype="int64"), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_low, I_i8_high_open, dtype="int64"), npt.NDArray[np.int64]) +assert_type(def_gen.integers(-9223372036854775808, I_i8_high_open, dtype="int64"), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_high_closed, dtype="int64", endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_low, I_i8_high_closed, dtype="int64", endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype="int64", endpoint=True), npt.NDArray[np.int64]) + +assert_type(def_gen.integers(9223372036854775808, dtype=np.int64), int) +assert_type(def_gen.integers(-9223372036854775808, 9223372036854775808, dtype=np.int64), int) +assert_type(def_gen.integers(9223372036854775807, dtype=np.int64, endpoint=True), int) +assert_type(def_gen.integers(-9223372036854775808, 9223372036854775807, dtype=np.int64, endpoint=True), int) +assert_type(def_gen.integers(I_i8_low_like, 9223372036854775807, dtype=np.int64, endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_high_open, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_low, I_i8_high_open, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(def_gen.integers(-9223372036854775808, I_i8_high_open, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_high_closed, dtype=np.int64, endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(I_i8_low, I_i8_high_closed, dtype=np.int64, endpoint=True), npt.NDArray[np.int64]) +assert_type(def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype=np.int64, endpoint=True), npt.NDArray[np.int64]) + + +assert_type(def_gen.bit_generator, np.random.BitGenerator) + +assert_type(def_gen.bytes(2), bytes) + +assert_type(def_gen.choice(5), int) +assert_type(def_gen.choice(5, 3), npt.NDArray[np.int64]) +assert_type(def_gen.choice(5, 3, replace=True), npt.NDArray[np.int64]) +assert_type(def_gen.choice(5, 3, p=[1 / 5] * 5), npt.NDArray[np.int64]) +assert_type(def_gen.choice(5, 3, p=[1 / 5] * 5, replace=False), npt.NDArray[np.int64]) + +assert_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"]), Any) +assert_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3), np.ndarray[Any, Any]) +assert_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, p=[1 / 4] * 4), np.ndarray[Any, Any]) +assert_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=True), np.ndarray[Any, Any]) +assert_type(def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=False, p=np.array([1 / 8, 1 / 8, 1 / 2, 1 / 4])), np.ndarray[Any, Any]) + +assert_type(def_gen.dirichlet([0.5, 0.5]), npt.NDArray[np.float64]) +assert_type(def_gen.dirichlet(np.array([0.5, 0.5])), npt.NDArray[np.float64]) +assert_type(def_gen.dirichlet(np.array([0.5, 0.5]), size=3), npt.NDArray[np.float64]) + +assert_type(def_gen.multinomial(20, [1 / 6.0] * 6), npt.NDArray[np.int64]) +assert_type(def_gen.multinomial(20, np.array([0.5, 0.5])), npt.NDArray[np.int64]) +assert_type(def_gen.multinomial(20, [1 / 6.0] * 6, size=2), npt.NDArray[np.int64]) +assert_type(def_gen.multinomial([[10], [20]], [1 / 6.0] * 6, size=(2, 2)), npt.NDArray[np.int64]) +assert_type(def_gen.multinomial(np.array([[10], [20]]), np.array([0.5, 0.5]), size=(2, 2)), npt.NDArray[np.int64]) + +assert_type(def_gen.multivariate_hypergeometric([3, 5, 7], 2), npt.NDArray[np.int64]) +assert_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2), npt.NDArray[np.int64]) +assert_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, size=4), npt.NDArray[np.int64]) +assert_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, size=(4, 7)), npt.NDArray[np.int64]) +assert_type(def_gen.multivariate_hypergeometric([3, 5, 7], 2, method="count"), npt.NDArray[np.int64]) +assert_type(def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, method="marginals"), npt.NDArray[np.int64]) + +assert_type(def_gen.multivariate_normal([0.0], [[1.0]]), npt.NDArray[np.float64]) +assert_type(def_gen.multivariate_normal([0.0], np.array([[1.0]])), npt.NDArray[np.float64]) +assert_type(def_gen.multivariate_normal(np.array([0.0]), [[1.0]]), npt.NDArray[np.float64]) +assert_type(def_gen.multivariate_normal([0.0], np.array([[1.0]])), npt.NDArray[np.float64]) + +assert_type(def_gen.permutation(10), npt.NDArray[np.int64]) +assert_type(def_gen.permutation([1, 2, 3, 4]), np.ndarray[Any, Any]) +assert_type(def_gen.permutation(np.array([1, 2, 3, 4])), np.ndarray[Any, Any]) +assert_type(def_gen.permutation(D_2D, axis=1), np.ndarray[Any, Any]) +assert_type(def_gen.permuted(D_2D), np.ndarray[Any, Any]) +assert_type(def_gen.permuted(D_2D_like), np.ndarray[Any, Any]) +assert_type(def_gen.permuted(D_2D, axis=1), np.ndarray[Any, Any]) +assert_type(def_gen.permuted(D_2D, out=D_2D), np.ndarray[Any, Any]) +assert_type(def_gen.permuted(D_2D_like, out=D_2D), np.ndarray[Any, Any]) +assert_type(def_gen.permuted(D_2D_like, out=D_2D), np.ndarray[Any, Any]) +assert_type(def_gen.permuted(D_2D, axis=1, out=D_2D), np.ndarray[Any, Any]) + +assert_type(def_gen.shuffle(np.arange(10)), None) +assert_type(def_gen.shuffle([1, 2, 3, 4, 5]), None) +assert_type(def_gen.shuffle(D_2D, axis=1), None) + +assert_type(np.random.Generator(pcg64), np.random.Generator) +assert_type(def_gen.__str__(), str) +assert_type(def_gen.__repr__(), str) def_gen_state = def_gen.__getstate__() -reveal_type(def_gen_state) # E: builtins.dict[builtins.str, Any] -reveal_type(def_gen.__setstate__(def_gen_state)) # E: None +assert_type(def_gen_state, dict[str, Any]) +assert_type(def_gen.__setstate__(def_gen_state), None) # RandomState random_st: np.random.RandomState = np.random.RandomState() -reveal_type(random_st.standard_normal()) # E: float -reveal_type(random_st.standard_normal(size=None)) # E: float -reveal_type(random_st.standard_normal(size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(random_st.random()) # E: float -reveal_type(random_st.random(size=None)) # E: float -reveal_type(random_st.random(size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(random_st.standard_cauchy()) # E: float -reveal_type(random_st.standard_cauchy(size=None)) # E: float -reveal_type(random_st.standard_cauchy(size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.standard_exponential()) # E: float -reveal_type(random_st.standard_exponential(size=None)) # E: float -reveal_type(random_st.standard_exponential(size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(random_st.zipf(1.5)) # E: int -reveal_type(random_st.zipf(1.5, size=None)) # E: int -reveal_type(random_st.zipf(1.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.zipf(D_arr_1p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.zipf(D_arr_1p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.zipf(D_arr_like_1p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.zipf(D_arr_like_1p5, size=1)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.weibull(0.5)) # E: float -reveal_type(random_st.weibull(0.5, size=None)) # E: float -reveal_type(random_st.weibull(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.weibull(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.weibull(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.weibull(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.weibull(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.standard_t(0.5)) # E: float -reveal_type(random_st.standard_t(0.5, size=None)) # E: float -reveal_type(random_st.standard_t(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.standard_t(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.standard_t(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.standard_t(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.standard_t(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.poisson(0.5)) # E: int -reveal_type(random_st.poisson(0.5, size=None)) # E: int -reveal_type(random_st.poisson(0.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.poisson(D_arr_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.poisson(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.poisson(D_arr_like_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.poisson(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.power(0.5)) # E: float -reveal_type(random_st.power(0.5, size=None)) # E: float -reveal_type(random_st.power(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.power(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.power(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.power(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.power(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.pareto(0.5)) # E: float -reveal_type(random_st.pareto(0.5, size=None)) # E: float -reveal_type(random_st.pareto(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.pareto(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.pareto(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.pareto(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.pareto(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.chisquare(0.5)) # E: float -reveal_type(random_st.chisquare(0.5, size=None)) # E: float -reveal_type(random_st.chisquare(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.chisquare(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.chisquare(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.chisquare(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.chisquare(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.exponential(0.5)) # E: float -reveal_type(random_st.exponential(0.5, size=None)) # E: float -reveal_type(random_st.exponential(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.exponential(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.exponential(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.exponential(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.exponential(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.geometric(0.5)) # E: int -reveal_type(random_st.geometric(0.5, size=None)) # E: int -reveal_type(random_st.geometric(0.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.geometric(D_arr_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.geometric(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.geometric(D_arr_like_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.geometric(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.logseries(0.5)) # E: int -reveal_type(random_st.logseries(0.5, size=None)) # E: int -reveal_type(random_st.logseries(0.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.logseries(D_arr_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.logseries(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.logseries(D_arr_like_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.logseries(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.rayleigh(0.5)) # E: float -reveal_type(random_st.rayleigh(0.5, size=None)) # E: float -reveal_type(random_st.rayleigh(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.rayleigh(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.rayleigh(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.rayleigh(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.rayleigh(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.standard_gamma(0.5)) # E: float -reveal_type(random_st.standard_gamma(0.5, size=None)) # E: float -reveal_type(random_st.standard_gamma(0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(random_st.standard_gamma(D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(random_st.standard_gamma(D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(random_st.standard_gamma(D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(random_st.standard_gamma(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] -reveal_type(random_st.standard_gamma(D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]]] - -reveal_type(random_st.vonmises(0.5, 0.5)) # E: float -reveal_type(random_st.vonmises(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.vonmises(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.vonmises(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.wald(0.5, 0.5)) # E: float -reveal_type(random_st.wald(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.wald(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.wald(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.uniform(0.5, 0.5)) # E: float -reveal_type(random_st.uniform(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.uniform(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.uniform(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.beta(0.5, 0.5)) # E: float -reveal_type(random_st.beta(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.beta(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.beta(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.f(0.5, 0.5)) # E: float -reveal_type(random_st.f(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.f(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.f(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.gamma(0.5, 0.5)) # E: float -reveal_type(random_st.gamma(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.gamma(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gamma(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.gumbel(0.5, 0.5)) # E: float -reveal_type(random_st.gumbel(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.gumbel(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.gumbel(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.laplace(0.5, 0.5)) # E: float -reveal_type(random_st.laplace(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.laplace(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.laplace(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.logistic(0.5, 0.5)) # E: float -reveal_type(random_st.logistic(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.logistic(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.logistic(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.lognormal(0.5, 0.5)) # E: float -reveal_type(random_st.lognormal(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.lognormal(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.lognormal(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.noncentral_chisquare(0.5, 0.5)) # E: float -reveal_type(random_st.noncentral_chisquare(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.noncentral_chisquare(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.normal(0.5, 0.5)) # E: float -reveal_type(random_st.normal(0.5, 0.5, size=None)) # E: float -reveal_type(random_st.normal(0.5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(D_arr_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(0.5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(D_arr_0p5, 0.5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(0.5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(D_arr_like_0p5, 0.5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(0.5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(D_arr_0p5, D_arr_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(D_arr_like_0p5, D_arr_like_0p5)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(D_arr_0p5, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.normal(D_arr_like_0p5, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.triangular(0.1, 0.5, 0.9)) # E: float -reveal_type(random_st.triangular(0.1, 0.5, 0.9, size=None)) # E: float -reveal_type(random_st.triangular(0.1, 0.5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(D_arr_0p1, 0.5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(0.1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(0.1, D_arr_0p5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(D_arr_like_0p1, 0.5, D_arr_0p9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(0.5, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(D_arr_0p1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(D_arr_like_0p1, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.triangular(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.noncentral_f(0.1, 0.5, 0.9)) # E: float -reveal_type(random_st.noncentral_f(0.1, 0.5, 0.9, size=None)) # E: float -reveal_type(random_st.noncentral_f(0.1, 0.5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(D_arr_0p1, 0.5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(0.1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(0.1, D_arr_0p5, 0.9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(D_arr_like_0p1, 0.5, D_arr_0p9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(0.5, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(D_arr_0p1, D_arr_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, 0.9)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.binomial(10, 0.5)) # E: int -reveal_type(random_st.binomial(10, 0.5, size=None)) # E: int -reveal_type(random_st.binomial(10, 0.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(I_arr_10, 0.5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(10, D_arr_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(I_arr_10, 0.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(I_arr_like_10, 0.5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(10, D_arr_like_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(I_arr_10, D_arr_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(I_arr_like_10, D_arr_like_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(I_arr_10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.binomial(I_arr_like_10, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.negative_binomial(10, 0.5)) # E: int -reveal_type(random_st.negative_binomial(10, 0.5, size=None)) # E: int -reveal_type(random_st.negative_binomial(10, 0.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(I_arr_10, 0.5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(10, D_arr_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(I_arr_10, 0.5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(I_arr_like_10, 0.5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(10, D_arr_like_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(I_arr_10, D_arr_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(I_arr_like_10, D_arr_like_0p5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(I_arr_10, D_arr_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.negative_binomial(I_arr_like_10, D_arr_like_0p5, size=1)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.hypergeometric(20, 20, 10)) # E: int -reveal_type(random_st.hypergeometric(20, 20, 10, size=None)) # E: int -reveal_type(random_st.hypergeometric(20, 20, 10, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(I_arr_20, 20, 10)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(20, I_arr_20, 10)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(I_arr_20, 20, I_arr_like_10, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(20, I_arr_20, 10, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(I_arr_like_20, 20, I_arr_10)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(20, I_arr_like_20, 10)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(I_arr_20, I_arr_20, 10)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(I_arr_like_20, I_arr_like_20, 10)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(I_arr_20, I_arr_20, I_arr_10, size=1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.hypergeometric(I_arr_like_20, I_arr_like_20, I_arr_like_10, size=1)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.randint(0, 100)) # E: int -reveal_type(random_st.randint(100)) # E: int -reveal_type(random_st.randint([100])) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.randint(0, [100])) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.randint(2, dtype=bool)) # E: builtins.bool -reveal_type(random_st.randint(0, 2, dtype=bool)) # E: builtins.bool -reveal_type(random_st.randint(I_bool_high_open, dtype=bool)) # E: ndarray[Any, dtype[bool_] -reveal_type(random_st.randint(I_bool_low, I_bool_high_open, dtype=bool)) # E: ndarray[Any, dtype[bool_] -reveal_type(random_st.randint(0, I_bool_high_open, dtype=bool)) # E: ndarray[Any, dtype[bool_] - -reveal_type(random_st.randint(2, dtype=np.bool_)) # E: builtins.bool -reveal_type(random_st.randint(0, 2, dtype=np.bool_)) # E: builtins.bool -reveal_type(random_st.randint(I_bool_high_open, dtype=np.bool_)) # E: ndarray[Any, dtype[bool_] -reveal_type(random_st.randint(I_bool_low, I_bool_high_open, dtype=np.bool_)) # E: ndarray[Any, dtype[bool_] -reveal_type(random_st.randint(0, I_bool_high_open, dtype=np.bool_)) # E: ndarray[Any, dtype[bool_] - -reveal_type(random_st.randint(256, dtype="u1")) # E: int -reveal_type(random_st.randint(0, 256, dtype="u1")) # E: int -reveal_type(random_st.randint(I_u1_high_open, dtype="u1")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(random_st.randint(I_u1_low, I_u1_high_open, dtype="u1")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(random_st.randint(0, I_u1_high_open, dtype="u1")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] - -reveal_type(random_st.randint(256, dtype="uint8")) # E: int -reveal_type(random_st.randint(0, 256, dtype="uint8")) # E: int -reveal_type(random_st.randint(I_u1_high_open, dtype="uint8")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(random_st.randint(I_u1_low, I_u1_high_open, dtype="uint8")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(random_st.randint(0, I_u1_high_open, dtype="uint8")) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] - -reveal_type(random_st.randint(256, dtype=np.uint8)) # E: int -reveal_type(random_st.randint(0, 256, dtype=np.uint8)) # E: int -reveal_type(random_st.randint(I_u1_high_open, dtype=np.uint8)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(random_st.randint(I_u1_low, I_u1_high_open, dtype=np.uint8)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] -reveal_type(random_st.randint(0, I_u1_high_open, dtype=np.uint8)) # E: ndarray[Any, dtype[unsignedinteger[typing._8Bit]]] - -reveal_type(random_st.randint(65536, dtype="u2")) # E: int -reveal_type(random_st.randint(0, 65536, dtype="u2")) # E: int -reveal_type(random_st.randint(I_u2_high_open, dtype="u2")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(random_st.randint(I_u2_low, I_u2_high_open, dtype="u2")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(random_st.randint(0, I_u2_high_open, dtype="u2")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] - -reveal_type(random_st.randint(65536, dtype="uint16")) # E: int -reveal_type(random_st.randint(0, 65536, dtype="uint16")) # E: int -reveal_type(random_st.randint(I_u2_high_open, dtype="uint16")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(random_st.randint(I_u2_low, I_u2_high_open, dtype="uint16")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(random_st.randint(0, I_u2_high_open, dtype="uint16")) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] - -reveal_type(random_st.randint(65536, dtype=np.uint16)) # E: int -reveal_type(random_st.randint(0, 65536, dtype=np.uint16)) # E: int -reveal_type(random_st.randint(I_u2_high_open, dtype=np.uint16)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(random_st.randint(I_u2_low, I_u2_high_open, dtype=np.uint16)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] -reveal_type(random_st.randint(0, I_u2_high_open, dtype=np.uint16)) # E: ndarray[Any, dtype[unsignedinteger[typing._16Bit]]] - -reveal_type(random_st.randint(4294967296, dtype="u4")) # E: int -reveal_type(random_st.randint(0, 4294967296, dtype="u4")) # E: int -reveal_type(random_st.randint(I_u4_high_open, dtype="u4")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(random_st.randint(I_u4_low, I_u4_high_open, dtype="u4")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(random_st.randint(0, I_u4_high_open, dtype="u4")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] - -reveal_type(random_st.randint(4294967296, dtype="uint32")) # E: int -reveal_type(random_st.randint(0, 4294967296, dtype="uint32")) # E: int -reveal_type(random_st.randint(I_u4_high_open, dtype="uint32")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(random_st.randint(I_u4_low, I_u4_high_open, dtype="uint32")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(random_st.randint(0, I_u4_high_open, dtype="uint32")) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] - -reveal_type(random_st.randint(4294967296, dtype=np.uint32)) # E: int -reveal_type(random_st.randint(0, 4294967296, dtype=np.uint32)) # E: int -reveal_type(random_st.randint(I_u4_high_open, dtype=np.uint32)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(random_st.randint(I_u4_low, I_u4_high_open, dtype=np.uint32)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] -reveal_type(random_st.randint(0, I_u4_high_open, dtype=np.uint32)) # E: ndarray[Any, dtype[unsignedinteger[typing._32Bit]]] - -reveal_type(random_st.randint(4294967296, dtype=np.uint)) # E: int -reveal_type(random_st.randint(0, 4294967296, dtype=np.uint)) # E: int -reveal_type(random_st.randint(I_u4_high_open, dtype=np.uint)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(random_st.randint(I_u4_low, I_u4_high_open, dtype=np.uint)) # E: ndarray[Any, dtype[{uint}]] -reveal_type(random_st.randint(0, I_u4_high_open, dtype=np.uint)) # E: ndarray[Any, dtype[{uint}]] - -reveal_type(random_st.randint(18446744073709551616, dtype="u8")) # E: int -reveal_type(random_st.randint(0, 18446744073709551616, dtype="u8")) # E: int -reveal_type(random_st.randint(I_u8_high_open, dtype="u8")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(random_st.randint(I_u8_low, I_u8_high_open, dtype="u8")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(random_st.randint(0, I_u8_high_open, dtype="u8")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] - -reveal_type(random_st.randint(18446744073709551616, dtype="uint64")) # E: int -reveal_type(random_st.randint(0, 18446744073709551616, dtype="uint64")) # E: int -reveal_type(random_st.randint(I_u8_high_open, dtype="uint64")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(random_st.randint(I_u8_low, I_u8_high_open, dtype="uint64")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(random_st.randint(0, I_u8_high_open, dtype="uint64")) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] - -reveal_type(random_st.randint(18446744073709551616, dtype=np.uint64)) # E: int -reveal_type(random_st.randint(0, 18446744073709551616, dtype=np.uint64)) # E: int -reveal_type(random_st.randint(I_u8_high_open, dtype=np.uint64)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(random_st.randint(I_u8_low, I_u8_high_open, dtype=np.uint64)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] -reveal_type(random_st.randint(0, I_u8_high_open, dtype=np.uint64)) # E: ndarray[Any, dtype[unsignedinteger[typing._64Bit]]] - -reveal_type(random_st.randint(128, dtype="i1")) # E: int -reveal_type(random_st.randint(-128, 128, dtype="i1")) # E: int -reveal_type(random_st.randint(I_i1_high_open, dtype="i1")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(random_st.randint(I_i1_low, I_i1_high_open, dtype="i1")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(random_st.randint(-128, I_i1_high_open, dtype="i1")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] - -reveal_type(random_st.randint(128, dtype="int8")) # E: int -reveal_type(random_st.randint(-128, 128, dtype="int8")) # E: int -reveal_type(random_st.randint(I_i1_high_open, dtype="int8")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(random_st.randint(I_i1_low, I_i1_high_open, dtype="int8")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(random_st.randint(-128, I_i1_high_open, dtype="int8")) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] - -reveal_type(random_st.randint(128, dtype=np.int8)) # E: int -reveal_type(random_st.randint(-128, 128, dtype=np.int8)) # E: int -reveal_type(random_st.randint(I_i1_high_open, dtype=np.int8)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(random_st.randint(I_i1_low, I_i1_high_open, dtype=np.int8)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] -reveal_type(random_st.randint(-128, I_i1_high_open, dtype=np.int8)) # E: ndarray[Any, dtype[signedinteger[typing._8Bit]]] - -reveal_type(random_st.randint(32768, dtype="i2")) # E: int -reveal_type(random_st.randint(-32768, 32768, dtype="i2")) # E: int -reveal_type(random_st.randint(I_i2_high_open, dtype="i2")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(I_i2_low, I_i2_high_open, dtype="i2")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(-32768, I_i2_high_open, dtype="i2")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(32768, dtype="int16")) # E: int -reveal_type(random_st.randint(-32768, 32768, dtype="int16")) # E: int -reveal_type(random_st.randint(I_i2_high_open, dtype="int16")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(I_i2_low, I_i2_high_open, dtype="int16")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(-32768, I_i2_high_open, dtype="int16")) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(32768, dtype=np.int16)) # E: int -reveal_type(random_st.randint(-32768, 32768, dtype=np.int16)) # E: int -reveal_type(random_st.randint(I_i2_high_open, dtype=np.int16)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(I_i2_low, I_i2_high_open, dtype=np.int16)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] -reveal_type(random_st.randint(-32768, I_i2_high_open, dtype=np.int16)) # E: ndarray[Any, dtype[signedinteger[typing._16Bit]]] - -reveal_type(random_st.randint(2147483648, dtype="i4")) # E: int -reveal_type(random_st.randint(-2147483648, 2147483648, dtype="i4")) # E: int -reveal_type(random_st.randint(I_i4_high_open, dtype="i4")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(random_st.randint(I_i4_low, I_i4_high_open, dtype="i4")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(random_st.randint(-2147483648, I_i4_high_open, dtype="i4")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] - -reveal_type(random_st.randint(2147483648, dtype="int32")) # E: int -reveal_type(random_st.randint(-2147483648, 2147483648, dtype="int32")) # E: int -reveal_type(random_st.randint(I_i4_high_open, dtype="int32")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(random_st.randint(I_i4_low, I_i4_high_open, dtype="int32")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(random_st.randint(-2147483648, I_i4_high_open, dtype="int32")) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] - -reveal_type(random_st.randint(2147483648, dtype=np.int32)) # E: int -reveal_type(random_st.randint(-2147483648, 2147483648, dtype=np.int32)) # E: int -reveal_type(random_st.randint(I_i4_high_open, dtype=np.int32)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(random_st.randint(I_i4_low, I_i4_high_open, dtype=np.int32)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] -reveal_type(random_st.randint(-2147483648, I_i4_high_open, dtype=np.int32)) # E: ndarray[Any, dtype[signedinteger[typing._32Bit]]] - -reveal_type(random_st.randint(2147483648, dtype=np.int_)) # E: int -reveal_type(random_st.randint(-2147483648, 2147483648, dtype=np.int_)) # E: int -reveal_type(random_st.randint(I_i4_high_open, dtype=np.int_)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.randint(I_i4_low, I_i4_high_open, dtype=np.int_)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.randint(-2147483648, I_i4_high_open, dtype=np.int_)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.randint(9223372036854775808, dtype="i8")) # E: int -reveal_type(random_st.randint(-9223372036854775808, 9223372036854775808, dtype="i8")) # E: int -reveal_type(random_st.randint(I_i8_high_open, dtype="i8")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(random_st.randint(I_i8_low, I_i8_high_open, dtype="i8")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(random_st.randint(-9223372036854775808, I_i8_high_open, dtype="i8")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(random_st.randint(9223372036854775808, dtype="int64")) # E: int -reveal_type(random_st.randint(-9223372036854775808, 9223372036854775808, dtype="int64")) # E: int -reveal_type(random_st.randint(I_i8_high_open, dtype="int64")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(random_st.randint(I_i8_low, I_i8_high_open, dtype="int64")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(random_st.randint(-9223372036854775808, I_i8_high_open, dtype="int64")) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(random_st.randint(9223372036854775808, dtype=np.int64)) # E: int -reveal_type(random_st.randint(-9223372036854775808, 9223372036854775808, dtype=np.int64)) # E: int -reveal_type(random_st.randint(I_i8_high_open, dtype=np.int64)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(random_st.randint(I_i8_low, I_i8_high_open, dtype=np.int64)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] -reveal_type(random_st.randint(-9223372036854775808, I_i8_high_open, dtype=np.int64)) # E: ndarray[Any, dtype[signedinteger[typing._64Bit]]] - -reveal_type(random_st._bit_generator) # E: BitGenerator - -reveal_type(random_st.bytes(2)) # E: bytes - -reveal_type(random_st.choice(5)) # E: int -reveal_type(random_st.choice(5, 3)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.choice(5, 3, replace=True)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.choice(5, 3, p=[1 / 5] * 5)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.choice(5, 3, p=[1 / 5] * 5, replace=False)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"])) # E: Any -reveal_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3)) # E: ndarray[Any, Any] -reveal_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, p=[1 / 4] * 4)) # E: ndarray[Any, Any] -reveal_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=True)) # E: ndarray[Any, Any] -reveal_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=False, p=np.array([1 / 8, 1 / 8, 1 / 2, 1 / 4]))) # E: ndarray[Any, Any] - -reveal_type(random_st.dirichlet([0.5, 0.5])) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.dirichlet(np.array([0.5, 0.5]))) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.dirichlet(np.array([0.5, 0.5]), size=3)) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.multinomial(20, [1 / 6.0] * 6)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.multinomial(20, np.array([0.5, 0.5]))) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.multinomial(20, [1 / 6.0] * 6, size=2)) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(random_st.multivariate_normal([0.0], [[1.0]])) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.multivariate_normal([0.0], np.array([[1.0]]))) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.multivariate_normal(np.array([0.0]), [[1.0]])) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.multivariate_normal([0.0], np.array([[1.0]]))) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.permutation(10)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.permutation([1, 2, 3, 4])) # E: ndarray[Any, Any] -reveal_type(random_st.permutation(np.array([1, 2, 3, 4]))) # E: ndarray[Any, Any] -reveal_type(random_st.permutation(D_2D)) # E: ndarray[Any, Any] - -reveal_type(random_st.shuffle(np.arange(10))) # E: None -reveal_type(random_st.shuffle([1, 2, 3, 4, 5])) # E: None -reveal_type(random_st.shuffle(D_2D)) # E: None - -reveal_type(np.random.RandomState(pcg64)) # E: RandomState -reveal_type(np.random.RandomState(0)) # E: RandomState -reveal_type(np.random.RandomState([0, 1, 2])) # E: RandomState -reveal_type(random_st.__str__()) # E: str -reveal_type(random_st.__repr__()) # E: str +assert_type(random_st.standard_normal(), float) +assert_type(random_st.standard_normal(size=None), float) +assert_type(random_st.standard_normal(size=1), npt.NDArray[np.float64]) + +assert_type(random_st.random(), float) +assert_type(random_st.random(size=None), float) +assert_type(random_st.random(size=1), npt.NDArray[np.float64]) + +assert_type(random_st.standard_cauchy(), float) +assert_type(random_st.standard_cauchy(size=None), float) +assert_type(random_st.standard_cauchy(size=1), npt.NDArray[np.float64]) + +assert_type(random_st.standard_exponential(), float) +assert_type(random_st.standard_exponential(size=None), float) +assert_type(random_st.standard_exponential(size=1), npt.NDArray[np.float64]) + +assert_type(random_st.zipf(1.5), int) +assert_type(random_st.zipf(1.5, size=None), int) +assert_type(random_st.zipf(1.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.zipf(D_arr_1p5), npt.NDArray[np.int_]) +assert_type(random_st.zipf(D_arr_1p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.zipf(D_arr_like_1p5), npt.NDArray[np.int_]) +assert_type(random_st.zipf(D_arr_like_1p5, size=1), npt.NDArray[np.int_]) + +assert_type(random_st.weibull(0.5), float) +assert_type(random_st.weibull(0.5, size=None), float) +assert_type(random_st.weibull(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.weibull(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.weibull(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.weibull(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.weibull(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.standard_t(0.5), float) +assert_type(random_st.standard_t(0.5, size=None), float) +assert_type(random_st.standard_t(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.standard_t(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.standard_t(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.standard_t(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.standard_t(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.poisson(0.5), int) +assert_type(random_st.poisson(0.5, size=None), int) +assert_type(random_st.poisson(0.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.poisson(D_arr_0p5), npt.NDArray[np.int_]) +assert_type(random_st.poisson(D_arr_0p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.poisson(D_arr_like_0p5), npt.NDArray[np.int_]) +assert_type(random_st.poisson(D_arr_like_0p5, size=1), npt.NDArray[np.int_]) + +assert_type(random_st.power(0.5), float) +assert_type(random_st.power(0.5, size=None), float) +assert_type(random_st.power(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.power(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.power(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.power(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.power(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.pareto(0.5), float) +assert_type(random_st.pareto(0.5, size=None), float) +assert_type(random_st.pareto(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.pareto(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.pareto(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.pareto(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.pareto(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.chisquare(0.5), float) +assert_type(random_st.chisquare(0.5, size=None), float) +assert_type(random_st.chisquare(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.chisquare(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.chisquare(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.chisquare(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.chisquare(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.exponential(0.5), float) +assert_type(random_st.exponential(0.5, size=None), float) +assert_type(random_st.exponential(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.exponential(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.exponential(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.exponential(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.exponential(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.geometric(0.5), int) +assert_type(random_st.geometric(0.5, size=None), int) +assert_type(random_st.geometric(0.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.geometric(D_arr_0p5), npt.NDArray[np.int_]) +assert_type(random_st.geometric(D_arr_0p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.geometric(D_arr_like_0p5), npt.NDArray[np.int_]) +assert_type(random_st.geometric(D_arr_like_0p5, size=1), npt.NDArray[np.int_]) + +assert_type(random_st.logseries(0.5), int) +assert_type(random_st.logseries(0.5, size=None), int) +assert_type(random_st.logseries(0.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.logseries(D_arr_0p5), npt.NDArray[np.int_]) +assert_type(random_st.logseries(D_arr_0p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.logseries(D_arr_like_0p5), npt.NDArray[np.int_]) +assert_type(random_st.logseries(D_arr_like_0p5, size=1), npt.NDArray[np.int_]) + +assert_type(random_st.rayleigh(0.5), float) +assert_type(random_st.rayleigh(0.5, size=None), float) +assert_type(random_st.rayleigh(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.rayleigh(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.rayleigh(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.rayleigh(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.rayleigh(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.standard_gamma(0.5), float) +assert_type(random_st.standard_gamma(0.5, size=None), float) +assert_type(random_st.standard_gamma(0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.standard_gamma(D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.standard_gamma(D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.standard_gamma(D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.standard_gamma(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.standard_gamma(D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.vonmises(0.5, 0.5), float) +assert_type(random_st.vonmises(0.5, 0.5, size=None), float) +assert_type(random_st.vonmises(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.vonmises(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.wald(0.5, 0.5), float) +assert_type(random_st.wald(0.5, 0.5, size=None), float) +assert_type(random_st.wald(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.wald(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.wald(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.wald(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.wald(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.wald(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.wald(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.wald(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.wald(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.wald(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.wald(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.uniform(0.5, 0.5), float) +assert_type(random_st.uniform(0.5, 0.5, size=None), float) +assert_type(random_st.uniform(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.uniform(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.uniform(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.uniform(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.uniform(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.uniform(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.uniform(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.uniform(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.uniform(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.uniform(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.uniform(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.beta(0.5, 0.5), float) +assert_type(random_st.beta(0.5, 0.5, size=None), float) +assert_type(random_st.beta(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.beta(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.beta(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.beta(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.beta(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.beta(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.beta(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.beta(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.beta(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.beta(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.beta(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.f(0.5, 0.5), float) +assert_type(random_st.f(0.5, 0.5, size=None), float) +assert_type(random_st.f(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.f(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.f(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.f(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.f(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.f(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.f(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.f(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.f(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.f(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.f(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.gamma(0.5, 0.5), float) +assert_type(random_st.gamma(0.5, 0.5, size=None), float) +assert_type(random_st.gamma(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gamma(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.gamma(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gamma(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gamma(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gamma(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.gamma(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gamma(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gamma(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gamma(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gamma(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.gumbel(0.5, 0.5), float) +assert_type(random_st.gumbel(0.5, 0.5, size=None), float) +assert_type(random_st.gumbel(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.gumbel(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.laplace(0.5, 0.5), float) +assert_type(random_st.laplace(0.5, 0.5, size=None), float) +assert_type(random_st.laplace(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.laplace(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.laplace(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.laplace(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.laplace(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.laplace(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.laplace(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.laplace(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.laplace(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.laplace(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.laplace(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.logistic(0.5, 0.5), float) +assert_type(random_st.logistic(0.5, 0.5, size=None), float) +assert_type(random_st.logistic(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.logistic(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.logistic(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.logistic(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.logistic(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.logistic(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.logistic(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.logistic(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.logistic(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.logistic(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.logistic(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.lognormal(0.5, 0.5), float) +assert_type(random_st.lognormal(0.5, 0.5, size=None), float) +assert_type(random_st.lognormal(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.lognormal(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.noncentral_chisquare(0.5, 0.5), float) +assert_type(random_st.noncentral_chisquare(0.5, 0.5, size=None), float) +assert_type(random_st.noncentral_chisquare(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.normal(0.5, 0.5), float) +assert_type(random_st.normal(0.5, 0.5, size=None), float) +assert_type(random_st.normal(0.5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.normal(D_arr_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.normal(0.5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.normal(D_arr_0p5, 0.5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.normal(0.5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.normal(D_arr_like_0p5, 0.5), npt.NDArray[np.float64]) +assert_type(random_st.normal(0.5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.normal(D_arr_0p5, D_arr_0p5), npt.NDArray[np.float64]) +assert_type(random_st.normal(D_arr_like_0p5, D_arr_like_0p5), npt.NDArray[np.float64]) +assert_type(random_st.normal(D_arr_0p5, D_arr_0p5, size=1), npt.NDArray[np.float64]) +assert_type(random_st.normal(D_arr_like_0p5, D_arr_like_0p5, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.triangular(0.1, 0.5, 0.9), float) +assert_type(random_st.triangular(0.1, 0.5, 0.9, size=None), float) +assert_type(random_st.triangular(0.1, 0.5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.triangular(D_arr_0p1, 0.5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.triangular(0.1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.triangular(D_arr_0p1, 0.5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.triangular(0.1, D_arr_0p5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.triangular(D_arr_like_0p1, 0.5, D_arr_0p9), npt.NDArray[np.float64]) +assert_type(random_st.triangular(0.5, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.triangular(D_arr_0p1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.triangular(D_arr_like_0p1, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.triangular(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.triangular(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.noncentral_f(0.1, 0.5, 0.9), float) +assert_type(random_st.noncentral_f(0.1, 0.5, 0.9, size=None), float) +assert_type(random_st.noncentral_f(0.1, 0.5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(D_arr_0p1, 0.5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(0.1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(D_arr_0p1, 0.5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(0.1, D_arr_0p5, 0.9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(D_arr_like_0p1, 0.5, D_arr_0p9), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(0.5, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(D_arr_0p1, D_arr_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, 0.9), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1), npt.NDArray[np.float64]) +assert_type(random_st.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1), npt.NDArray[np.float64]) + +assert_type(random_st.binomial(10, 0.5), int) +assert_type(random_st.binomial(10, 0.5, size=None), int) +assert_type(random_st.binomial(10, 0.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.binomial(I_arr_10, 0.5), npt.NDArray[np.int_]) +assert_type(random_st.binomial(10, D_arr_0p5), npt.NDArray[np.int_]) +assert_type(random_st.binomial(I_arr_10, 0.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.binomial(10, D_arr_0p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.binomial(I_arr_like_10, 0.5), npt.NDArray[np.int_]) +assert_type(random_st.binomial(10, D_arr_like_0p5), npt.NDArray[np.int_]) +assert_type(random_st.binomial(I_arr_10, D_arr_0p5), npt.NDArray[np.int_]) +assert_type(random_st.binomial(I_arr_like_10, D_arr_like_0p5), npt.NDArray[np.int_]) +assert_type(random_st.binomial(I_arr_10, D_arr_0p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.binomial(I_arr_like_10, D_arr_like_0p5, size=1), npt.NDArray[np.int_]) + +assert_type(random_st.negative_binomial(10, 0.5), int) +assert_type(random_st.negative_binomial(10, 0.5, size=None), int) +assert_type(random_st.negative_binomial(10, 0.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(I_arr_10, 0.5), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(10, D_arr_0p5), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(I_arr_10, 0.5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(10, D_arr_0p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(I_arr_like_10, 0.5), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(10, D_arr_like_0p5), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(I_arr_10, D_arr_0p5), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(I_arr_like_10, D_arr_like_0p5), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(I_arr_10, D_arr_0p5, size=1), npt.NDArray[np.int_]) +assert_type(random_st.negative_binomial(I_arr_like_10, D_arr_like_0p5, size=1), npt.NDArray[np.int_]) + +assert_type(random_st.hypergeometric(20, 20, 10), int) +assert_type(random_st.hypergeometric(20, 20, 10, size=None), int) +assert_type(random_st.hypergeometric(20, 20, 10, size=1), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(I_arr_20, 20, 10), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(20, I_arr_20, 10), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(I_arr_20, 20, I_arr_like_10, size=1), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(20, I_arr_20, 10, size=1), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(I_arr_like_20, 20, I_arr_10), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(20, I_arr_like_20, 10), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(I_arr_20, I_arr_20, 10), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(I_arr_like_20, I_arr_like_20, 10), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(I_arr_20, I_arr_20, I_arr_10, size=1), npt.NDArray[np.int_]) +assert_type(random_st.hypergeometric(I_arr_like_20, I_arr_like_20, I_arr_like_10, size=1), npt.NDArray[np.int_]) + +assert_type(random_st.randint(0, 100), int) +assert_type(random_st.randint(100), int) +assert_type(random_st.randint([100]), npt.NDArray[np.int_]) +assert_type(random_st.randint(0, [100]), npt.NDArray[np.int_]) + +assert_type(random_st.randint(2, dtype=bool), bool) +assert_type(random_st.randint(0, 2, dtype=bool), bool) +assert_type(random_st.randint(I_bool_high_open, dtype=bool), npt.NDArray[np.bool_]) +assert_type(random_st.randint(I_bool_low, I_bool_high_open, dtype=bool), npt.NDArray[np.bool_]) +assert_type(random_st.randint(0, I_bool_high_open, dtype=bool), npt.NDArray[np.bool_]) + +assert_type(random_st.randint(2, dtype=np.bool_), bool) +assert_type(random_st.randint(0, 2, dtype=np.bool_), bool) +assert_type(random_st.randint(I_bool_high_open, dtype=np.bool_), npt.NDArray[np.bool_]) +assert_type(random_st.randint(I_bool_low, I_bool_high_open, dtype=np.bool_), npt.NDArray[np.bool_]) +assert_type(random_st.randint(0, I_bool_high_open, dtype=np.bool_), npt.NDArray[np.bool_]) + +assert_type(random_st.randint(256, dtype="u1"), int) +assert_type(random_st.randint(0, 256, dtype="u1"), int) +assert_type(random_st.randint(I_u1_high_open, dtype="u1"), npt.NDArray[np.uint8]) +assert_type(random_st.randint(I_u1_low, I_u1_high_open, dtype="u1"), npt.NDArray[np.uint8]) +assert_type(random_st.randint(0, I_u1_high_open, dtype="u1"), npt.NDArray[np.uint8]) + +assert_type(random_st.randint(256, dtype="uint8"), int) +assert_type(random_st.randint(0, 256, dtype="uint8"), int) +assert_type(random_st.randint(I_u1_high_open, dtype="uint8"), npt.NDArray[np.uint8]) +assert_type(random_st.randint(I_u1_low, I_u1_high_open, dtype="uint8"), npt.NDArray[np.uint8]) +assert_type(random_st.randint(0, I_u1_high_open, dtype="uint8"), npt.NDArray[np.uint8]) + +assert_type(random_st.randint(256, dtype=np.uint8), int) +assert_type(random_st.randint(0, 256, dtype=np.uint8), int) +assert_type(random_st.randint(I_u1_high_open, dtype=np.uint8), npt.NDArray[np.uint8]) +assert_type(random_st.randint(I_u1_low, I_u1_high_open, dtype=np.uint8), npt.NDArray[np.uint8]) +assert_type(random_st.randint(0, I_u1_high_open, dtype=np.uint8), npt.NDArray[np.uint8]) + +assert_type(random_st.randint(65536, dtype="u2"), int) +assert_type(random_st.randint(0, 65536, dtype="u2"), int) +assert_type(random_st.randint(I_u2_high_open, dtype="u2"), npt.NDArray[np.uint16]) +assert_type(random_st.randint(I_u2_low, I_u2_high_open, dtype="u2"), npt.NDArray[np.uint16]) +assert_type(random_st.randint(0, I_u2_high_open, dtype="u2"), npt.NDArray[np.uint16]) + +assert_type(random_st.randint(65536, dtype="uint16"), int) +assert_type(random_st.randint(0, 65536, dtype="uint16"), int) +assert_type(random_st.randint(I_u2_high_open, dtype="uint16"), npt.NDArray[np.uint16]) +assert_type(random_st.randint(I_u2_low, I_u2_high_open, dtype="uint16"), npt.NDArray[np.uint16]) +assert_type(random_st.randint(0, I_u2_high_open, dtype="uint16"), npt.NDArray[np.uint16]) + +assert_type(random_st.randint(65536, dtype=np.uint16), int) +assert_type(random_st.randint(0, 65536, dtype=np.uint16), int) +assert_type(random_st.randint(I_u2_high_open, dtype=np.uint16), npt.NDArray[np.uint16]) +assert_type(random_st.randint(I_u2_low, I_u2_high_open, dtype=np.uint16), npt.NDArray[np.uint16]) +assert_type(random_st.randint(0, I_u2_high_open, dtype=np.uint16), npt.NDArray[np.uint16]) + +assert_type(random_st.randint(4294967296, dtype="u4"), int) +assert_type(random_st.randint(0, 4294967296, dtype="u4"), int) +assert_type(random_st.randint(I_u4_high_open, dtype="u4"), npt.NDArray[np.uint32]) +assert_type(random_st.randint(I_u4_low, I_u4_high_open, dtype="u4"), npt.NDArray[np.uint32]) +assert_type(random_st.randint(0, I_u4_high_open, dtype="u4"), npt.NDArray[np.uint32]) + +assert_type(random_st.randint(4294967296, dtype="uint32"), int) +assert_type(random_st.randint(0, 4294967296, dtype="uint32"), int) +assert_type(random_st.randint(I_u4_high_open, dtype="uint32"), npt.NDArray[np.uint32]) +assert_type(random_st.randint(I_u4_low, I_u4_high_open, dtype="uint32"), npt.NDArray[np.uint32]) +assert_type(random_st.randint(0, I_u4_high_open, dtype="uint32"), npt.NDArray[np.uint32]) + +assert_type(random_st.randint(4294967296, dtype=np.uint32), int) +assert_type(random_st.randint(0, 4294967296, dtype=np.uint32), int) +assert_type(random_st.randint(I_u4_high_open, dtype=np.uint32), npt.NDArray[np.uint32]) +assert_type(random_st.randint(I_u4_low, I_u4_high_open, dtype=np.uint32), npt.NDArray[np.uint32]) +assert_type(random_st.randint(0, I_u4_high_open, dtype=np.uint32), npt.NDArray[np.uint32]) + +assert_type(random_st.randint(4294967296, dtype=np.uint), int) +assert_type(random_st.randint(0, 4294967296, dtype=np.uint), int) +assert_type(random_st.randint(I_u4_high_open, dtype=np.uint), npt.NDArray[np.uint]) +assert_type(random_st.randint(I_u4_low, I_u4_high_open, dtype=np.uint), npt.NDArray[np.uint]) +assert_type(random_st.randint(0, I_u4_high_open, dtype=np.uint), npt.NDArray[np.uint]) + +assert_type(random_st.randint(18446744073709551616, dtype="u8"), int) +assert_type(random_st.randint(0, 18446744073709551616, dtype="u8"), int) +assert_type(random_st.randint(I_u8_high_open, dtype="u8"), npt.NDArray[np.uint64]) +assert_type(random_st.randint(I_u8_low, I_u8_high_open, dtype="u8"), npt.NDArray[np.uint64]) +assert_type(random_st.randint(0, I_u8_high_open, dtype="u8"), npt.NDArray[np.uint64]) + +assert_type(random_st.randint(18446744073709551616, dtype="uint64"), int) +assert_type(random_st.randint(0, 18446744073709551616, dtype="uint64"), int) +assert_type(random_st.randint(I_u8_high_open, dtype="uint64"), npt.NDArray[np.uint64]) +assert_type(random_st.randint(I_u8_low, I_u8_high_open, dtype="uint64"), npt.NDArray[np.uint64]) +assert_type(random_st.randint(0, I_u8_high_open, dtype="uint64"), npt.NDArray[np.uint64]) + +assert_type(random_st.randint(18446744073709551616, dtype=np.uint64), int) +assert_type(random_st.randint(0, 18446744073709551616, dtype=np.uint64), int) +assert_type(random_st.randint(I_u8_high_open, dtype=np.uint64), npt.NDArray[np.uint64]) +assert_type(random_st.randint(I_u8_low, I_u8_high_open, dtype=np.uint64), npt.NDArray[np.uint64]) +assert_type(random_st.randint(0, I_u8_high_open, dtype=np.uint64), npt.NDArray[np.uint64]) + +assert_type(random_st.randint(128, dtype="i1"), int) +assert_type(random_st.randint(-128, 128, dtype="i1"), int) +assert_type(random_st.randint(I_i1_high_open, dtype="i1"), npt.NDArray[np.int8]) +assert_type(random_st.randint(I_i1_low, I_i1_high_open, dtype="i1"), npt.NDArray[np.int8]) +assert_type(random_st.randint(-128, I_i1_high_open, dtype="i1"), npt.NDArray[np.int8]) + +assert_type(random_st.randint(128, dtype="int8"), int) +assert_type(random_st.randint(-128, 128, dtype="int8"), int) +assert_type(random_st.randint(I_i1_high_open, dtype="int8"), npt.NDArray[np.int8]) +assert_type(random_st.randint(I_i1_low, I_i1_high_open, dtype="int8"), npt.NDArray[np.int8]) +assert_type(random_st.randint(-128, I_i1_high_open, dtype="int8"), npt.NDArray[np.int8]) + +assert_type(random_st.randint(128, dtype=np.int8), int) +assert_type(random_st.randint(-128, 128, dtype=np.int8), int) +assert_type(random_st.randint(I_i1_high_open, dtype=np.int8), npt.NDArray[np.int8]) +assert_type(random_st.randint(I_i1_low, I_i1_high_open, dtype=np.int8), npt.NDArray[np.int8]) +assert_type(random_st.randint(-128, I_i1_high_open, dtype=np.int8), npt.NDArray[np.int8]) + +assert_type(random_st.randint(32768, dtype="i2"), int) +assert_type(random_st.randint(-32768, 32768, dtype="i2"), int) +assert_type(random_st.randint(I_i2_high_open, dtype="i2"), npt.NDArray[np.int16]) +assert_type(random_st.randint(I_i2_low, I_i2_high_open, dtype="i2"), npt.NDArray[np.int16]) +assert_type(random_st.randint(-32768, I_i2_high_open, dtype="i2"), npt.NDArray[np.int16]) +assert_type(random_st.randint(32768, dtype="int16"), int) +assert_type(random_st.randint(-32768, 32768, dtype="int16"), int) +assert_type(random_st.randint(I_i2_high_open, dtype="int16"), npt.NDArray[np.int16]) +assert_type(random_st.randint(I_i2_low, I_i2_high_open, dtype="int16"), npt.NDArray[np.int16]) +assert_type(random_st.randint(-32768, I_i2_high_open, dtype="int16"), npt.NDArray[np.int16]) +assert_type(random_st.randint(32768, dtype=np.int16), int) +assert_type(random_st.randint(-32768, 32768, dtype=np.int16), int) +assert_type(random_st.randint(I_i2_high_open, dtype=np.int16), npt.NDArray[np.int16]) +assert_type(random_st.randint(I_i2_low, I_i2_high_open, dtype=np.int16), npt.NDArray[np.int16]) +assert_type(random_st.randint(-32768, I_i2_high_open, dtype=np.int16), npt.NDArray[np.int16]) + +assert_type(random_st.randint(2147483648, dtype="i4"), int) +assert_type(random_st.randint(-2147483648, 2147483648, dtype="i4"), int) +assert_type(random_st.randint(I_i4_high_open, dtype="i4"), npt.NDArray[np.int32]) +assert_type(random_st.randint(I_i4_low, I_i4_high_open, dtype="i4"), npt.NDArray[np.int32]) +assert_type(random_st.randint(-2147483648, I_i4_high_open, dtype="i4"), npt.NDArray[np.int32]) + +assert_type(random_st.randint(2147483648, dtype="int32"), int) +assert_type(random_st.randint(-2147483648, 2147483648, dtype="int32"), int) +assert_type(random_st.randint(I_i4_high_open, dtype="int32"), npt.NDArray[np.int32]) +assert_type(random_st.randint(I_i4_low, I_i4_high_open, dtype="int32"), npt.NDArray[np.int32]) +assert_type(random_st.randint(-2147483648, I_i4_high_open, dtype="int32"), npt.NDArray[np.int32]) + +assert_type(random_st.randint(2147483648, dtype=np.int32), int) +assert_type(random_st.randint(-2147483648, 2147483648, dtype=np.int32), int) +assert_type(random_st.randint(I_i4_high_open, dtype=np.int32), npt.NDArray[np.int32]) +assert_type(random_st.randint(I_i4_low, I_i4_high_open, dtype=np.int32), npt.NDArray[np.int32]) +assert_type(random_st.randint(-2147483648, I_i4_high_open, dtype=np.int32), npt.NDArray[np.int32]) + +assert_type(random_st.randint(2147483648, dtype=np.int_), int) +assert_type(random_st.randint(-2147483648, 2147483648, dtype=np.int_), int) +assert_type(random_st.randint(I_i4_high_open, dtype=np.int_), npt.NDArray[np.int_]) +assert_type(random_st.randint(I_i4_low, I_i4_high_open, dtype=np.int_), npt.NDArray[np.int_]) +assert_type(random_st.randint(-2147483648, I_i4_high_open, dtype=np.int_), npt.NDArray[np.int_]) + +assert_type(random_st.randint(9223372036854775808, dtype="i8"), int) +assert_type(random_st.randint(-9223372036854775808, 9223372036854775808, dtype="i8"), int) +assert_type(random_st.randint(I_i8_high_open, dtype="i8"), npt.NDArray[np.int64]) +assert_type(random_st.randint(I_i8_low, I_i8_high_open, dtype="i8"), npt.NDArray[np.int64]) +assert_type(random_st.randint(-9223372036854775808, I_i8_high_open, dtype="i8"), npt.NDArray[np.int64]) + +assert_type(random_st.randint(9223372036854775808, dtype="int64"), int) +assert_type(random_st.randint(-9223372036854775808, 9223372036854775808, dtype="int64"), int) +assert_type(random_st.randint(I_i8_high_open, dtype="int64"), npt.NDArray[np.int64]) +assert_type(random_st.randint(I_i8_low, I_i8_high_open, dtype="int64"), npt.NDArray[np.int64]) +assert_type(random_st.randint(-9223372036854775808, I_i8_high_open, dtype="int64"), npt.NDArray[np.int64]) + +assert_type(random_st.randint(9223372036854775808, dtype=np.int64), int) +assert_type(random_st.randint(-9223372036854775808, 9223372036854775808, dtype=np.int64), int) +assert_type(random_st.randint(I_i8_high_open, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(random_st.randint(I_i8_low, I_i8_high_open, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(random_st.randint(-9223372036854775808, I_i8_high_open, dtype=np.int64), npt.NDArray[np.int64]) + +assert_type(random_st._bit_generator, np.random.BitGenerator) + +assert_type(random_st.bytes(2), bytes) + +assert_type(random_st.choice(5), int) +assert_type(random_st.choice(5, 3), npt.NDArray[np.int_]) +assert_type(random_st.choice(5, 3, replace=True), npt.NDArray[np.int_]) +assert_type(random_st.choice(5, 3, p=[1 / 5] * 5), npt.NDArray[np.int_]) +assert_type(random_st.choice(5, 3, p=[1 / 5] * 5, replace=False), npt.NDArray[np.int_]) + +assert_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"]), Any) +assert_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3), np.ndarray[Any, Any]) +assert_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, p=[1 / 4] * 4), np.ndarray[Any, Any]) +assert_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=True), np.ndarray[Any, Any]) +assert_type(random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=False, p=np.array([1 / 8, 1 / 8, 1 / 2, 1 / 4])), np.ndarray[Any, Any]) + +assert_type(random_st.dirichlet([0.5, 0.5]), npt.NDArray[np.float64]) +assert_type(random_st.dirichlet(np.array([0.5, 0.5])), npt.NDArray[np.float64]) +assert_type(random_st.dirichlet(np.array([0.5, 0.5]), size=3), npt.NDArray[np.float64]) + +assert_type(random_st.multinomial(20, [1 / 6.0] * 6), npt.NDArray[np.int_]) +assert_type(random_st.multinomial(20, np.array([0.5, 0.5])), npt.NDArray[np.int_]) +assert_type(random_st.multinomial(20, [1 / 6.0] * 6, size=2), npt.NDArray[np.int_]) + +assert_type(random_st.multivariate_normal([0.0], [[1.0]]), npt.NDArray[np.float64]) +assert_type(random_st.multivariate_normal([0.0], np.array([[1.0]])), npt.NDArray[np.float64]) +assert_type(random_st.multivariate_normal(np.array([0.0]), [[1.0]]), npt.NDArray[np.float64]) +assert_type(random_st.multivariate_normal([0.0], np.array([[1.0]])), npt.NDArray[np.float64]) + +assert_type(random_st.permutation(10), npt.NDArray[np.int_]) +assert_type(random_st.permutation([1, 2, 3, 4]), np.ndarray[Any, Any]) +assert_type(random_st.permutation(np.array([1, 2, 3, 4])), np.ndarray[Any, Any]) +assert_type(random_st.permutation(D_2D), np.ndarray[Any, Any]) + +assert_type(random_st.shuffle(np.arange(10)), None) +assert_type(random_st.shuffle([1, 2, 3, 4, 5]), None) +assert_type(random_st.shuffle(D_2D), None) + +assert_type(np.random.RandomState(pcg64), np.random.RandomState) +assert_type(np.random.RandomState(0), np.random.RandomState) +assert_type(np.random.RandomState([0, 1, 2]), np.random.RandomState) +assert_type(random_st.__str__(), str) +assert_type(random_st.__repr__(), str) random_st_state = random_st.__getstate__() -reveal_type(random_st_state) # E: builtins.dict[builtins.str, Any] -reveal_type(random_st.__setstate__(random_st_state)) # E: None -reveal_type(random_st.seed()) # E: None -reveal_type(random_st.seed(1)) # E: None -reveal_type(random_st.seed([0, 1])) # E: None +assert_type(random_st_state, dict[str, Any]) +assert_type(random_st.__setstate__(random_st_state), None) +assert_type(random_st.seed(), None) +assert_type(random_st.seed(1), None) +assert_type(random_st.seed([0, 1]), None) random_st_get_state = random_st.get_state() -reveal_type(random_st_state) # E: builtins.dict[builtins.str, Any] +assert_type(random_st_state, dict[str, Any]) random_st_get_state_legacy = random_st.get_state(legacy=True) -reveal_type(random_st_get_state_legacy) # E: Union[builtins.dict[builtins.str, Any], Tuple[builtins.str, ndarray[Any, dtype[unsignedinteger[typing._32Bit]]], builtins.int, builtins.int, builtins.float]] -reveal_type(random_st.set_state(random_st_get_state)) # E: None - -reveal_type(random_st.rand()) # E: float -reveal_type(random_st.rand(1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.rand(1, 2)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.randn()) # E: float -reveal_type(random_st.randn(1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.randn(1, 2)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.random_sample()) # E: float -reveal_type(random_st.random_sample(1)) # E: ndarray[Any, dtype[floating[typing._64Bit]] -reveal_type(random_st.random_sample(size=(1, 2))) # E: ndarray[Any, dtype[floating[typing._64Bit]] - -reveal_type(random_st.tomaxint()) # E: int -reveal_type(random_st.tomaxint(1)) # E: ndarray[Any, dtype[{int_}]] -reveal_type(random_st.tomaxint((1,))) # E: ndarray[Any, dtype[{int_}]] - -reveal_type(np.random.set_bit_generator(pcg64)) # E: None -reveal_type(np.random.get_bit_generator()) # E: BitGenerator +assert_type(random_st_get_state_legacy, dict[str, Any] | tuple[str, npt.NDArray[np.uint32], int, int, float]) +assert_type(random_st.set_state(random_st_get_state), None) + +assert_type(random_st.rand(), float) +assert_type(random_st.rand(1), npt.NDArray[np.float64]) +assert_type(random_st.rand(1, 2), npt.NDArray[np.float64]) +assert_type(random_st.randn(), float) +assert_type(random_st.randn(1), npt.NDArray[np.float64]) +assert_type(random_st.randn(1, 2), npt.NDArray[np.float64]) +assert_type(random_st.random_sample(), float) +assert_type(random_st.random_sample(1), npt.NDArray[np.float64]) +assert_type(random_st.random_sample(size=(1, 2)), npt.NDArray[np.float64]) + +assert_type(random_st.tomaxint(), int) +assert_type(random_st.tomaxint(1), npt.NDArray[np.int_]) +assert_type(random_st.tomaxint((1,)), npt.NDArray[np.int_]) + +assert_type(np.random.set_bit_generator(pcg64), None) +assert_type(np.random.get_bit_generator(), np.random.BitGenerator) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/rec.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/rec.pyi index 8ea4a6ee8d..37408d839f 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/rec.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/rec.pyi @@ -1,9 +1,15 @@ import io +import sys from typing import Any import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_i8: npt.NDArray[np.int64] REC_AR_V: np.recarray[Any, np.dtype[np.record]] AR_LIST: list[npt.NDArray[np.int64]] @@ -12,117 +18,150 @@ format_parser: np.format_parser record: np.record file_obj: io.BufferedIOBase -reveal_type(np.format_parser( # E: format_parser +assert_type(np.format_parser( formats=[np.float64, np.int64, np.bool_], names=["f8", "i8", "?"], titles=None, aligned=True, -)) -reveal_type(format_parser.dtype) # E: dtype[void] - -reveal_type(record.field_a) # E: Any -reveal_type(record.field_b) # E: Any -reveal_type(record["field_a"]) # E: Any -reveal_type(record["field_b"]) # E: Any -reveal_type(record.pprint()) # E: str +), np.format_parser) +assert_type(format_parser.dtype, np.dtype[np.void]) + +assert_type(record.field_a, Any) +assert_type(record.field_b, Any) +assert_type(record["field_a"], Any) +assert_type(record["field_b"], Any) +assert_type(record.pprint(), str) record.field_c = 5 -reveal_type(REC_AR_V.field(0)) # E: Any -reveal_type(REC_AR_V.field("field_a")) # E: Any -reveal_type(REC_AR_V.field(0, AR_i8)) # E: None -reveal_type(REC_AR_V.field("field_a", AR_i8)) # E: None -reveal_type(REC_AR_V["field_a"]) # E: Any -reveal_type(REC_AR_V.field_a) # E: Any -reveal_type(REC_AR_V.__array_finalize__(object())) # E: None +assert_type(REC_AR_V.field(0), Any) +assert_type(REC_AR_V.field("field_a"), Any) +assert_type(REC_AR_V.field(0, AR_i8), None) +assert_type(REC_AR_V.field("field_a", AR_i8), None) +assert_type(REC_AR_V["field_a"], npt.NDArray[Any]) +assert_type(REC_AR_V.field_a, Any) +assert_type(REC_AR_V.__array_finalize__(object()), None) -reveal_type(np.recarray( # recarray[Any, dtype[record]] - shape=(10, 5), - formats=[np.float64, np.int64, np.bool_], - order="K", - byteorder="|", -)) -reveal_type(np.recarray( # recarray[Any, dtype[Any]] - shape=(10, 5), - dtype=[("f8", np.float64), ("i8", np.int64)], - strides=(5, 5), -)) - -reveal_type(np.rec.fromarrays( # recarray[Any, dtype[record]] - AR_LIST, -)) -reveal_type(np.rec.fromarrays( # recarray[Any, dtype[Any]] - AR_LIST, - dtype=np.int64, -)) -reveal_type(np.rec.fromarrays( # recarray[Any, dtype[Any]] - AR_LIST, - formats=[np.int64, np.float64], - names=["i8", "f8"] -)) - -reveal_type(np.rec.fromrecords( # recarray[Any, dtype[record]] - (1, 1.5), -)) -reveal_type(np.rec.fromrecords( # recarray[Any, dtype[record]] - [(1, 1.5)], - dtype=[("i8", np.int64), ("f8", np.float64)], -)) -reveal_type(np.rec.fromrecords( # recarray[Any, dtype[record]] - REC_AR_V, - formats=[np.int64, np.float64], - names=["i8", "f8"] -)) - -reveal_type(np.rec.fromstring( # recarray[Any, dtype[record]] - b"(1, 1.5)", - dtype=[("i8", np.int64), ("f8", np.float64)], -)) -reveal_type(np.rec.fromstring( # recarray[Any, dtype[record]] - REC_AR_V, - formats=[np.int64, np.float64], - names=["i8", "f8"] -)) - -reveal_type(np.rec.fromfile( # recarray[Any, dtype[Any]] +assert_type( + np.recarray( + shape=(10, 5), + formats=[np.float64, np.int64, np.bool_], + order="K", + byteorder="|", + ), + np.recarray[Any, np.dtype[np.record]], +) + +assert_type( + np.recarray( + shape=(10, 5), + dtype=[("f8", np.float64), ("i8", np.int64)], + strides=(5, 5), + ), + np.recarray[Any, np.dtype[Any]], +) + +assert_type(np.rec.fromarrays(AR_LIST), np.recarray[Any, np.dtype[Any]]) +assert_type( + np.rec.fromarrays(AR_LIST, dtype=np.int64), + np.recarray[Any, np.dtype[Any]], +) +assert_type( + np.rec.fromarrays( + AR_LIST, + formats=[np.int64, np.float64], + names=["i8", "f8"] + ), + np.recarray[Any, np.dtype[np.record]], +) + +assert_type(np.rec.fromrecords((1, 1.5)), np.recarray[Any, np.dtype[np.record]]) +assert_type( + np.rec.fromrecords( + [(1, 1.5)], + dtype=[("i8", np.int64), ("f8", np.float64)], + ), + np.recarray[Any, np.dtype[np.record]], +) +assert_type( + np.rec.fromrecords( + REC_AR_V, + formats=[np.int64, np.float64], + names=["i8", "f8"] + ), + np.recarray[Any, np.dtype[np.record]], +) + +assert_type( + np.rec.fromstring( + b"(1, 1.5)", + dtype=[("i8", np.int64), ("f8", np.float64)], + ), + np.recarray[Any, np.dtype[np.record]], +) +assert_type( + np.rec.fromstring( + REC_AR_V, + formats=[np.int64, np.float64], + names=["i8", "f8"] + ), + np.recarray[Any, np.dtype[np.record]], +) + +assert_type(np.rec.fromfile( "test_file.txt", dtype=[("i8", np.int64), ("f8", np.float64)], -)) -reveal_type(np.rec.fromfile( # recarray[Any, dtype[record]] - file_obj, - formats=[np.int64, np.float64], - names=["i8", "f8"] -)) - -reveal_type(np.rec.array( # recarray[Any, dtype[{int64}]] - AR_i8, -)) -reveal_type(np.rec.array( # recarray[Any, dtype[Any]] - [(1, 1.5)], - dtype=[("i8", np.int64), ("f8", np.float64)], -)) -reveal_type(np.rec.array( # recarray[Any, dtype[record]] - [(1, 1.5)], - formats=[np.int64, np.float64], - names=["i8", "f8"] -)) - -reveal_type(np.rec.array( # recarray[Any, dtype[Any]] - None, - dtype=np.float64, - shape=(10, 3), -)) -reveal_type(np.rec.array( # recarray[Any, dtype[Any]] - None, - formats=[np.int64, np.float64], - names=["i8", "f8"], - shape=(10, 3), -)) -reveal_type(np.rec.array( # recarray[Any, dtype[Any]] - file_obj, - dtype=np.float64, -)) -reveal_type(np.rec.array( # recarray[Any, dtype[Any]] - file_obj, - formats=[np.int64, np.float64], - names=["i8", "f8"], -)) +), np.recarray[Any, np.dtype[Any]]) + +assert_type( + np.rec.fromfile( + file_obj, + formats=[np.int64, np.float64], + names=["i8", "f8"] + ), + np.recarray[Any, np.dtype[np.record]], +) + +assert_type(np.rec.array(AR_i8), np.recarray[Any, np.dtype[np.int64]]) + +assert_type( + np.rec.array([(1, 1.5)], dtype=[("i8", np.int64), ("f8", np.float64)]), + np.recarray[Any, np.dtype[Any]], +) + +assert_type( + np.rec.array( + [(1, 1.5)], + formats=[np.int64, np.float64], + names=["i8", "f8"] + ), + np.recarray[Any, np.dtype[np.record]], +) + +assert_type( + np.rec.array( + None, + dtype=np.float64, + shape=(10, 3), + ), + np.recarray[Any, np.dtype[Any]], +) + +assert_type( + np.rec.array( + None, + formats=[np.int64, np.float64], + names=["i8", "f8"], + shape=(10, 3), + ), + np.recarray[Any, np.dtype[np.record]], +) + +assert_type( + np.rec.array(file_obj, dtype=np.float64), + np.recarray[Any, np.dtype[Any]], +) + +assert_type( + np.rec.array(file_obj, formats=[np.int64, np.float64], names=["i8", "f8"]), + np.recarray[Any, np.dtype[np.record]], +) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/scalars.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/scalars.pyi index 965aa5ace4..6b134f7432 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/scalars.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/scalars.pyi @@ -1,4 +1,13 @@ +import sys +from typing import Any, Literal + import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type b: np.bool_ u8: np.uint64 @@ -11,146 +20,143 @@ U: np.str_ S: np.bytes_ V: np.void -reveal_type(c8.real) # E: {float32} -reveal_type(c8.imag) # E: {float32} +assert_type(c8.real, np.float32) +assert_type(c8.imag, np.float32) -reveal_type(c8.real.real) # E: {float32} -reveal_type(c8.real.imag) # E: {float32} +assert_type(c8.real.real, np.float32) +assert_type(c8.real.imag, np.float32) -reveal_type(c8.itemsize) # E: int -reveal_type(c8.shape) # E: Tuple[] -reveal_type(c8.strides) # E: Tuple[] +assert_type(c8.itemsize, int) +assert_type(c8.shape, tuple[()]) +assert_type(c8.strides, tuple[()]) -reveal_type(c8.ndim) # E: Literal[0] -reveal_type(c8.size) # E: Literal[1] +assert_type(c8.ndim, Literal[0]) +assert_type(c8.size, Literal[1]) -reveal_type(c8.squeeze()) # E: {complex64} -reveal_type(c8.byteswap()) # E: {complex64} -reveal_type(c8.transpose()) # E: {complex64} +assert_type(c8.squeeze(), np.complex64) +assert_type(c8.byteswap(), np.complex64) +assert_type(c8.transpose(), np.complex64) -reveal_type(c8.dtype) # E: dtype[{complex64}] +assert_type(c8.dtype, np.dtype[np.complex64]) -reveal_type(c8.real) # E: {float32} -reveal_type(c16.imag) # E: {float64} +assert_type(c8.real, np.float32) +assert_type(c16.imag, np.float64) -reveal_type(np.unicode_('foo')) # E: str_ +assert_type(np.str_('foo'), np.str_) -reveal_type(V[0]) # E: Any -reveal_type(V["field1"]) # E: Any -reveal_type(V[["field1", "field2"]]) # E: void +assert_type(V[0], Any) +assert_type(V["field1"], Any) +assert_type(V[["field1", "field2"]], np.void) V[0] = 5 # Aliases -reveal_type(np.unicode_()) # E: str_ -reveal_type(np.string_()) # E: bytes_ - -reveal_type(np.byte()) # E: {byte} -reveal_type(np.short()) # E: {short} -reveal_type(np.intc()) # E: {intc} -reveal_type(np.intp()) # E: {intp} -reveal_type(np.int_()) # E: {int_} -reveal_type(np.longlong()) # E: {longlong} - -reveal_type(np.ubyte()) # E: {ubyte} -reveal_type(np.ushort()) # E: {ushort} -reveal_type(np.uintc()) # E: {uintc} -reveal_type(np.uintp()) # E: {uintp} -reveal_type(np.uint()) # E: {uint} -reveal_type(np.ulonglong()) # E: {ulonglong} - -reveal_type(np.half()) # E: {half} -reveal_type(np.single()) # E: {single} -reveal_type(np.double()) # E: {double} -reveal_type(np.float_()) # E: {double} -reveal_type(np.longdouble()) # E: {longdouble} -reveal_type(np.longfloat()) # E: {longdouble} - -reveal_type(np.csingle()) # E: {csingle} -reveal_type(np.singlecomplex()) # E: {csingle} -reveal_type(np.cdouble()) # E: {cdouble} -reveal_type(np.complex_()) # E: {cdouble} -reveal_type(np.cfloat()) # E: {cdouble} -reveal_type(np.clongdouble()) # E: {clongdouble} -reveal_type(np.clongfloat()) # E: {clongdouble} -reveal_type(np.longcomplex()) # E: {clongdouble} - -reveal_type(b.item()) # E: bool -reveal_type(i8.item()) # E: int -reveal_type(u8.item()) # E: int -reveal_type(f8.item()) # E: float -reveal_type(c16.item()) # E: complex -reveal_type(U.item()) # E: str -reveal_type(S.item()) # E: bytes - -reveal_type(b.tolist()) # E: bool -reveal_type(i8.tolist()) # E: int -reveal_type(u8.tolist()) # E: int -reveal_type(f8.tolist()) # E: float -reveal_type(c16.tolist()) # E: complex -reveal_type(U.tolist()) # E: str -reveal_type(S.tolist()) # E: bytes - -reveal_type(b.ravel()) # E: ndarray[Any, dtype[bool_]] -reveal_type(i8.ravel()) # E: ndarray[Any, dtype[{int64}]] -reveal_type(u8.ravel()) # E: ndarray[Any, dtype[{uint64}]] -reveal_type(f8.ravel()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(c16.ravel()) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(U.ravel()) # E: ndarray[Any, dtype[str_]] -reveal_type(S.ravel()) # E: ndarray[Any, dtype[bytes_]] - -reveal_type(b.flatten()) # E: ndarray[Any, dtype[bool_]] -reveal_type(i8.flatten()) # E: ndarray[Any, dtype[{int64}]] -reveal_type(u8.flatten()) # E: ndarray[Any, dtype[{uint64}]] -reveal_type(f8.flatten()) # E: ndarray[Any, dtype[{float64}]] -reveal_type(c16.flatten()) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(U.flatten()) # E: ndarray[Any, dtype[str_]] -reveal_type(S.flatten()) # E: ndarray[Any, dtype[bytes_]] - -reveal_type(b.reshape(1)) # E: ndarray[Any, dtype[bool_]] -reveal_type(i8.reshape(1)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(u8.reshape(1)) # E: ndarray[Any, dtype[{uint64}]] -reveal_type(f8.reshape(1)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(c16.reshape(1)) # E: ndarray[Any, dtype[{complex128}]] -reveal_type(U.reshape(1)) # E: ndarray[Any, dtype[str_]] -reveal_type(S.reshape(1)) # E: ndarray[Any, dtype[bytes_]] - -reveal_type(i8.astype(float)) # E: Any -reveal_type(i8.astype(np.float64)) # E: {float64} - -reveal_type(i8.view()) # E: {int64} -reveal_type(i8.view(np.float64)) # E: {float64} -reveal_type(i8.view(float)) # E: Any -reveal_type(i8.view(np.float64, np.ndarray)) # E: {float64} - -reveal_type(i8.getfield(float)) # E: Any -reveal_type(i8.getfield(np.float64)) # E: {float64} -reveal_type(i8.getfield(np.float64, 8)) # E: {float64} - -reveal_type(f8.as_integer_ratio()) # E: Tuple[builtins.int, builtins.int] -reveal_type(f8.is_integer()) # E: bool -reveal_type(f8.__trunc__()) # E: int -reveal_type(f8.__getformat__("float")) # E: str -reveal_type(f8.hex()) # E: str -reveal_type(np.float64.fromhex("0x0.0p+0")) # E: {float64} - -reveal_type(f8.__getnewargs__()) # E: Tuple[builtins.float] -reveal_type(c16.__getnewargs__()) # E: Tuple[builtins.float, builtins.float] - -reveal_type(i8.numerator) # E: {int64} -reveal_type(i8.denominator) # E: Literal[1] -reveal_type(u8.numerator) # E: {uint64} -reveal_type(u8.denominator) # E: Literal[1] -reveal_type(m.numerator) # E: timedelta64 -reveal_type(m.denominator) # E: Literal[1] - -reveal_type(round(i8)) # E: int -reveal_type(round(i8, 3)) # E: {int64} -reveal_type(round(u8)) # E: int -reveal_type(round(u8, 3)) # E: {uint64} -reveal_type(round(f8)) # E: int -reveal_type(round(f8, 3)) # E: {float64} - -reveal_type(f8.__ceil__()) # E: int -reveal_type(f8.__floor__()) # E: int - -reveal_type(i8.is_integer()) # E: Literal[True] +assert_type(np.byte(), np.byte) +assert_type(np.short(), np.short) +assert_type(np.intc(), np.intc) +assert_type(np.intp(), np.intp) +assert_type(np.int_(), np.int_) +assert_type(np.longlong(), np.longlong) + +assert_type(np.ubyte(), np.ubyte) +assert_type(np.ushort(), np.ushort) +assert_type(np.uintc(), np.uintc) +assert_type(np.uintp(), np.uintp) +assert_type(np.uint(), np.uint) +assert_type(np.ulonglong(), np.ulonglong) + +assert_type(np.half(), np.half) +assert_type(np.single(), np.single) +assert_type(np.double(), np.double) +assert_type(np.longdouble(), np.longdouble) +assert_type(np.float_(), np.float_) +assert_type(np.longfloat(), np.longfloat) + +assert_type(np.csingle(), np.csingle) +assert_type(np.cdouble(), np.cdouble) +assert_type(np.clongdouble(), np.clongdouble) +assert_type(np.singlecomplex(), np.singlecomplex) +assert_type(np.complex_(), np.complex_) +assert_type(np.cfloat(), np.cfloat) +assert_type(np.clongfloat(), np.clongfloat) +assert_type(np.longcomplex(), np.longcomplex) + +assert_type(b.item(), bool) +assert_type(i8.item(), int) +assert_type(u8.item(), int) +assert_type(f8.item(), float) +assert_type(c16.item(), complex) +assert_type(U.item(), str) +assert_type(S.item(), bytes) + +assert_type(b.tolist(), bool) +assert_type(i8.tolist(), int) +assert_type(u8.tolist(), int) +assert_type(f8.tolist(), float) +assert_type(c16.tolist(), complex) +assert_type(U.tolist(), str) +assert_type(S.tolist(), bytes) + +assert_type(b.ravel(), npt.NDArray[np.bool_]) +assert_type(i8.ravel(), npt.NDArray[np.int64]) +assert_type(u8.ravel(), npt.NDArray[np.uint64]) +assert_type(f8.ravel(), npt.NDArray[np.float64]) +assert_type(c16.ravel(), npt.NDArray[np.complex128]) +assert_type(U.ravel(), npt.NDArray[np.str_]) +assert_type(S.ravel(), npt.NDArray[np.bytes_]) + +assert_type(b.flatten(), npt.NDArray[np.bool_]) +assert_type(i8.flatten(), npt.NDArray[np.int64]) +assert_type(u8.flatten(), npt.NDArray[np.uint64]) +assert_type(f8.flatten(), npt.NDArray[np.float64]) +assert_type(c16.flatten(), npt.NDArray[np.complex128]) +assert_type(U.flatten(), npt.NDArray[np.str_]) +assert_type(S.flatten(), npt.NDArray[np.bytes_]) + +assert_type(b.reshape(1), npt.NDArray[np.bool_]) +assert_type(i8.reshape(1), npt.NDArray[np.int64]) +assert_type(u8.reshape(1), npt.NDArray[np.uint64]) +assert_type(f8.reshape(1), npt.NDArray[np.float64]) +assert_type(c16.reshape(1), npt.NDArray[np.complex128]) +assert_type(U.reshape(1), npt.NDArray[np.str_]) +assert_type(S.reshape(1), npt.NDArray[np.bytes_]) + +assert_type(i8.astype(float), Any) +assert_type(i8.astype(np.float64), np.float64) + +assert_type(i8.view(), np.int64) +assert_type(i8.view(np.float64), np.float64) +assert_type(i8.view(float), Any) +assert_type(i8.view(np.float64, np.ndarray), np.float64) + +assert_type(i8.getfield(float), Any) +assert_type(i8.getfield(np.float64), np.float64) +assert_type(i8.getfield(np.float64, 8), np.float64) + +assert_type(f8.as_integer_ratio(), tuple[int, int]) +assert_type(f8.is_integer(), bool) +assert_type(f8.__trunc__(), int) +assert_type(f8.__getformat__("float"), str) +assert_type(f8.hex(), str) +assert_type(np.float64.fromhex("0x0.0p+0"), np.float64) + +assert_type(f8.__getnewargs__(), tuple[float]) +assert_type(c16.__getnewargs__(), tuple[float, float]) + +assert_type(i8.numerator, np.int64) +assert_type(i8.denominator, Literal[1]) +assert_type(u8.numerator, np.uint64) +assert_type(u8.denominator, Literal[1]) +assert_type(m.numerator, np.timedelta64) +assert_type(m.denominator, Literal[1]) + +assert_type(round(i8), int) +assert_type(round(i8, 3), np.int64) +assert_type(round(u8), int) +assert_type(round(u8, 3), np.uint64) +assert_type(round(f8), int) +assert_type(round(f8, 3), np.float64) + +assert_type(f8.__ceil__(), int) +assert_type(f8.__floor__(), int) + +assert_type(i8.is_integer(), Literal[True]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/shape_base.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/shape_base.pyi index b907a43280..db75d1b015 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/shape_base.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/shape_base.pyi @@ -1,57 +1,65 @@ -import numpy as np -from numpy._typing import NDArray +import sys from typing import Any +import numpy as np +import numpy.typing as npt +from numpy.lib.shape_base import _ArrayPrepare, _ArrayWrap + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + i8: np.int64 f8: np.float64 -AR_b: NDArray[np.bool_] -AR_i8: NDArray[np.int64] -AR_f8: NDArray[np.float64] +AR_b: npt.NDArray[np.bool_] +AR_i8: npt.NDArray[np.int64] +AR_f8: npt.NDArray[np.float64] AR_LIKE_f8: list[float] -reveal_type(np.take_along_axis(AR_f8, AR_i8, axis=1)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.take_along_axis(f8, AR_i8, axis=None)) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.take_along_axis(AR_f8, AR_i8, axis=1), npt.NDArray[np.float64]) +assert_type(np.take_along_axis(f8, AR_i8, axis=None), npt.NDArray[np.float64]) -reveal_type(np.put_along_axis(AR_f8, AR_i8, "1.0", axis=1)) # E: None +assert_type(np.put_along_axis(AR_f8, AR_i8, "1.0", axis=1), None) -reveal_type(np.expand_dims(AR_i8, 2)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.expand_dims(AR_LIKE_f8, 2)) # E: ndarray[Any, dtype[Any]] +assert_type(np.expand_dims(AR_i8, 2), npt.NDArray[np.int64]) +assert_type(np.expand_dims(AR_LIKE_f8, 2), npt.NDArray[Any]) -reveal_type(np.column_stack([AR_i8])) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.column_stack([AR_LIKE_f8])) # E: ndarray[Any, dtype[Any]] +assert_type(np.column_stack([AR_i8]), npt.NDArray[np.int64]) +assert_type(np.column_stack([AR_LIKE_f8]), npt.NDArray[Any]) -reveal_type(np.dstack([AR_i8])) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.dstack([AR_LIKE_f8])) # E: ndarray[Any, dtype[Any]] +assert_type(np.dstack([AR_i8]), npt.NDArray[np.int64]) +assert_type(np.dstack([AR_LIKE_f8]), npt.NDArray[Any]) -reveal_type(np.row_stack([AR_i8])) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.row_stack([AR_LIKE_f8])) # E: ndarray[Any, dtype[Any]] +assert_type(np.row_stack([AR_i8]), npt.NDArray[np.int64]) +assert_type(np.row_stack([AR_LIKE_f8]), npt.NDArray[Any]) -reveal_type(np.array_split(AR_i8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[{int64}]]] -reveal_type(np.array_split(AR_LIKE_f8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[Any]]] +assert_type(np.array_split(AR_i8, [3, 5, 6, 10]), list[npt.NDArray[np.int64]]) +assert_type(np.array_split(AR_LIKE_f8, [3, 5, 6, 10]), list[npt.NDArray[Any]]) -reveal_type(np.split(AR_i8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[{int64}]]] -reveal_type(np.split(AR_LIKE_f8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[Any]]] +assert_type(np.split(AR_i8, [3, 5, 6, 10]), list[npt.NDArray[np.int64]]) +assert_type(np.split(AR_LIKE_f8, [3, 5, 6, 10]), list[npt.NDArray[Any]]) -reveal_type(np.hsplit(AR_i8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[{int64}]]] -reveal_type(np.hsplit(AR_LIKE_f8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[Any]]] +assert_type(np.hsplit(AR_i8, [3, 5, 6, 10]), list[npt.NDArray[np.int64]]) +assert_type(np.hsplit(AR_LIKE_f8, [3, 5, 6, 10]), list[npt.NDArray[Any]]) -reveal_type(np.vsplit(AR_i8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[{int64}]]] -reveal_type(np.vsplit(AR_LIKE_f8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[Any]]] +assert_type(np.vsplit(AR_i8, [3, 5, 6, 10]), list[npt.NDArray[np.int64]]) +assert_type(np.vsplit(AR_LIKE_f8, [3, 5, 6, 10]), list[npt.NDArray[Any]]) -reveal_type(np.dsplit(AR_i8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[{int64}]]] -reveal_type(np.dsplit(AR_LIKE_f8, [3, 5, 6, 10])) # E: list[ndarray[Any, dtype[Any]]] +assert_type(np.dsplit(AR_i8, [3, 5, 6, 10]), list[npt.NDArray[np.int64]]) +assert_type(np.dsplit(AR_LIKE_f8, [3, 5, 6, 10]), list[npt.NDArray[Any]]) -reveal_type(np.lib.shape_base.get_array_prepare(AR_i8)) # E: lib.shape_base._ArrayPrepare -reveal_type(np.lib.shape_base.get_array_prepare(AR_i8, 1)) # E: Union[None, lib.shape_base._ArrayPrepare] +assert_type(np.lib.shape_base.get_array_prepare(AR_i8), _ArrayPrepare) +assert_type(np.lib.shape_base.get_array_prepare(AR_i8, 1), None | _ArrayPrepare) -reveal_type(np.get_array_wrap(AR_i8)) # E: lib.shape_base._ArrayWrap -reveal_type(np.get_array_wrap(AR_i8, 1)) # E: Union[None, lib.shape_base._ArrayWrap] +assert_type(np.get_array_wrap(AR_i8), _ArrayWrap) +assert_type(np.get_array_wrap(AR_i8, 1), None | _ArrayWrap) -reveal_type(np.kron(AR_b, AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.kron(AR_b, AR_i8)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.kron(AR_f8, AR_f8)) # E: ndarray[Any, dtype[floating[Any]]] +assert_type(np.kron(AR_b, AR_b), npt.NDArray[np.bool_]) +assert_type(np.kron(AR_b, AR_i8), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.kron(AR_f8, AR_f8), npt.NDArray[np.floating[Any]]) -reveal_type(np.tile(AR_i8, 5)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.tile(AR_LIKE_f8, [2, 2])) # E: ndarray[Any, dtype[Any]] +assert_type(np.tile(AR_i8, 5), npt.NDArray[np.int64]) +assert_type(np.tile(AR_LIKE_f8, [2, 2]), npt.NDArray[Any]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/stride_tricks.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/stride_tricks.pyi index 17769dc4bb..68e1eeac98 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/stride_tricks.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/stride_tricks.pyi @@ -1,28 +1,36 @@ +import sys from typing import Any + import numpy as np import numpy.typing as npt +from numpy.lib.stride_tricks import DummyArray + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR_f8: npt.NDArray[np.float64] AR_LIKE_f: list[float] interface_dict: dict[str, Any] -reveal_type(np.lib.stride_tricks.DummyArray(interface_dict)) # E: lib.stride_tricks.DummyArray +assert_type(np.lib.stride_tricks.DummyArray(interface_dict), DummyArray) -reveal_type(np.lib.stride_tricks.as_strided(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.lib.stride_tricks.as_strided(AR_LIKE_f)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.lib.stride_tricks.as_strided(AR_f8, strides=(1, 5))) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.lib.stride_tricks.as_strided(AR_f8, shape=[9, 20])) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.lib.stride_tricks.as_strided(AR_f8), npt.NDArray[np.float64]) +assert_type(np.lib.stride_tricks.as_strided(AR_LIKE_f), npt.NDArray[Any]) +assert_type(np.lib.stride_tricks.as_strided(AR_f8, strides=(1, 5)), npt.NDArray[np.float64]) +assert_type(np.lib.stride_tricks.as_strided(AR_f8, shape=[9, 20]), npt.NDArray[np.float64]) -reveal_type(np.lib.stride_tricks.sliding_window_view(AR_f8, 5)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.lib.stride_tricks.sliding_window_view(AR_LIKE_f, (1, 5))) # E: ndarray[Any, dtype[Any]] -reveal_type(np.lib.stride_tricks.sliding_window_view(AR_f8, [9], axis=1)) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.lib.stride_tricks.sliding_window_view(AR_f8, 5), npt.NDArray[np.float64]) +assert_type(np.lib.stride_tricks.sliding_window_view(AR_LIKE_f, (1, 5)), npt.NDArray[Any]) +assert_type(np.lib.stride_tricks.sliding_window_view(AR_f8, [9], axis=1), npt.NDArray[np.float64]) -reveal_type(np.broadcast_to(AR_f8, 5)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.broadcast_to(AR_LIKE_f, (1, 5))) # E: ndarray[Any, dtype[Any]] -reveal_type(np.broadcast_to(AR_f8, [4, 6], subok=True)) # E: ndarray[Any, dtype[{float64}]] +assert_type(np.broadcast_to(AR_f8, 5), npt.NDArray[np.float64]) +assert_type(np.broadcast_to(AR_LIKE_f, (1, 5)), npt.NDArray[Any]) +assert_type(np.broadcast_to(AR_f8, [4, 6], subok=True), npt.NDArray[np.float64]) -reveal_type(np.broadcast_shapes((1, 2), [3, 1], (3, 2))) # E: tuple[builtins.int, ...] -reveal_type(np.broadcast_shapes((6, 7), (5, 6, 1), 7, (5, 1, 7))) # E: tuple[builtins.int, ...] +assert_type(np.broadcast_shapes((1, 2), [3, 1], (3, 2)), tuple[int, ...]) +assert_type(np.broadcast_shapes((6, 7), (5, 6, 1), 7, (5, 1, 7)), tuple[int, ...]) -reveal_type(np.broadcast_arrays(AR_f8, AR_f8)) # E: list[ndarray[Any, dtype[Any]]] -reveal_type(np.broadcast_arrays(AR_f8, AR_LIKE_f)) # E: list[ndarray[Any, dtype[Any]]] +assert_type(np.broadcast_arrays(AR_f8, AR_f8), list[npt.NDArray[Any]]) +assert_type(np.broadcast_arrays(AR_f8, AR_LIKE_f), list[npt.NDArray[Any]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/testing.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/testing.pyi index 5c35731d3b..ecd74e9aa3 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/testing.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/testing.pyi @@ -1,7 +1,9 @@ -from __future__ import annotations - import re import sys +import warnings +import types +import unittest +import contextlib from collections.abc import Callable from typing import Any, TypeVar from pathlib import Path @@ -9,6 +11,11 @@ from pathlib import Path import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + AR_f8: npt.NDArray[np.float64] AR_i8: npt.NDArray[np.int64] @@ -23,154 +30,174 @@ def func2( y: npt.NDArray[np.number[Any]], ) -> npt.NDArray[np.bool_]: ... -reveal_type(np.testing.KnownFailureException()) # E: KnownFailureException -reveal_type(np.testing.IgnoreException()) # E: IgnoreException - -reveal_type(np.testing.clear_and_catch_warnings(modules=[np.testing])) # E: _clear_and_catch_warnings_without_records -reveal_type(np.testing.clear_and_catch_warnings(True)) # E: _clear_and_catch_warnings_with_records -reveal_type(np.testing.clear_and_catch_warnings(False)) # E: _clear_and_catch_warnings_without_records -reveal_type(np.testing.clear_and_catch_warnings(bool_obj)) # E: clear_and_catch_warnings -reveal_type(np.testing.clear_and_catch_warnings.class_modules) # E: tuple[types.ModuleType, ...] -reveal_type(np.testing.clear_and_catch_warnings.modules) # E: set[types.ModuleType] +assert_type(np.testing.KnownFailureException(), np.testing.KnownFailureException) +assert_type(np.testing.IgnoreException(), np.testing.IgnoreException) + +assert_type( + np.testing.clear_and_catch_warnings(modules=[np.testing]), + np.testing._private.utils._clear_and_catch_warnings_without_records, +) +assert_type( + np.testing.clear_and_catch_warnings(True), + np.testing._private.utils._clear_and_catch_warnings_with_records, +) +assert_type( + np.testing.clear_and_catch_warnings(False), + np.testing._private.utils._clear_and_catch_warnings_without_records, +) +assert_type( + np.testing.clear_and_catch_warnings(bool_obj), + np.testing.clear_and_catch_warnings, +) +assert_type( + np.testing.clear_and_catch_warnings.class_modules, + tuple[types.ModuleType, ...], +) +assert_type( + np.testing.clear_and_catch_warnings.modules, + set[types.ModuleType], +) with np.testing.clear_and_catch_warnings(True) as c1: - reveal_type(c1) # E: builtins.list[warnings.WarningMessage] + assert_type(c1, list[warnings.WarningMessage]) with np.testing.clear_and_catch_warnings() as c2: - reveal_type(c2) # E: None + assert_type(c2, None) -reveal_type(np.testing.suppress_warnings("once")) # E: suppress_warnings -reveal_type(np.testing.suppress_warnings()(func)) # E: def () -> builtins.int -reveal_type(suppress_obj.filter(RuntimeWarning)) # E: None -reveal_type(suppress_obj.record(RuntimeWarning)) # E: list[warnings.WarningMessage] +assert_type(np.testing.suppress_warnings("once"), np.testing.suppress_warnings) +assert_type(np.testing.suppress_warnings()(func), Callable[[], int]) +assert_type(suppress_obj.filter(RuntimeWarning), None) +assert_type(suppress_obj.record(RuntimeWarning), list[warnings.WarningMessage]) with suppress_obj as c3: - reveal_type(c3) # E: suppress_warnings + assert_type(c3, np.testing.suppress_warnings) -reveal_type(np.testing.verbose) # E: int -reveal_type(np.testing.IS_PYPY) # E: bool -reveal_type(np.testing.HAS_REFCOUNT) # E: bool -reveal_type(np.testing.HAS_LAPACK64) # E: bool +assert_type(np.testing.verbose, int) +assert_type(np.testing.IS_PYPY, bool) +assert_type(np.testing.HAS_REFCOUNT, bool) +assert_type(np.testing.HAS_LAPACK64, bool) -reveal_type(np.testing.assert_(1, msg="test")) # E: None -reveal_type(np.testing.assert_(2, msg=lambda: "test")) # E: None +assert_type(np.testing.assert_(1, msg="test"), None) +assert_type(np.testing.assert_(2, msg=lambda: "test"), None) if sys.platform == "win32" or sys.platform == "cygwin": - reveal_type(np.testing.memusage()) # E: builtins.int + assert_type(np.testing.memusage(), int) elif sys.platform == "linux": - reveal_type(np.testing.memusage()) # E: Union[None, builtins.int] -else: - reveal_type(np.testing.memusage()) # E: <nothing> + assert_type(np.testing.memusage(), None | int) -reveal_type(np.testing.jiffies()) # E: builtins.int +assert_type(np.testing.jiffies(), int) -reveal_type(np.testing.build_err_msg([0, 1, 2], "test")) # E: str -reveal_type(np.testing.build_err_msg(range(2), "test", header="header")) # E: str -reveal_type(np.testing.build_err_msg(np.arange(9).reshape(3, 3), "test", verbose=False)) # E: str -reveal_type(np.testing.build_err_msg("abc", "test", names=["x", "y"])) # E: str -reveal_type(np.testing.build_err_msg([1.0, 2.0], "test", precision=5)) # E: str +assert_type(np.testing.build_err_msg([0, 1, 2], "test"), str) +assert_type(np.testing.build_err_msg(range(2), "test", header="header"), str) +assert_type(np.testing.build_err_msg(np.arange(9).reshape(3, 3), "test", verbose=False), str) +assert_type(np.testing.build_err_msg("abc", "test", names=["x", "y"]), str) +assert_type(np.testing.build_err_msg([1.0, 2.0], "test", precision=5), str) -reveal_type(np.testing.assert_equal({1}, {1})) # E: None -reveal_type(np.testing.assert_equal([1, 2, 3], [1, 2, 3], err_msg="fail")) # E: None -reveal_type(np.testing.assert_equal(1, 1.0, verbose=True)) # E: None +assert_type(np.testing.assert_equal({1}, {1}), None) +assert_type(np.testing.assert_equal([1, 2, 3], [1, 2, 3], err_msg="fail"), None) +assert_type(np.testing.assert_equal(1, 1.0, verbose=True), None) -reveal_type(np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 1])) # E: None +assert_type(np.testing.print_assert_equal('Test XYZ of func xyz', [0, 1], [0, 1]), None) -reveal_type(np.testing.assert_almost_equal(1.0, 1.1)) # E: None -reveal_type(np.testing.assert_almost_equal([1, 2, 3], [1, 2, 3], err_msg="fail")) # E: None -reveal_type(np.testing.assert_almost_equal(1, 1.0, verbose=True)) # E: None -reveal_type(np.testing.assert_almost_equal(1, 1.0001, decimal=2)) # E: None +assert_type(np.testing.assert_almost_equal(1.0, 1.1), None) +assert_type(np.testing.assert_almost_equal([1, 2, 3], [1, 2, 3], err_msg="fail"), None) +assert_type(np.testing.assert_almost_equal(1, 1.0, verbose=True), None) +assert_type(np.testing.assert_almost_equal(1, 1.0001, decimal=2), None) -reveal_type(np.testing.assert_approx_equal(1.0, 1.1)) # E: None -reveal_type(np.testing.assert_approx_equal("1", "2", err_msg="fail")) # E: None -reveal_type(np.testing.assert_approx_equal(1, 1.0, verbose=True)) # E: None -reveal_type(np.testing.assert_approx_equal(1, 1.0001, significant=2)) # E: None +assert_type(np.testing.assert_approx_equal(1.0, 1.1), None) +assert_type(np.testing.assert_approx_equal("1", "2", err_msg="fail"), None) +assert_type(np.testing.assert_approx_equal(1, 1.0, verbose=True), None) +assert_type(np.testing.assert_approx_equal(1, 1.0001, significant=2), None) -reveal_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, err_msg="test")) # E: None -reveal_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, verbose=True)) # E: None -reveal_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, header="header")) # E: None -reveal_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, precision=np.int64())) # E: None -reveal_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, equal_nan=False)) # E: None -reveal_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, equal_inf=True)) # E: None +assert_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, err_msg="test"), None) +assert_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, verbose=True), None) +assert_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, header="header"), None) +assert_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, precision=np.int64()), None) +assert_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, equal_nan=False), None) +assert_type(np.testing.assert_array_compare(func2, AR_i8, AR_f8, equal_inf=True), None) -reveal_type(np.testing.assert_array_equal(AR_i8, AR_f8)) # E: None -reveal_type(np.testing.assert_array_equal(AR_i8, AR_f8, err_msg="test")) # E: None -reveal_type(np.testing.assert_array_equal(AR_i8, AR_f8, verbose=True)) # E: None +assert_type(np.testing.assert_array_equal(AR_i8, AR_f8), None) +assert_type(np.testing.assert_array_equal(AR_i8, AR_f8, err_msg="test"), None) +assert_type(np.testing.assert_array_equal(AR_i8, AR_f8, verbose=True), None) -reveal_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8)) # E: None -reveal_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8, err_msg="test")) # E: None -reveal_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8, verbose=True)) # E: None -reveal_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8, decimal=1)) # E: None +assert_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8), None) +assert_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8, err_msg="test"), None) +assert_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8, verbose=True), None) +assert_type(np.testing.assert_array_almost_equal(AR_i8, AR_f8, decimal=1), None) -reveal_type(np.testing.assert_array_less(AR_i8, AR_f8)) # E: None -reveal_type(np.testing.assert_array_less(AR_i8, AR_f8, err_msg="test")) # E: None -reveal_type(np.testing.assert_array_less(AR_i8, AR_f8, verbose=True)) # E: None +assert_type(np.testing.assert_array_less(AR_i8, AR_f8), None) +assert_type(np.testing.assert_array_less(AR_i8, AR_f8, err_msg="test"), None) +assert_type(np.testing.assert_array_less(AR_i8, AR_f8, verbose=True), None) -reveal_type(np.testing.runstring("1 + 1", {})) # E: Any -reveal_type(np.testing.runstring("int64() + 1", {"int64": np.int64})) # E: Any +assert_type(np.testing.runstring("1 + 1", {}), Any) +assert_type(np.testing.runstring("int64() + 1", {"int64": np.int64}), Any) -reveal_type(np.testing.assert_string_equal("1", "1")) # E: None +assert_type(np.testing.assert_string_equal("1", "1"), None) -reveal_type(np.testing.rundocs()) # E: None -reveal_type(np.testing.rundocs("test.py")) # E: None -reveal_type(np.testing.rundocs(Path("test.py"), raise_on_error=True)) # E: None +assert_type(np.testing.rundocs(), None) +assert_type(np.testing.rundocs("test.py"), None) +assert_type(np.testing.rundocs(Path("test.py"), raise_on_error=True), None) def func3(a: int) -> bool: ... -reveal_type(func3) # E: def (a: builtins.int) -> builtins.bool - -reveal_type(np.testing.assert_raises(RuntimeWarning)) # E: _AssertRaisesContext[builtins.RuntimeWarning] -reveal_type(np.testing.assert_raises(RuntimeWarning, func3, 5)) # E: None +assert_type( + np.testing.assert_raises(RuntimeWarning), + unittest.case._AssertRaisesContext[RuntimeWarning], +) +assert_type(np.testing.assert_raises(RuntimeWarning, func3, 5), None) -reveal_type(np.testing.assert_raises_regex(RuntimeWarning, r"test")) # E: _AssertRaisesContext[builtins.RuntimeWarning] -reveal_type(np.testing.assert_raises_regex(RuntimeWarning, b"test", func3, 5)) # E: None -reveal_type(np.testing.assert_raises_regex(RuntimeWarning, re.compile(b"test"), func3, 5)) # E: None +assert_type( + np.testing.assert_raises_regex(RuntimeWarning, r"test"), + unittest.case._AssertRaisesContext[RuntimeWarning], +) +assert_type(np.testing.assert_raises_regex(RuntimeWarning, b"test", func3, 5), None) +assert_type(np.testing.assert_raises_regex(RuntimeWarning, re.compile(b"test"), func3, 5), None) class Test: ... def decorate(a: FT) -> FT: return a -reveal_type(np.testing.decorate_methods(Test, decorate)) # E: None -reveal_type(np.testing.decorate_methods(Test, decorate, None)) # E: None -reveal_type(np.testing.decorate_methods(Test, decorate, "test")) # E: None -reveal_type(np.testing.decorate_methods(Test, decorate, b"test")) # E: None -reveal_type(np.testing.decorate_methods(Test, decorate, re.compile("test"))) # E: None +assert_type(np.testing.decorate_methods(Test, decorate), None) +assert_type(np.testing.decorate_methods(Test, decorate, None), None) +assert_type(np.testing.decorate_methods(Test, decorate, "test"), None) +assert_type(np.testing.decorate_methods(Test, decorate, b"test"), None) +assert_type(np.testing.decorate_methods(Test, decorate, re.compile("test")), None) -reveal_type(np.testing.measure("for i in range(1000): np.sqrt(i**2)")) # E: float -reveal_type(np.testing.measure(b"for i in range(1000): np.sqrt(i**2)", times=5)) # E: float +assert_type(np.testing.measure("for i in range(1000): np.sqrt(i**2)"), float) +assert_type(np.testing.measure(b"for i in range(1000): np.sqrt(i**2)", times=5), float) -reveal_type(np.testing.assert_allclose(AR_i8, AR_f8)) # E: None -reveal_type(np.testing.assert_allclose(AR_i8, AR_f8, rtol=0.005)) # E: None -reveal_type(np.testing.assert_allclose(AR_i8, AR_f8, atol=1)) # E: None -reveal_type(np.testing.assert_allclose(AR_i8, AR_f8, equal_nan=True)) # E: None -reveal_type(np.testing.assert_allclose(AR_i8, AR_f8, err_msg="err")) # E: None -reveal_type(np.testing.assert_allclose(AR_i8, AR_f8, verbose=False)) # E: None +assert_type(np.testing.assert_allclose(AR_i8, AR_f8), None) +assert_type(np.testing.assert_allclose(AR_i8, AR_f8, rtol=0.005), None) +assert_type(np.testing.assert_allclose(AR_i8, AR_f8, atol=1), None) +assert_type(np.testing.assert_allclose(AR_i8, AR_f8, equal_nan=True), None) +assert_type(np.testing.assert_allclose(AR_i8, AR_f8, err_msg="err"), None) +assert_type(np.testing.assert_allclose(AR_i8, AR_f8, verbose=False), None) -reveal_type(np.testing.assert_array_almost_equal_nulp(AR_i8, AR_f8, nulp=2)) # E: None +assert_type(np.testing.assert_array_almost_equal_nulp(AR_i8, AR_f8, nulp=2), None) -reveal_type(np.testing.assert_array_max_ulp(AR_i8, AR_f8, maxulp=2)) # E: ndarray[Any, dtype[Any]] -reveal_type(np.testing.assert_array_max_ulp(AR_i8, AR_f8, dtype=np.float32)) # E: ndarray[Any, dtype[Any]] +assert_type(np.testing.assert_array_max_ulp(AR_i8, AR_f8, maxulp=2), npt.NDArray[Any]) +assert_type(np.testing.assert_array_max_ulp(AR_i8, AR_f8, dtype=np.float32), npt.NDArray[Any]) -reveal_type(np.testing.assert_warns(RuntimeWarning)) # E: _GeneratorContextManager[None] -reveal_type(np.testing.assert_warns(RuntimeWarning, func3, 5)) # E: bool +assert_type(np.testing.assert_warns(RuntimeWarning), contextlib._GeneratorContextManager[None]) +assert_type(np.testing.assert_warns(RuntimeWarning, func3, 5), bool) def func4(a: int, b: str) -> bool: ... -reveal_type(np.testing.assert_no_warnings()) # E: _GeneratorContextManager[None] -reveal_type(np.testing.assert_no_warnings(func3, 5)) # E: bool -reveal_type(np.testing.assert_no_warnings(func4, a=1, b="test")) # E: bool -reveal_type(np.testing.assert_no_warnings(func4, 1, "test")) # E: bool +assert_type(np.testing.assert_no_warnings(), contextlib._GeneratorContextManager[None]) +assert_type(np.testing.assert_no_warnings(func3, 5), bool) +assert_type(np.testing.assert_no_warnings(func4, a=1, b="test"), bool) +assert_type(np.testing.assert_no_warnings(func4, 1, "test"), bool) -reveal_type(np.testing.tempdir("test_dir")) # E: _GeneratorContextManager[builtins.str] -reveal_type(np.testing.tempdir(prefix=b"test")) # E: _GeneratorContextManager[builtins.bytes] -reveal_type(np.testing.tempdir("test_dir", dir=Path("here"))) # E: _GeneratorContextManager[builtins.str] +assert_type(np.testing.tempdir("test_dir"), contextlib._GeneratorContextManager[str]) +assert_type(np.testing.tempdir(prefix=b"test"), contextlib._GeneratorContextManager[bytes]) +assert_type(np.testing.tempdir("test_dir", dir=Path("here")), contextlib._GeneratorContextManager[str]) -reveal_type(np.testing.temppath("test_dir", text=True)) # E: _GeneratorContextManager[builtins.str] -reveal_type(np.testing.temppath(prefix=b"test")) # E: _GeneratorContextManager[builtins.bytes] -reveal_type(np.testing.temppath("test_dir", dir=Path("here"))) # E: _GeneratorContextManager[builtins.str] +assert_type(np.testing.temppath("test_dir", text=True), contextlib._GeneratorContextManager[str]) +assert_type(np.testing.temppath(prefix=b"test"), contextlib._GeneratorContextManager[bytes]) +assert_type(np.testing.temppath("test_dir", dir=Path("here")), contextlib._GeneratorContextManager[str]) -reveal_type(np.testing.assert_no_gc_cycles()) # E: _GeneratorContextManager[None] -reveal_type(np.testing.assert_no_gc_cycles(func3, 5)) # E: None +assert_type(np.testing.assert_no_gc_cycles(), contextlib._GeneratorContextManager[None]) +assert_type(np.testing.assert_no_gc_cycles(func3, 5), None) -reveal_type(np.testing.break_cycles()) # E: None +assert_type(np.testing.break_cycles(), None) -reveal_type(np.testing.TestCase()) # E: unittest.case.TestCase +assert_type(np.testing.TestCase(), unittest.case.TestCase) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/twodim_base.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/twodim_base.pyi index 0dc58d4378..506786c787 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/twodim_base.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/twodim_base.pyi @@ -1,8 +1,14 @@ +import sys from typing import Any, TypeVar import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + _SCT = TypeVar("_SCT", bound=np.generic) @@ -23,50 +29,71 @@ AR_O: npt.NDArray[np.object_] AR_LIKE_b: list[bool] -reveal_type(np.fliplr(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.fliplr(AR_LIKE_b)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.flipud(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.flipud(AR_LIKE_b)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.eye(10)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.eye(10, M=20, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.eye(10, k=2, dtype=int)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.diag(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.diag(AR_LIKE_b, k=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.diagflat(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.diagflat(AR_LIKE_b, k=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.tri(10)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.tri(10, M=20, dtype=np.int64)) # E: ndarray[Any, dtype[{int64}]] -reveal_type(np.tri(10, k=2, dtype=int)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.tril(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.tril(AR_LIKE_b, k=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.triu(AR_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.triu(AR_LIKE_b, k=0)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.vander(AR_b)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.vander(AR_u)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.vander(AR_i, N=2)) # E: ndarray[Any, dtype[signedinteger[Any]]] -reveal_type(np.vander(AR_f, increasing=True)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.vander(AR_c)) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.vander(AR_O)) # E: ndarray[Any, dtype[object_]] - -reveal_type(np.histogram2d(AR_i, AR_b)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] -reveal_type(np.histogram2d(AR_f, AR_f)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[floating[Any]]], ndarray[Any, dtype[floating[Any]]]] -reveal_type(np.histogram2d(AR_f, AR_c, weights=AR_LIKE_b)) # E: Tuple[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[complexfloating[Any, Any]]], ndarray[Any, dtype[complexfloating[Any, Any]]]] - -reveal_type(np.mask_indices(10, func1)) # E: Tuple[ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] -reveal_type(np.mask_indices(8, func2, "0")) # E: Tuple[ndarray[Any, dtype[{intp}]], ndarray[Any, dtype[{intp}]]] - -reveal_type(np.tril_indices(10)) # E: Tuple[ndarray[Any, dtype[{int_}]], ndarray[Any, dtype[{int_}]]] - -reveal_type(np.tril_indices_from(AR_b)) # E: Tuple[ndarray[Any, dtype[{int_}]], ndarray[Any, dtype[{int_}]]] - -reveal_type(np.triu_indices(10)) # E: Tuple[ndarray[Any, dtype[{int_}]], ndarray[Any, dtype[{int_}]]] - -reveal_type(np.triu_indices_from(AR_b)) # E: Tuple[ndarray[Any, dtype[{int_}]], ndarray[Any, dtype[{int_}]]] +assert_type(np.fliplr(AR_b), npt.NDArray[np.bool_]) +assert_type(np.fliplr(AR_LIKE_b), npt.NDArray[Any]) + +assert_type(np.flipud(AR_b), npt.NDArray[np.bool_]) +assert_type(np.flipud(AR_LIKE_b), npt.NDArray[Any]) + +assert_type(np.eye(10), npt.NDArray[np.float64]) +assert_type(np.eye(10, M=20, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.eye(10, k=2, dtype=int), npt.NDArray[Any]) + +assert_type(np.diag(AR_b), npt.NDArray[np.bool_]) +assert_type(np.diag(AR_LIKE_b, k=0), npt.NDArray[Any]) + +assert_type(np.diagflat(AR_b), npt.NDArray[np.bool_]) +assert_type(np.diagflat(AR_LIKE_b, k=0), npt.NDArray[Any]) + +assert_type(np.tri(10), npt.NDArray[np.float64]) +assert_type(np.tri(10, M=20, dtype=np.int64), npt.NDArray[np.int64]) +assert_type(np.tri(10, k=2, dtype=int), npt.NDArray[Any]) + +assert_type(np.tril(AR_b), npt.NDArray[np.bool_]) +assert_type(np.tril(AR_LIKE_b, k=0), npt.NDArray[Any]) + +assert_type(np.triu(AR_b), npt.NDArray[np.bool_]) +assert_type(np.triu(AR_LIKE_b, k=0), npt.NDArray[Any]) + +assert_type(np.vander(AR_b), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.vander(AR_u), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.vander(AR_i, N=2), npt.NDArray[np.signedinteger[Any]]) +assert_type(np.vander(AR_f, increasing=True), npt.NDArray[np.floating[Any]]) +assert_type(np.vander(AR_c), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.vander(AR_O), npt.NDArray[np.object_]) + +assert_type( + np.histogram2d(AR_i, AR_b), + tuple[ + npt.NDArray[np.float64], + npt.NDArray[np.floating[Any]], + npt.NDArray[np.floating[Any]], + ], +) +assert_type( + np.histogram2d(AR_f, AR_f), + tuple[ + npt.NDArray[np.float64], + npt.NDArray[np.floating[Any]], + npt.NDArray[np.floating[Any]], + ], +) +assert_type( + np.histogram2d(AR_f, AR_c, weights=AR_LIKE_b), + tuple[ + npt.NDArray[np.float64], + npt.NDArray[np.complexfloating[Any, Any]], + npt.NDArray[np.complexfloating[Any, Any]], + ], +) + +assert_type(np.mask_indices(10, func1), tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]) +assert_type(np.mask_indices(8, func2, "0"), tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]) + +assert_type(np.tril_indices(10), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]]) + +assert_type(np.tril_indices_from(AR_b), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]]) + +assert_type(np.triu_indices(10), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]]) + +assert_type(np.triu_indices_from(AR_b), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/type_check.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/type_check.pyi index ddd319a94a..12af9a66d9 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/type_check.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/type_check.pyi @@ -1,6 +1,14 @@ +import sys +from typing import Any, Literal + import numpy as np import numpy.typing as npt -from numpy._typing import _128Bit +from numpy._typing import _16Bit, _32Bit, _64Bit, _128Bit + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type f8: np.float64 f: float @@ -22,52 +30,58 @@ class RealObj: class ImagObj: imag: slice -reveal_type(np.mintypecode(["f8"], typeset="qfQF")) - -reveal_type(np.asfarray(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asfarray(AR_LIKE_f)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.asfarray(AR_f8, dtype="c16")) # E: ndarray[Any, dtype[complexfloating[Any, Any]]] -reveal_type(np.asfarray(AR_f8, dtype="i8")) # E: ndarray[Any, dtype[floating[Any]]] - -reveal_type(np.real(RealObj())) # E: slice -reveal_type(np.real(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.real(AR_c16)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.real(AR_LIKE_f)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.imag(ImagObj())) # E: slice -reveal_type(np.imag(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.imag(AR_c16)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.imag(AR_LIKE_f)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.iscomplex(f8)) # E: bool_ -reveal_type(np.iscomplex(AR_f8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.iscomplex(AR_LIKE_f)) # E: ndarray[Any, dtype[bool_]] - -reveal_type(np.isreal(f8)) # E: bool_ -reveal_type(np.isreal(AR_f8)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isreal(AR_LIKE_f)) # E: ndarray[Any, dtype[bool_]] - -reveal_type(np.iscomplexobj(f8)) # E: bool -reveal_type(np.isrealobj(f8)) # E: bool - -reveal_type(np.nan_to_num(f8)) # E: {float64} -reveal_type(np.nan_to_num(f, copy=True)) # E: Any -reveal_type(np.nan_to_num(AR_f8, nan=1.5)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.nan_to_num(AR_LIKE_f, posinf=9999)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.real_if_close(AR_f8)) # E: ndarray[Any, dtype[{float64}]] -reveal_type(np.real_if_close(AR_c16)) # E: Union[ndarray[Any, dtype[{float64}]], ndarray[Any, dtype[{complex128}]]] -reveal_type(np.real_if_close(AR_c8)) # E: Union[ndarray[Any, dtype[{float32}]], ndarray[Any, dtype[{complex64}]]] -reveal_type(np.real_if_close(AR_LIKE_f)) # E: ndarray[Any, dtype[Any]] - -reveal_type(np.typename("h")) # E: Literal['short'] -reveal_type(np.typename("B")) # E: Literal['unsigned char'] -reveal_type(np.typename("V")) # E: Literal['void'] -reveal_type(np.typename("S1")) # E: Literal['character'] - -reveal_type(np.common_type(AR_i4)) # E: Type[{float64}] -reveal_type(np.common_type(AR_f2)) # E: Type[{float16}] -reveal_type(np.common_type(AR_f2, AR_i4)) # E: Type[{float64}] -reveal_type(np.common_type(AR_f16, AR_i4)) # E: Type[{float128}] -reveal_type(np.common_type(AR_c8, AR_f2)) # E: Type[{complex64}] -reveal_type(np.common_type(AR_f2, AR_c8, AR_i4)) # E: Type[{complex128}] +assert_type(np.mintypecode(["f8"], typeset="qfQF"), str) + +assert_type(np.asfarray(AR_f8), npt.NDArray[np.float64]) +assert_type(np.asfarray(AR_LIKE_f), npt.NDArray[np.float64]) +assert_type(np.asfarray(AR_f8, dtype="c16"), npt.NDArray[np.complexfloating[Any, Any]]) +assert_type(np.asfarray(AR_f8, dtype="i8"), npt.NDArray[np.floating[Any]]) + +assert_type(np.real(RealObj()), slice) +assert_type(np.real(AR_f8), npt.NDArray[np.float64]) +assert_type(np.real(AR_c16), npt.NDArray[np.float64]) +assert_type(np.real(AR_LIKE_f), npt.NDArray[Any]) + +assert_type(np.imag(ImagObj()), slice) +assert_type(np.imag(AR_f8), npt.NDArray[np.float64]) +assert_type(np.imag(AR_c16), npt.NDArray[np.float64]) +assert_type(np.imag(AR_LIKE_f), npt.NDArray[Any]) + +assert_type(np.iscomplex(f8), np.bool_) +assert_type(np.iscomplex(AR_f8), npt.NDArray[np.bool_]) +assert_type(np.iscomplex(AR_LIKE_f), npt.NDArray[np.bool_]) + +assert_type(np.isreal(f8), np.bool_) +assert_type(np.isreal(AR_f8), npt.NDArray[np.bool_]) +assert_type(np.isreal(AR_LIKE_f), npt.NDArray[np.bool_]) + +assert_type(np.iscomplexobj(f8), bool) +assert_type(np.isrealobj(f8), bool) + +assert_type(np.nan_to_num(f8), np.float64) +assert_type(np.nan_to_num(f, copy=True), Any) +assert_type(np.nan_to_num(AR_f8, nan=1.5), npt.NDArray[np.float64]) +assert_type(np.nan_to_num(AR_LIKE_f, posinf=9999), npt.NDArray[Any]) + +assert_type(np.real_if_close(AR_f8), npt.NDArray[np.float64]) +assert_type(np.real_if_close(AR_c16), npt.NDArray[np.float64] | npt.NDArray[np.complex128]) +assert_type(np.real_if_close(AR_c8), npt.NDArray[np.float32] | npt.NDArray[np.complex64]) +assert_type(np.real_if_close(AR_LIKE_f), npt.NDArray[Any]) + +assert_type(np.typename("h"), Literal["short"]) +assert_type(np.typename("B"), Literal["unsigned char"]) +assert_type(np.typename("V"), Literal["void"]) +assert_type(np.typename("S1"), Literal["character"]) + +assert_type(np.common_type(AR_i4), type[np.float64]) +assert_type(np.common_type(AR_f2), type[np.float16]) +assert_type(np.common_type(AR_f2, AR_i4), type[np.floating[_16Bit | _64Bit]]) +assert_type(np.common_type(AR_f16, AR_i4), type[np.floating[_64Bit | _128Bit]]) +assert_type( + np.common_type(AR_c8, AR_f2), + type[np.complexfloating[_16Bit | _32Bit, _16Bit | _32Bit]], +) +assert_type( + np.common_type(AR_f2, AR_c8, AR_i4), + type[np.complexfloating[_16Bit | _32Bit | _64Bit, _16Bit | _32Bit | _64Bit]], +) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunc_config.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunc_config.pyi index 2c6fadf923..38474f1e73 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunc_config.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunc_config.pyi @@ -1,25 +1,41 @@ """Typing tests for `core._ufunc_config`.""" +import sys +from typing import Any, Protocol +from collections.abc import Callable + import numpy as np +from numpy.core._ufunc_config import _ErrDict + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type def func(a: str, b: int) -> None: ... +class FuncProtocol(Protocol): + def __call__(self, a: str, b: int) -> None: ... + class Write: def write(self, value: str) -> None: ... -reveal_type(np.seterr(all=None)) # E: TypedDict('core._ufunc_config._ErrDict' -reveal_type(np.seterr(divide="ignore")) # E: TypedDict('core._ufunc_config._ErrDict' -reveal_type(np.seterr(over="warn")) # E: TypedDict('core._ufunc_config._ErrDict' -reveal_type(np.seterr(under="call")) # E: TypedDict('core._ufunc_config._ErrDict' -reveal_type(np.seterr(invalid="raise")) # E: TypedDict('core._ufunc_config._ErrDict' -reveal_type(np.geterr()) # E: TypedDict('core._ufunc_config._ErrDict' +class SupportsWrite(Protocol): + def write(self, s: str, /) -> object: ... + +assert_type(np.seterr(all=None), _ErrDict) +assert_type(np.seterr(divide="ignore"), _ErrDict) +assert_type(np.seterr(over="warn"), _ErrDict) +assert_type(np.seterr(under="call"), _ErrDict) +assert_type(np.seterr(invalid="raise"), _ErrDict) +assert_type(np.geterr(), _ErrDict) -reveal_type(np.setbufsize(4096)) # E: int -reveal_type(np.getbufsize()) # E: int +assert_type(np.setbufsize(4096), int) +assert_type(np.getbufsize(), int) -reveal_type(np.seterrcall(func)) # E: Union[None, def (builtins.str, builtins.int) -> Any, _SupportsWrite[builtins.str]] -reveal_type(np.seterrcall(Write())) # E: Union[None, def (builtins.str, builtins.int) -> Any, _SupportsWrite[builtins.str]] -reveal_type(np.geterrcall()) # E: Union[None, def (builtins.str, builtins.int) -> Any, _SupportsWrite[builtins.str]] +assert_type(np.seterrcall(func), Callable[[str, int], Any] | None | SupportsWrite) +assert_type(np.seterrcall(Write()), Callable[[str, int], Any] | None | SupportsWrite) +assert_type(np.geterrcall(), Callable[[str, int], Any] | None | SupportsWrite) -reveal_type(np.errstate(call=func, all="call")) # E: errstate[def (a: builtins.str, b: builtins.int)] -reveal_type(np.errstate(call=Write(), divide="log", over="log")) # E: errstate[ufunc_config.Write] +assert_type(np.errstate(call=func, all="call"), np.errstate[FuncProtocol]) +assert_type(np.errstate(call=Write(), divide="log", over="log"), np.errstate[Write]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunclike.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunclike.pyi index 9f06600b64..5f7a03eb62 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunclike.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufunclike.pyi @@ -1,5 +1,13 @@ +import sys from typing import Any + import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type AR_LIKE_b: list[bool] AR_LIKE_u: list[np.uint32] @@ -7,23 +15,23 @@ AR_LIKE_i: list[int] AR_LIKE_f: list[float] AR_LIKE_O: list[np.object_] -AR_U: np.ndarray[Any, np.dtype[np.str_]] +AR_U: npt.NDArray[np.str_] -reveal_type(np.fix(AR_LIKE_b)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.fix(AR_LIKE_u)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.fix(AR_LIKE_i)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.fix(AR_LIKE_f)) # E: ndarray[Any, dtype[floating[Any]]] -reveal_type(np.fix(AR_LIKE_O)) # E: Any -reveal_type(np.fix(AR_LIKE_f, out=AR_U)) # E: ndarray[Any, dtype[str_]] +assert_type(np.fix(AR_LIKE_b), npt.NDArray[np.floating[Any]]) +assert_type(np.fix(AR_LIKE_u), npt.NDArray[np.floating[Any]]) +assert_type(np.fix(AR_LIKE_i), npt.NDArray[np.floating[Any]]) +assert_type(np.fix(AR_LIKE_f), npt.NDArray[np.floating[Any]]) +assert_type(np.fix(AR_LIKE_O), npt.NDArray[np.object_]) +assert_type(np.fix(AR_LIKE_f, out=AR_U), npt.NDArray[np.str_]) -reveal_type(np.isposinf(AR_LIKE_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isposinf(AR_LIKE_u)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isposinf(AR_LIKE_i)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isposinf(AR_LIKE_f)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isposinf(AR_LIKE_f, out=AR_U)) # E: ndarray[Any, dtype[str_]] +assert_type(np.isposinf(AR_LIKE_b), npt.NDArray[np.bool_]) +assert_type(np.isposinf(AR_LIKE_u), npt.NDArray[np.bool_]) +assert_type(np.isposinf(AR_LIKE_i), npt.NDArray[np.bool_]) +assert_type(np.isposinf(AR_LIKE_f), npt.NDArray[np.bool_]) +assert_type(np.isposinf(AR_LIKE_f, out=AR_U), npt.NDArray[np.str_]) -reveal_type(np.isneginf(AR_LIKE_b)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isneginf(AR_LIKE_u)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isneginf(AR_LIKE_i)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isneginf(AR_LIKE_f)) # E: ndarray[Any, dtype[bool_]] -reveal_type(np.isneginf(AR_LIKE_f, out=AR_U)) # E: ndarray[Any, dtype[str_]] +assert_type(np.isneginf(AR_LIKE_b), npt.NDArray[np.bool_]) +assert_type(np.isneginf(AR_LIKE_u), npt.NDArray[np.bool_]) +assert_type(np.isneginf(AR_LIKE_i), npt.NDArray[np.bool_]) +assert_type(np.isneginf(AR_LIKE_f), npt.NDArray[np.bool_]) +assert_type(np.isneginf(AR_LIKE_f, out=AR_U), npt.NDArray[np.str_]) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufuncs.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufuncs.pyi index 3bf83c8207..5f7d99efd1 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufuncs.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/ufuncs.pyi @@ -1,68 +1,76 @@ +import sys +from typing import Literal, Any + import numpy as np import numpy.typing as npt +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + f8: np.float64 AR_f8: npt.NDArray[np.float64] AR_i8: npt.NDArray[np.int64] -reveal_type(np.absolute.__doc__) # E: str -reveal_type(np.absolute.types) # E: builtins.list[builtins.str] +assert_type(np.absolute.__doc__, str) +assert_type(np.absolute.types, list[str]) -reveal_type(np.absolute.__name__) # E: Literal['absolute'] -reveal_type(np.absolute.ntypes) # E: Literal[20] -reveal_type(np.absolute.identity) # E: None -reveal_type(np.absolute.nin) # E: Literal[1] -reveal_type(np.absolute.nin) # E: Literal[1] -reveal_type(np.absolute.nout) # E: Literal[1] -reveal_type(np.absolute.nargs) # E: Literal[2] -reveal_type(np.absolute.signature) # E: None -reveal_type(np.absolute(f8)) # E: Any -reveal_type(np.absolute(AR_f8)) # E: ndarray -reveal_type(np.absolute.at(AR_f8, AR_i8)) # E: None +assert_type(np.absolute.__name__, Literal["absolute"]) +assert_type(np.absolute.ntypes, Literal[20]) +assert_type(np.absolute.identity, None) +assert_type(np.absolute.nin, Literal[1]) +assert_type(np.absolute.nin, Literal[1]) +assert_type(np.absolute.nout, Literal[1]) +assert_type(np.absolute.nargs, Literal[2]) +assert_type(np.absolute.signature, None) +assert_type(np.absolute(f8), Any) +assert_type(np.absolute(AR_f8), npt.NDArray[Any]) +assert_type(np.absolute.at(AR_f8, AR_i8), None) -reveal_type(np.add.__name__) # E: Literal['add'] -reveal_type(np.add.ntypes) # E: Literal[22] -reveal_type(np.add.identity) # E: Literal[0] -reveal_type(np.add.nin) # E: Literal[2] -reveal_type(np.add.nout) # E: Literal[1] -reveal_type(np.add.nargs) # E: Literal[3] -reveal_type(np.add.signature) # E: None -reveal_type(np.add(f8, f8)) # E: Any -reveal_type(np.add(AR_f8, f8)) # E: ndarray -reveal_type(np.add.at(AR_f8, AR_i8, f8)) # E: None -reveal_type(np.add.reduce(AR_f8, axis=0)) # E: Any -reveal_type(np.add.accumulate(AR_f8)) # E: ndarray -reveal_type(np.add.reduceat(AR_f8, AR_i8)) # E: ndarray -reveal_type(np.add.outer(f8, f8)) # E: Any -reveal_type(np.add.outer(AR_f8, f8)) # E: ndarray +assert_type(np.add.__name__, Literal["add"]) +assert_type(np.add.ntypes, Literal[22]) +assert_type(np.add.identity, Literal[0]) +assert_type(np.add.nin, Literal[2]) +assert_type(np.add.nout, Literal[1]) +assert_type(np.add.nargs, Literal[3]) +assert_type(np.add.signature, None) +assert_type(np.add(f8, f8), Any) +assert_type(np.add(AR_f8, f8), npt.NDArray[Any]) +assert_type(np.add.at(AR_f8, AR_i8, f8), None) +assert_type(np.add.reduce(AR_f8, axis=0), Any) +assert_type(np.add.accumulate(AR_f8), npt.NDArray[Any]) +assert_type(np.add.reduceat(AR_f8, AR_i8), npt.NDArray[Any]) +assert_type(np.add.outer(f8, f8), Any) +assert_type(np.add.outer(AR_f8, f8), npt.NDArray[Any]) -reveal_type(np.frexp.__name__) # E: Literal['frexp'] -reveal_type(np.frexp.ntypes) # E: Literal[4] -reveal_type(np.frexp.identity) # E: None -reveal_type(np.frexp.nin) # E: Literal[1] -reveal_type(np.frexp.nout) # E: Literal[2] -reveal_type(np.frexp.nargs) # E: Literal[3] -reveal_type(np.frexp.signature) # E: None -reveal_type(np.frexp(f8)) # E: Tuple[Any, Any] -reveal_type(np.frexp(AR_f8)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] +assert_type(np.frexp.__name__, Literal["frexp"]) +assert_type(np.frexp.ntypes, Literal[4]) +assert_type(np.frexp.identity, None) +assert_type(np.frexp.nin, Literal[1]) +assert_type(np.frexp.nout, Literal[2]) +assert_type(np.frexp.nargs, Literal[3]) +assert_type(np.frexp.signature, None) +assert_type(np.frexp(f8), tuple[Any, Any]) +assert_type(np.frexp(AR_f8), tuple[npt.NDArray[Any], npt.NDArray[Any]]) -reveal_type(np.divmod.__name__) # E: Literal['divmod'] -reveal_type(np.divmod.ntypes) # E: Literal[15] -reveal_type(np.divmod.identity) # E: None -reveal_type(np.divmod.nin) # E: Literal[2] -reveal_type(np.divmod.nout) # E: Literal[2] -reveal_type(np.divmod.nargs) # E: Literal[4] -reveal_type(np.divmod.signature) # E: None -reveal_type(np.divmod(f8, f8)) # E: Tuple[Any, Any] -reveal_type(np.divmod(AR_f8, f8)) # E: Tuple[ndarray[Any, dtype[Any]], ndarray[Any, dtype[Any]]] +assert_type(np.divmod.__name__, Literal["divmod"]) +assert_type(np.divmod.ntypes, Literal[15]) +assert_type(np.divmod.identity, None) +assert_type(np.divmod.nin, Literal[2]) +assert_type(np.divmod.nout, Literal[2]) +assert_type(np.divmod.nargs, Literal[4]) +assert_type(np.divmod.signature, None) +assert_type(np.divmod(f8, f8), tuple[Any, Any]) +assert_type(np.divmod(AR_f8, f8), tuple[npt.NDArray[Any], npt.NDArray[Any]]) -reveal_type(np.matmul.__name__) # E: Literal['matmul'] -reveal_type(np.matmul.ntypes) # E: Literal[19] -reveal_type(np.matmul.identity) # E: None -reveal_type(np.matmul.nin) # E: Literal[2] -reveal_type(np.matmul.nout) # E: Literal[1] -reveal_type(np.matmul.nargs) # E: Literal[3] -reveal_type(np.matmul.signature) # E: Literal['(n?,k),(k,m?)->(n?,m?)'] -reveal_type(np.matmul.identity) # E: None -reveal_type(np.matmul(AR_f8, AR_f8)) # E: Any -reveal_type(np.matmul(AR_f8, AR_f8, axes=[(0, 1), (0, 1), (0, 1)])) # E: Any +assert_type(np.matmul.__name__, Literal["matmul"]) +assert_type(np.matmul.ntypes, Literal[19]) +assert_type(np.matmul.identity, None) +assert_type(np.matmul.nin, Literal[2]) +assert_type(np.matmul.nout, Literal[1]) +assert_type(np.matmul.nargs, Literal[3]) +assert_type(np.matmul.signature, Literal["(n?,k),(k,m?)->(n?,m?)"]) +assert_type(np.matmul.identity, None) +assert_type(np.matmul(AR_f8, AR_f8), Any) +assert_type(np.matmul(AR_f8, AR_f8, axes=[(0, 1), (0, 1), (0, 1)]), Any) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/version.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/version.pyi deleted file mode 100644 index e538376476..0000000000 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/version.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import numpy.version - -reveal_type(numpy.version.version) # E: str -reveal_type(numpy.version.__version__) # E: str -reveal_type(numpy.version.full_version) # E: str -reveal_type(numpy.version.git_revision) # E: str -reveal_type(numpy.version.release) # E: bool -reveal_type(numpy.version.short_version) # E: str diff --git a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/warnings_and_errors.pyi b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/warnings_and_errors.pyi index 19fa432f91..b026e4f6e3 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/warnings_and_errors.pyi +++ b/contrib/python/numpy/py3/numpy/typing/tests/data/reveal/warnings_and_errors.pyi @@ -1,9 +1,16 @@ +import sys + import numpy as np -reveal_type(np.ModuleDeprecationWarning()) # E: ModuleDeprecationWarning -reveal_type(np.VisibleDeprecationWarning()) # E: VisibleDeprecationWarning -reveal_type(np.ComplexWarning()) # E: ComplexWarning -reveal_type(np.RankWarning()) # E: RankWarning -reveal_type(np.TooHardError()) # E: TooHardError -reveal_type(np.AxisError("test")) # E: AxisError -reveal_type(np.AxisError(5, 1)) # E: AxisError +if sys.version_info >= (3, 11): + from typing import assert_type +else: + from typing_extensions import assert_type + +assert_type(np.ModuleDeprecationWarning(), np.ModuleDeprecationWarning) +assert_type(np.VisibleDeprecationWarning(), np.VisibleDeprecationWarning) +assert_type(np.ComplexWarning(), np.ComplexWarning) +assert_type(np.RankWarning(), np.RankWarning) +assert_type(np.TooHardError(), np.TooHardError) +assert_type(np.AxisError("test"), np.AxisError) +assert_type(np.AxisError(5, 1), np.AxisError) diff --git a/contrib/python/numpy/py3/numpy/typing/tests/test_isfile.py b/contrib/python/numpy/py3/numpy/typing/tests/test_isfile.py index a898b3e285..2ca2c9b21f 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/test_isfile.py +++ b/contrib/python/numpy/py3/numpy/typing/tests/test_isfile.py @@ -1,4 +1,5 @@ import os +import sys from pathlib import Path import numpy as np @@ -10,7 +11,6 @@ FILES = [ ROOT / "__init__.pyi", ROOT / "ctypeslib.pyi", ROOT / "core" / "__init__.pyi", - ROOT / "distutils" / "__init__.pyi", ROOT / "f2py" / "__init__.pyi", ROOT / "fft" / "__init__.pyi", ROOT / "lib" / "__init__.pyi", @@ -21,6 +21,8 @@ FILES = [ ROOT / "random" / "__init__.pyi", ROOT / "testing" / "__init__.pyi", ] +if sys.version_info < (3, 12): + FILES += [ROOT / "distutils" / "__init__.pyi"] class TestIsFile: diff --git a/contrib/python/numpy/py3/numpy/typing/tests/test_typing.py b/contrib/python/numpy/py3/numpy/typing/tests/test_typing.py index bcaaf5250c..68c6f5d03f 100644 --- a/contrib/python/numpy/py3/numpy/typing/tests/test_typing.py +++ b/contrib/python/numpy/py3/numpy/typing/tests/test_typing.py @@ -1,23 +1,45 @@ from __future__ import annotations import importlib.util -import itertools import os import re import shutil from collections import defaultdict from collections.abc import Iterator -from typing import IO, TYPE_CHECKING +from typing import TYPE_CHECKING import pytest -import numpy as np -import numpy.typing as npt -from numpy.typing.mypy_plugin import ( - _PRECISION_DICT, - _EXTENDED_PRECISION_LIST, - _C_INTP, +from numpy.typing.mypy_plugin import _EXTENDED_PRECISION_LIST + + +# Only trigger a full `mypy` run if this environment variable is set +# Note that these tests tend to take over a minute even on a macOS M1 CPU, +# and more than that in CI. +RUN_MYPY = "NPY_RUN_MYPY_IN_TESTSUITE" in os.environ +if RUN_MYPY and RUN_MYPY not in ('0', '', 'false'): + RUN_MYPY = True + +# Skips all functions in this file +pytestmark = pytest.mark.skipif( + not RUN_MYPY, + reason="`NPY_RUN_MYPY_IN_TESTSUITE` not set" ) + +# Only trigger a full `mypy` run if this environment variable is set +# Note that these tests tend to take over a minute even on a macOS M1 CPU, +# and more than that in CI. +RUN_MYPY = "NPY_RUN_MYPY_IN_TESTSUITE" in os.environ +if RUN_MYPY and RUN_MYPY not in ('0', '', 'false'): + RUN_MYPY = True + +# Skips all functions in this file +pytestmark = pytest.mark.skipif( + not RUN_MYPY, + reason="`NPY_RUN_MYPY_IN_TESTSUITE` not set" +) + + try: from mypy import api except ImportError: @@ -40,7 +62,7 @@ CACHE_DIR = os.path.join(DATA_DIR, ".mypy_cache") #: A dictionary with file names as keys and lists of the mypy stdout as values. #: To-be populated by `run_mypy`. -OUTPUT_MYPY: dict[str, list[str]] = {} +OUTPUT_MYPY: defaultdict[str, list[str]] = defaultdict(list) def _key_func(key: str) -> str: @@ -52,10 +74,11 @@ def _key_func(key: str) -> str: return os.path.join(drive, tail.split(":", 1)[0]) -def _strip_filename(msg: str) -> str: - """Strip the filename from a mypy message.""" +def _strip_filename(msg: str) -> tuple[int, str]: + """Strip the filename and line number from a mypy message.""" _, tail = os.path.splitdrive(msg) - return tail.split(":", 1)[-1] + _, lineno, msg = tail.split(":", 2) + return int(lineno), msg.strip() def strip_func(match: re.Match[str]) -> str: @@ -81,6 +104,7 @@ def run_mypy() -> None: ): shutil.rmtree(CACHE_DIR) + split_pattern = re.compile(r"(\s+)?\^(\~+)?") for directory in (PASS_DIR, REVEAL_DIR, FAIL_DIR, MISC_DIR): # Run mypy stdout, stderr, exit_code = api.run([ @@ -94,11 +118,20 @@ def run_mypy() -> None: pytest.fail(f"Unexpected mypy standard error\n\n{stderr}") elif exit_code not in {0, 1}: pytest.fail(f"Unexpected mypy exit code: {exit_code}\n\n{stdout}") - stdout = stdout.replace('*', '') - # Parse the output - iterator = itertools.groupby(stdout.split("\n"), key=_key_func) - OUTPUT_MYPY.update((k, list(v)) for k, v in iterator if k) + str_concat = "" + filename: str | None = None + for i in stdout.split("\n"): + if "note:" in i: + continue + if filename is None: + filename = _key_func(i) + + str_concat += f"{i}\n" + if split_pattern.match(i) is not None: + OUTPUT_MYPY[filename].append(str_concat) + str_concat = "" + filename = None def get_test_cases(directory: str) -> Iterator[ParameterSet]: @@ -118,7 +151,7 @@ def test_success(path) -> None: output_mypy = OUTPUT_MYPY if path in output_mypy: msg = "Unexpected mypy output\n\n" - msg += "\n".join(_strip_filename(v) for v in output_mypy[path]) + msg += "\n".join(_strip_filename(v)[1] for v in output_mypy[path]) raise AssertionError(msg) @@ -135,15 +168,9 @@ def test_fail(path: str) -> None: output_mypy = OUTPUT_MYPY assert path in output_mypy + for error_line in output_mypy[path]: - error_line = _strip_filename(error_line).split("\n", 1)[0] - match = re.match( - r"(?P<lineno>\d+): (error|note): .+$", - error_line, - ) - if match is None: - raise ValueError(f"Unexpected error line format: {error_line}") - lineno = int(match.group('lineno')) + lineno, error_line = _strip_filename(error_line) errors[lineno] += f'{error_line}\n' for i, line in enumerate(lines): @@ -175,7 +202,7 @@ Extra error: {!r} _FAIL_MSG2 = """Error mismatch at line {} Expression: {} -Expected error: {!r} +Expected error: {} Observed error: {!r} """ @@ -195,141 +222,10 @@ def _test_fail( )) -def _construct_ctypes_dict() -> dict[str, str]: - dct = { - "ubyte": "c_ubyte", - "ushort": "c_ushort", - "uintc": "c_uint", - "uint": "c_ulong", - "ulonglong": "c_ulonglong", - "byte": "c_byte", - "short": "c_short", - "intc": "c_int", - "int_": "c_long", - "longlong": "c_longlong", - "single": "c_float", - "double": "c_double", - "longdouble": "c_longdouble", - } - - # Match `ctypes` names to the first ctypes type with a given kind and - # precision, e.g. {"c_double": "c_double", "c_longdouble": "c_double"} - # if both types represent 64-bit floats. - # In this context "first" is defined by the order of `dct` - ret = {} - visited: dict[tuple[str, int], str] = {} - for np_name, ct_name in dct.items(): - np_scalar = getattr(np, np_name)() - - # Find the first `ctypes` type for a given `kind`/`itemsize` combo - key = (np_scalar.dtype.kind, np_scalar.dtype.itemsize) - ret[ct_name] = visited.setdefault(key, f"ctypes.{ct_name}") - return ret - - -def _construct_format_dict() -> dict[str, str]: - dct = {k.split(".")[-1]: v.replace("numpy", "numpy._typing") for - k, v in _PRECISION_DICT.items()} - - return { - "uint8": "numpy.unsignedinteger[numpy._typing._8Bit]", - "uint16": "numpy.unsignedinteger[numpy._typing._16Bit]", - "uint32": "numpy.unsignedinteger[numpy._typing._32Bit]", - "uint64": "numpy.unsignedinteger[numpy._typing._64Bit]", - "uint128": "numpy.unsignedinteger[numpy._typing._128Bit]", - "uint256": "numpy.unsignedinteger[numpy._typing._256Bit]", - "int8": "numpy.signedinteger[numpy._typing._8Bit]", - "int16": "numpy.signedinteger[numpy._typing._16Bit]", - "int32": "numpy.signedinteger[numpy._typing._32Bit]", - "int64": "numpy.signedinteger[numpy._typing._64Bit]", - "int128": "numpy.signedinteger[numpy._typing._128Bit]", - "int256": "numpy.signedinteger[numpy._typing._256Bit]", - "float16": "numpy.floating[numpy._typing._16Bit]", - "float32": "numpy.floating[numpy._typing._32Bit]", - "float64": "numpy.floating[numpy._typing._64Bit]", - "float80": "numpy.floating[numpy._typing._80Bit]", - "float96": "numpy.floating[numpy._typing._96Bit]", - "float128": "numpy.floating[numpy._typing._128Bit]", - "float256": "numpy.floating[numpy._typing._256Bit]", - "complex64": ("numpy.complexfloating" - "[numpy._typing._32Bit, numpy._typing._32Bit]"), - "complex128": ("numpy.complexfloating" - "[numpy._typing._64Bit, numpy._typing._64Bit]"), - "complex160": ("numpy.complexfloating" - "[numpy._typing._80Bit, numpy._typing._80Bit]"), - "complex192": ("numpy.complexfloating" - "[numpy._typing._96Bit, numpy._typing._96Bit]"), - "complex256": ("numpy.complexfloating" - "[numpy._typing._128Bit, numpy._typing._128Bit]"), - "complex512": ("numpy.complexfloating" - "[numpy._typing._256Bit, numpy._typing._256Bit]"), - - "ubyte": f"numpy.unsignedinteger[{dct['_NBitByte']}]", - "ushort": f"numpy.unsignedinteger[{dct['_NBitShort']}]", - "uintc": f"numpy.unsignedinteger[{dct['_NBitIntC']}]", - "uintp": f"numpy.unsignedinteger[{dct['_NBitIntP']}]", - "uint": f"numpy.unsignedinteger[{dct['_NBitInt']}]", - "ulonglong": f"numpy.unsignedinteger[{dct['_NBitLongLong']}]", - "byte": f"numpy.signedinteger[{dct['_NBitByte']}]", - "short": f"numpy.signedinteger[{dct['_NBitShort']}]", - "intc": f"numpy.signedinteger[{dct['_NBitIntC']}]", - "intp": f"numpy.signedinteger[{dct['_NBitIntP']}]", - "int_": f"numpy.signedinteger[{dct['_NBitInt']}]", - "longlong": f"numpy.signedinteger[{dct['_NBitLongLong']}]", - - "half": f"numpy.floating[{dct['_NBitHalf']}]", - "single": f"numpy.floating[{dct['_NBitSingle']}]", - "double": f"numpy.floating[{dct['_NBitDouble']}]", - "longdouble": f"numpy.floating[{dct['_NBitLongDouble']}]", - "csingle": ("numpy.complexfloating" - f"[{dct['_NBitSingle']}, {dct['_NBitSingle']}]"), - "cdouble": ("numpy.complexfloating" - f"[{dct['_NBitDouble']}, {dct['_NBitDouble']}]"), - "clongdouble": ( - "numpy.complexfloating" - f"[{dct['_NBitLongDouble']}, {dct['_NBitLongDouble']}]" - ), - - # numpy.typing - "_NBitInt": dct['_NBitInt'], - - # numpy.ctypeslib - "c_intp": f"ctypes.{_C_INTP}" - } - - -#: A dictionary with all supported format keys (as keys) -#: and matching values -FORMAT_DICT: dict[str, str] = _construct_format_dict() -FORMAT_DICT.update(_construct_ctypes_dict()) - - -def _parse_reveals(file: IO[str]) -> tuple[npt.NDArray[np.str_], list[str]]: - """Extract and parse all ``" # E: "`` comments from the passed - file-like object. - - All format keys will be substituted for their respective value - from `FORMAT_DICT`, *e.g.* ``"{float64}"`` becomes - ``"numpy.floating[numpy._typing._64Bit]"``. - """ - string = file.read().replace("*", "") - - # Grab all `# E:`-based comments and matching expressions - expression_array, _, comments_array = np.char.partition( - string.split("\n"), sep=" # E: " - ).T - comments = "/n".join(comments_array) - - # Only search for the `{*}` pattern within comments, otherwise - # there is the risk of accidentally grabbing dictionaries and sets - key_set = set(re.findall(r"\{(.*?)\}", comments)) - kwargs = { - k: FORMAT_DICT.get(k, f"<UNRECOGNIZED FORMAT KEY {k!r}>") for - k in key_set - } - fmt_str = comments.format(**kwargs) +_REVEAL_MSG = """Reveal mismatch at line {} - return expression_array, fmt_str.split("/n") +{} +""" @pytest.mark.slow @@ -341,53 +237,13 @@ def test_reveal(path: str) -> None: """ __tracebackhide__ = True - with open(path) as fin: - expression_array, reveal_list = _parse_reveals(fin) - output_mypy = OUTPUT_MYPY - assert path in output_mypy - for error_line in output_mypy[path]: - error_line = _strip_filename(error_line) - match = re.match( - r"(?P<lineno>\d+): note: .+$", - error_line, - ) - if match is None: - raise ValueError(f"Unexpected reveal line format: {error_line}") - lineno = int(match.group('lineno')) - 1 - assert "Revealed type is" in error_line - - marker = reveal_list[lineno] - expression = expression_array[lineno] - _test_reveal(path, expression, marker, error_line, 1 + lineno) - - -_REVEAL_MSG = """Reveal mismatch at line {} - -Expression: {} -Expected reveal: {!r} -Observed reveal: {!r} -""" -_STRIP_PATTERN = re.compile(r"(\w+\.)+(\w+)") - + if path not in output_mypy: + return -def _test_reveal( - path: str, - expression: str, - reveal: str, - expected_reveal: str, - lineno: int, -) -> None: - """Error-reporting helper function for `test_reveal`.""" - stripped_reveal = _STRIP_PATTERN.sub(strip_func, reveal) - stripped_expected_reveal = _STRIP_PATTERN.sub(strip_func, expected_reveal) - if stripped_reveal not in stripped_expected_reveal: - raise AssertionError( - _REVEAL_MSG.format(lineno, - expression, - stripped_expected_reveal, - stripped_reveal) - ) + for error_line in output_mypy[path]: + lineno, error_line = _strip_filename(error_line) + raise AssertionError(_REVEAL_MSG.format(lineno, error_line)) @pytest.mark.slow @@ -409,18 +265,18 @@ def test_code_runs(path: str) -> None: LINENO_MAPPING = { - 3: "uint128", - 4: "uint256", - 6: "int128", - 7: "int256", - 9: "float80", - 10: "float96", - 11: "float128", - 12: "float256", - 14: "complex160", - 15: "complex192", - 16: "complex256", - 17: "complex512", + 11: "uint128", + 12: "uint256", + 14: "int128", + 15: "int256", + 17: "float80", + 18: "float96", + 19: "float128", + 20: "float256", + 22: "complex160", + 23: "complex192", + 24: "complex256", + 25: "complex512", } @@ -435,21 +291,12 @@ def test_extended_precision() -> None: expression_list = f.readlines() for _msg in output_mypy[path]: - *_, _lineno, msg_typ, msg = _msg.split(":") - - msg = _strip_filename(msg) - lineno = int(_lineno) + lineno, msg = _strip_filename(_msg) expression = expression_list[lineno - 1].rstrip("\n") - msg_typ = msg_typ.strip() - assert msg_typ in {"error", "note"} if LINENO_MAPPING[lineno] in _EXTENDED_PRECISION_LIST: - if msg_typ == "error": - raise ValueError(f"Unexpected reveal line format: {lineno}") - else: - marker = FORMAT_DICT[LINENO_MAPPING[lineno]] - _test_reveal(path, expression, marker, msg, lineno) - else: - if msg_typ == "error": - marker = "Module has no attribute" - _test_fail(path, expression, marker, msg, lineno) + raise AssertionError(_REVEAL_MSG.format(lineno, msg)) + elif "error" not in msg: + _test_fail( + path, expression, msg, 'Expression is of type "Any"', lineno + ) diff --git a/contrib/python/numpy/py3/numpy/version.py b/contrib/python/numpy/py3/numpy/version.py index d9d2fe1b76..54fc637f26 100644 --- a/contrib/python/numpy/py3/numpy/version.py +++ b/contrib/python/numpy/py3/numpy/version.py @@ -1,23 +1,8 @@ -from __future__ import annotations -from ._version import get_versions - -__ALL__ = ['version', '__version__', 'full_version', 'git_revision', 'release'] - - -_built_with_meson = False -try: - from ._version_meson import get_versions - _built_with_meson = True -except ImportError: - from ._version import get_versions - -vinfo: dict[str, str] = get_versions() -version = vinfo["version"] -__version__ = vinfo.get("closest-tag", vinfo["version"]) -git_revision = vinfo['full-revisionid'] -release = 'dev0' not in version and '+' not in version +version = "1.26.2" +__version__ = version full_version = version -short_version = version.split("+")[0] -del get_versions, vinfo +git_revision = "" +release = 'dev' not in version and '+' not in version +short_version = version.split("+")[0] diff --git a/contrib/python/numpy/py3/tests/ya.make b/contrib/python/numpy/py3/tests/ya.make index b548d76d63..0a655a4699 100644 --- a/contrib/python/numpy/py3/tests/ya.make +++ b/contrib/python/numpy/py3/tests/ya.make @@ -83,6 +83,7 @@ TEST_SRCS( numpy/core/tests/test_nep50_promotions.py numpy/core/tests/test_numeric.py numpy/core/tests/test_numerictypes.py + numpy/core/tests/test_numpy_2_0_compat.py numpy/core/tests/test_overrides.py numpy/core/tests/test_print.py numpy/core/tests/test_protocols.py @@ -129,9 +130,11 @@ TEST_SRCS( #numpy/f2py/tests/test_common.py #numpy/f2py/tests/test_compile_function.py #numpy/f2py/tests/test_crackfortran.py + #numpy/f2py/tests/test_data.py #numpy/f2py/tests/test_docs.py #numpy/f2py/tests/test_f2cmap.py #numpy/f2py/tests/test_f2py2e.py + #numpy/f2py/tests/test_isoc.py #numpy/f2py/tests/test_kind.py #numpy/f2py/tests/test_mixed.py #numpy/f2py/tests/test_module_doc.py diff --git a/contrib/python/numpy/py3/ya.make b/contrib/python/numpy/py3/ya.make index 253c01869b..2eb36a5912 100644 --- a/contrib/python/numpy/py3/ya.make +++ b/contrib/python/numpy/py3/ya.make @@ -4,7 +4,7 @@ LICENSE(BSD-3-Clause) PROVIDES(numpy) -VERSION(1.25.2) +VERSION(1.26.2) NO_COMPILER_WARNINGS() NO_EXTENDED_SOURCE_SEARCH() @@ -63,6 +63,14 @@ PY_SRCS( numpy/__config__.py numpy/__init__.py numpy/__init__.pyi + numpy/_core/__init__.py + numpy/_core/__init__.pyi + numpy/_core/_dtype.py + numpy/_core/_dtype_ctypes.py + numpy/_core/_internal.py + numpy/_core/_multiarray_umath.py + numpy/_core/multiarray.py + numpy/_core/umath.py numpy/_distributor_init.py numpy/_globals.py numpy/_pyinstaller/__init__.py @@ -83,9 +91,9 @@ PY_SRCS( numpy/_typing/_shape.py numpy/_typing/_ufunc.pyi numpy/_utils/__init__.py + numpy/_utils/_convertions.py numpy/_utils/_inspect.py numpy/_utils/_pep440.py - numpy/_version.py numpy/array_api/__init__.py numpy/array_api/_array_object.py numpy/array_api/_constants.py |