|
3255 | 3255 | """))
|
3256 | 3256 |
|
3257 | 3257 |
|
3258 |
| -add_newdoc('numpy.core.multiarray', 'shares_memory', |
3259 |
| - """ |
3260 |
| - shares_memory(a, b, max_work=None) |
3261 |
| -
|
3262 |
| - Determine if two arrays share memory |
3263 |
| -
|
3264 |
| - Parameters |
3265 |
| - ---------- |
3266 |
| - a, b : ndarray |
3267 |
| - Input arrays |
3268 |
| - max_work : int, optional |
3269 |
| - Effort to spend on solving the overlap problem (maximum number |
3270 |
| - of candidate solutions to consider). The following special |
3271 |
| - values are recognized: |
3272 |
| -
|
3273 |
| - max_work=MAY_SHARE_EXACT (default) |
3274 |
| - The problem is solved exactly. In this case, the function returns |
3275 |
| - True only if there is an element shared between the arrays. |
3276 |
| - max_work=MAY_SHARE_BOUNDS |
3277 |
| - Only the memory bounds of a and b are checked. |
3278 |
| -
|
3279 |
| - Raises |
3280 |
| - ------ |
3281 |
| - numpy.TooHardError |
3282 |
| - Exceeded max_work. |
3283 |
| -
|
3284 |
| - Returns |
3285 |
| - ------- |
3286 |
| - out : bool |
3287 |
| -
|
3288 |
| - See Also |
3289 |
| - -------- |
3290 |
| - may_share_memory |
3291 |
| -
|
3292 |
| - Examples |
3293 |
| - -------- |
3294 |
| - >>> np.may_share_memory(np.array([1,2]), np.array([5,8,9])) |
3295 |
| - False |
3296 |
| -
|
3297 |
| - """) |
3298 |
| - |
3299 |
| - |
3300 |
| -add_newdoc('numpy.core.multiarray', 'may_share_memory', |
3301 |
| - """ |
3302 |
| - may_share_memory(a, b, max_work=None) |
3303 |
| -
|
3304 |
| - Determine if two arrays might share memory |
3305 |
| -
|
3306 |
| - A return of True does not necessarily mean that the two arrays |
3307 |
| - share any element. It just means that they *might*. |
3308 |
| -
|
3309 |
| - Only the memory bounds of a and b are checked by default. |
3310 |
| -
|
3311 |
| - Parameters |
3312 |
| - ---------- |
3313 |
| - a, b : ndarray |
3314 |
| - Input arrays |
3315 |
| - max_work : int, optional |
3316 |
| - Effort to spend on solving the overlap problem. See |
3317 |
| - `shares_memory` for details. Default for ``may_share_memory`` |
3318 |
| - is to do a bounds check. |
3319 |
| -
|
3320 |
| - Returns |
3321 |
| - ------- |
3322 |
| - out : bool |
3323 |
| -
|
3324 |
| - See Also |
3325 |
| - -------- |
3326 |
| - shares_memory |
3327 |
| -
|
3328 |
| - Examples |
3329 |
| - -------- |
3330 |
| - >>> np.may_share_memory(np.array([1,2]), np.array([5,8,9])) |
3331 |
| - False |
3332 |
| - >>> x = np.zeros([3, 4]) |
3333 |
| - >>> np.may_share_memory(x[:,0], x[:,1]) |
3334 |
| - True |
3335 |
| -
|
3336 |
| - """) |
3337 |
| - |
3338 |
| - |
3339 |
| -add_newdoc('numpy.lib.utils', 'byte_bounds', |
3340 |
| - """ |
3341 |
| - byte_bounds(a) |
3342 |
| -
|
3343 |
| - Returns pointers to the end-points of an array in the form of tuple |
3344 |
| - of two integers. The first integer is the first byte of the array, |
3345 |
| - the second integer is just past the last byte of the array. |
3346 |
| -
|
3347 |
| - If `a` is not contiguous it will not use every byte between the |
3348 |
| - returned integer values. |
3349 |
| -
|
3350 |
| - Parameters |
3351 |
| - ---------- |
3352 |
| - a : ndarray |
3353 |
| - Input array. It must conform to the Python-side of the array |
3354 |
| - interface. |
3355 |
| -
|
3356 |
| - Returns |
3357 |
| - ------- |
3358 |
| - (low, high) : tuple of 2 integers |
3359 |
| -
|
3360 |
| - Examples |
3361 |
| - -------- |
3362 |
| - >>> x = np.array([1,2,4]) |
3363 |
| - >>> np.byte_bounds(x) |
3364 |
| - (32030368, 32030392) |
3365 |
| - >>> I = np.eye(2, dtype='f'); I.dtype |
3366 |
| - dtype('float32') |
3367 |
| - >>> low, high = np.byte_bounds(I) |
3368 |
| - >>> high - low == I.size*I.itemsize |
3369 |
| - True |
3370 |
| -
|
3371 |
| - """) |
3372 |
| - |
3373 |
| - |
3374 | 3258 | add_newdoc('numpy.core.multiarray', 'ndarray', ('newbyteorder',
|
3375 | 3259 | """
|
3376 | 3260 | arr.newbyteorder(new_order='S')
|
|
4383 | 4267 | [(4, 5)]], dtype=[('width', '<i2'), ('length', '<i2')])
|
4384 | 4268 | """))
|
4385 | 4269 |
|
4386 |
| -add_newdoc('numpy.lib.utils', 'who', |
4387 |
| - """ |
4388 |
| - who(verdict=None) |
4389 |
| -
|
4390 |
| - Print the NumPy arrays in the given dictionary. |
4391 |
| -
|
4392 |
| - If there is no dictionary passed in or `vardict` is None then returns |
4393 |
| - NumPy arrays in the globals() dictionary (all NumPy arrays in the |
4394 |
| - namespace). |
4395 |
| -
|
4396 |
| - Parameters |
4397 |
| - ---------- |
4398 |
| - vardict : dict, optional |
4399 |
| - A dictionary possibly containing ndarrays. Default is globals(). |
4400 |
| -
|
4401 |
| - Returns |
4402 |
| - ------- |
4403 |
| - out : None |
4404 |
| - Returns 'None'. |
4405 |
| -
|
4406 |
| - Notes |
4407 |
| - ----- |
4408 |
| - Prints out the name, shape, bytes and type of all of the ndarrays |
4409 |
| - present in `vardict`. |
4410 |
| -
|
4411 |
| - Examples |
4412 |
| - -------- |
4413 |
| - >>> a = np.arange(10) |
4414 |
| - >>> b = np.ones(20) |
4415 |
| - >>> np.who() |
4416 |
| - Name Shape Bytes Type |
4417 |
| - =========================================================== |
4418 |
| - a 10 80 int64 |
4419 |
| - b 20 160 float64 |
4420 |
| - Upper bound on total bytes = 240 |
4421 |
| -
|
4422 |
| - >>> d = {'x': np.arange(2.0), 'y': np.arange(3.0), 'txt': 'Some str', |
4423 |
| - ... 'idx':5} |
4424 |
| - >>> np.who(d) |
4425 |
| - Name Shape Bytes Type |
4426 |
| - =========================================================== |
4427 |
| - x 2 16 float64 |
4428 |
| - y 3 24 float64 |
4429 |
| - Upper bound on total bytes = 40 |
4430 |
| -
|
4431 |
| - """) |
4432 |
| - |
4433 | 4270 |
|
4434 | 4271 | ##############################################################################
|
4435 | 4272 | #
|
@@ -7080,80 +6917,3 @@ def add_newdoc_for_scalar_type(obj, fixed_aliases, doc):
|
7080 | 6917 | (-1, 4)
|
7081 | 6918 | """.format(ftype=float_name)))
|
7082 | 6919 |
|
7083 |
| -############################################################################## |
7084 |
| -# |
7085 |
| -# Miscellaneous utility routines |
7086 |
| -# |
7087 |
| -############################################################################## |
7088 |
| - |
7089 |
| -add_newdoc('numpy.lib.utils', 'get_include', |
7090 |
| - """ |
7091 |
| -
|
7092 |
| - Parameters |
7093 |
| - ---------- |
7094 |
| - None |
7095 |
| -
|
7096 |
| - Returns |
7097 |
| - ------- |
7098 |
| - Directory that contains the NumPy \\*.h header files. |
7099 |
| -
|
7100 |
| - Extension modules that need to compile against NumPy should use this |
7101 |
| - function to locate the appropriate include directory. |
7102 |
| -
|
7103 |
| - """) |
7104 |
| - |
7105 |
| -add_newdoc('numpy.lib.utils', 'deprecate', |
7106 |
| - """ |
7107 |
| -
|
7108 |
| - deprecate(func, old_name, new_name, message) |
7109 |
| -
|
7110 |
| - Parameters |
7111 |
| - ---------- |
7112 |
| - func : function |
7113 |
| - The function to be deprecated. |
7114 |
| - old_name : str, optional |
7115 |
| - The name of the function to be deprecated. Default is None, in |
7116 |
| - which case the name of `func` is used. |
7117 |
| - new_name : str, optional |
7118 |
| - The new name for the function. Default is None, in which case the |
7119 |
| - deprecation message is that `old_name` is deprecated. If given, the |
7120 |
| - deprecation message is that `old_name` is deprecated and `new_name` |
7121 |
| - should be used instead. |
7122 |
| - message : str, optional |
7123 |
| - Additional explanation of the deprecation. Displayed in the |
7124 |
| - docstring after the warning. |
7125 |
| -
|
7126 |
| - Returns |
7127 |
| - ------- |
7128 |
| - old_func : function |
7129 |
| - The deprecated function. |
7130 |
| -
|
7131 |
| - Examples |
7132 |
| - -------- |
7133 |
| - Note that ``olduint`` returns a value after printing Deprecation |
7134 |
| - Warning: |
7135 |
| -
|
7136 |
| - >>> olduint = np.deprecate(np.uint) |
7137 |
| - DeprecationWarning: `uint64` is deprecated! # may vary |
7138 |
| - >>> olduint(6) |
7139 |
| - 6 |
7140 |
| -
|
7141 |
| - Notes |
7142 |
| - ----- |
7143 |
| - Deprecate may be run as a function or as a decorator |
7144 |
| - If run as a function, we initialise the decorator class |
7145 |
| - and execute its __call__ method. |
7146 |
| -
|
7147 |
| - """) |
7148 |
| - |
7149 |
| -add_newdoc('numpy.lib.utils', 'deprecate_with_doc', |
7150 |
| - """ |
7151 |
| -
|
7152 |
| - Lambda function which calls the ``_Deprecate`` with a predefined |
7153 |
| - message. |
7154 |
| -
|
7155 |
| - Parameters |
7156 |
| - ---------- |
7157 |
| - message : str |
7158 |
| -
|
7159 |
| - """) |
0 commit comments