summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
Commit message (Collapse)AuthorAgeFilesLines
* ENH: Use threshold also inside SubArrayFormat.Marten van Kerkwijk2023-04-071-9/+25
| | | | | | | | | | | Previously, for structured arrays that contain a lot of elements, those are always all shown, independent of the threshold print option. This PR ensures that threshold and edgeitems are respected. Note that multidimensional items are typeset without line breaks, to avoid breaking up the structure. Hence, this does not solve the issue that structured array elements can easily overfill a line on the console.
* ENH: show dtype in array repr when endianness is non-native (#23295)molsonkiko2023-03-141-1/+9
| | | | | | | Fx problem where, for example, np.array([1], dtype='>u2') and np.array([1], dtype='<u2') both got represented as np.array([1], dtype=uint16), or the dtype is not shown for the default ones (float64, default int).
* MAINT, DOC: string_ → bytes_ and unicode_ → str_Dimitri Papadopoulos2023-02-101-3/+3
|
* MAINT: Fix stacklevels for the new C dispatcher not adding oneSebastian Berg2023-01-171-1/+1
|
* MAINT: Rm unnecessary checks in determining typeless data.Ross Barnowski2022-11-131-4/+0
| | | | | The issubclass should always be false in Python3, so this change should not change behavior.
* ENH: Add spaces after punctuation in dtype repr/str. (#19686)Antony Lee2021-09-291-31/+67
| | | | | | | | | | | | | | | | | Before: ``` In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]}) Out[1]: dtype({'names':['a'], 'formats':['<i8'], 'offsets':[2], 'itemsize':10}) ``` After: ``` In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]}) Out[1]: dtype({'names': ['a'], 'formats': ['<i8'], 'offsets': [2], 'itemsize': 10}) ``` * Allow switching back to old dtype printing format. * Add changelog.
* TST: Add C-side "Scaled float" exampleSebastian Berg2021-07-261-1/+6
| | | | | | | | | | | | | | | | This adds a C-side scaled float (actually double), that is available as: SF = np.core._multiarray_umath._get_sfloat_dtype() It supports different scaling factors: a = np.arange(10.).astype(SF(2.)) b = np.arange(10.).astype(SF(0.5)) and casting from double (used there). This commit makes tiny changes in NumPy to support correct printing.
* Merge pull request #18629 from ahaldane/min_digitsCharles Harris2021-03-311-20/+48
|\ | | | | BUG, ENH: fix array2string rounding bug by adding min_digits option
| * DOC: Add versionadded for new min_digits argument.Charles Harris2021-03-311-1/+4
| |
| * Update arrayprint.pyAllan Haldane2021-03-191-3/+4
| |
| * Update numpy/core/arrayprint.pyAllan Haldane2021-03-191-1/+1
| | | | | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
| * Update numpy/core/arrayprint.pyAllan Haldane2021-03-191-3/+3
| | | | | | Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
| * BUG/ENH: fix array2string rounding bug by adding min_digits optionAllan Haldane2021-03-181-20/+44
| | | | | | | | Fixes #18609
* | MAINT: use super() as described by PEP 3135Mike Taves2021-03-191-2/+2
|/
* MAINT: import refactorMitchell Faas2021-01-311-2/+2
|
* ENH: Improved error traceback in set_printoptionsMitchell-Faas2021-01-311-2/+2
| | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* BUG: Now allows for all integer typesMitchell Faas2021-01-311-1/+4
| | | | | Fixed a bug where precision couldn't be a non-native integer. See comments on pull request #18263 for more info.
* ENH: Added sanity check to printoptionsMitchell Faas2021-01-311-0/+7
| | | | See issue #18254
* DOC: Misc numpydoc format fixesMatthias Bussonnier2021-01-271-1/+1
| | | | | | | | | Via prototype docstring autoreformatter; and cherry-picked to mostly include spacing issues around colons in parameters and see also. When no space is present numpydoc tend to miss-parse those sections A couple of typos are fixed as well.
* MAINT: Remove any mention of `formatter["str"]`Bas van Beek2020-12-191-8/+4
| | | | It's been non-functional for the past 8 years (xref https://github.com/numpy/numpy/pull/459)
* DOC: Clarify that `np.array2string` can only take an `ndarray`Bas van Beek2020-12-191-1/+1
|
* MAINT: Make arrayprint str and repr the ndarray defaults.Charles Harris2020-08-221-3/+0
| | | | | | | This removes the old default routines in 'strfunc.c' that were never used and looked to have unicode/byte problems. The functions now self initialize when called, so the explicit initialization when the arrayprint module is loaded is no longer needed.
* Make requested changesPan Jan2020-04-271-5/+4
|
* Improve way of breaking linesPan Jan2020-04-171-9/+16
|
* Improve testingPan Jan2020-04-161-2/+0
|
* ENH: improve printing of arrays with multi-line reprsPan Jan2020-04-161-4/+27
|
* MAINT: Clean up, mostly unused imports.Warren Weckesser2020-01-231-2/+2
|
* [MAINT] Cleanup python2 sys.version checksSeth Troisi2020-01-201-11/+4
|
* MAINT: Implement keyword-only arguments as syntaxEric Wieser2020-01-061-33/+26
| | | | Now that 2.7 is gone, there is no need to pop manually from kwarg dictionaries.
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-7/+7
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* Merge pull request #14699 from mattip/doc-warningsRalf Gommers2019-10-181-1/+1
|\ | | | | MAINT: reduce the number of doc build warnings
| * DOC: convert `None` to bare None or ``None``mattip2019-10-151-1/+1
| |
* | Merge pull request #14368 from jdufresne/byteswarningSebastian Berg2019-10-151-2/+6
|\ \ | |/ |/| MAINT: Avoid BytesWarning in PyArray_DescrConverter()
| * MAINT: Avoid all BytesWarningJon Dufresne2019-09-251-2/+6
| | | | | | | | | | | | | | | | A BytesWarning can be emitted when bytes are and strings are mismatched. Catching BytesWarning ensures a better boundary between str and bytes type. The test suite is now run with the -b flag to emit this warning. Fixes #9308
* | DOC: add `printoptions` as a context manager to `set_printoptions` (#14636)Eugene Prilepin2019-10-061-1/+10
|/ | | DOC: add `printoptions` as a context manager to `set_printoptions`
* DOC: add the reference to 'printoptions'Eugene Prilepin2019-09-051-2/+2
| | | | | | We add the reference to 'printoptions' context manager in "See Also" section in 'set_printoptions' and 'get_printoptions' functions. These changes improve the documentation and make it easy to search.
* Merge pull request #14290 from eric-wieser/fix-if-fieldsCharles Harris2019-08-221-1/+1
|\ | | | | BUG: Fix misuse of .names and .fields in various places
| * Merge remote-tracking branch 'upstream/master' into fix-if-fieldsEric Wieser2019-08-191-40/+57
| |\
| * | MAINT: Use the `.names is None` idiom to detect structured array in arrayprintEric Wieser2019-08-191-1/+1
| | | | | | | | | | | | No behavior change here
* | | DEP: Deprecate arrayprint formatting functionskritisingh12019-08-191-39/+0
| |/ |/|
* | MAINT: Change the type of error raised in set_printoptions (gh-13899)Kexuan Sun2019-07-251-2/+4
| | | | | | | | Previously an incorrect ``threshold`` raised ``ValueError``; it now raises ``TypeError`` for non-numeric types and ``ValueError`` for ``nan`` values.
* | DOC:Update the description of set_printoptions in quickstart doc #13900 (#13948)Samesh Lakhotia2019-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quickstart guide recommends np.set_printoptions(threshold=np.nan) but that fails. So changed that to np.set_printoptions(threshold=sys.maxsize) Closes #13900 * DOC:Update the docstring of set_printoptions Add preferred max value for threshold is sys.maxsize * Revert "DOC:Update the docstring of set_printoptions" This reverts commit 9641121fcb84b9ad5edb188a4a5b4ac9361fbf0b. * DOC:Update the docstring of set_printoptions Add preferred max value for threshold is sys.maxsize * DOC:Update the docstring of set_printoptions Better pharasing in docstring. * DOC:Update the description of set_printoptions in quickstart doc #13900 Fix indentation
* | MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-011-2/+2
| |
* | DOC: clarify array_{2string,str,repr} defaultsMike Lui2019-04-251-26/+29
| | | | | | | | | | Point users to get_printoptions(), which returns the current print defaults.
* | DOC: clarify array_{2string,str,repr} defaultsMike Lui2019-04-251-9/+18
| | | | | | | | | | | | Point documentation on default values for array2string, array_str, and array_repr to set_printoptions. set_printoptions uses the same defaulting scheme.
* | TST, DOC: enable refguide_checkTyler Reddy2018-12-141-17/+19
|/ | | | | | | | * ported the refguide_check module from SciPy for usage in NumPy docstring execution/ verification; added the refguide_check run to Azure Mac OS CI * adjusted NumPy docstrings such that refguide_check passes
* BUG: test, fix for threshold='nan'mattip2018-12-011-1/+6
|
* ENH: set correct __module__ for objects in numpy's public APIStephan Hoyer2018-11-131-1/+9
| | | | | | | | | | | | | Fixes GH-12271 Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to ``'numpy'``, or appears in an explicit whitelist of undocumented functions and exported bulitins. These should eventually be documented or removed. I also identified a handful of functions for which I had accidentally not setup dispatch for with ``__array_function__`` before, because they were listed under "ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in trusting code comments :).
* MAINT: more fixes for disabling overridesStephan Hoyer2018-11-101-2/+4
|