summaryrefslogtreecommitdiff
path: root/numpy/core/records.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Move set_module to numpy.core to use without C importSebastian Berg2022-11-241-1/+1
|
* ENH: Add spaces after punctuation in dtype repr/str. (#19686)Antony Lee2021-09-291-4/+4
| | | | | | | | | | | | | | | | | 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.
* Merge pull request #19918 from BvB93/moduleCharles Harris2021-09-211-0/+8
|\ | | | | MAINT: Override the modules of `np.char` and `np.rec` functions
| * MAINT: Override the modules of `np.char` and `np.rec` functionsBas van Beek2021-09-211-0/+8
| |
* | DOC: Typos found by codespellDimitri Papadopoulos2021-09-211-1/+1
|/
* MAINT: revise OSError aliases (IOError, EnvironmentError)Mike Taves2021-09-021-1/+1
|
* MAINT: refactor "for ... in range(len(" statementsMike Taves2021-09-011-6/+6
|
* MAINT: removed unused imports listed in LGTMdefault-3032021-05-241-1/+0
|
* Merge pull request #17586 from BvB93/type_aliasesCharles Harris2021-03-301-1/+1
|\ | | | | DEP: Formally deprecate `np.typeDict`
| * MAINT,DEP: Replace references to `typeDict` with `sctypeDict`Bas van Beek2021-01-161-1/+1
| |
* | Merge pull request #18579 from mwtoews/refactor-dictRalf Gommers2021-03-211-13/+2
|\ \ | | | | | | MAINT: OrderedDict is no longer necessary from Python 3.7
| * | MAINT: OrderedDict is no longer necessary from Python 3.7Mike Taves2021-03-081-13/+2
| | |
* | | MAINT: use super() as described by PEP 3135Mike Taves2021-03-191-3/+3
|/ /
* | MAINT: Add previously missing objects to `np.rec.__all__`Bas van Beek2021-02-011-1/+4
| | | | | | | | | | | | | | | | * `fromarrays` * `fromrecords` * `fromstring` * `fromfile` * `array`
* | DOC: Misc numpydoc format fixesMatthias Bussonnier2021-01-271-6/+6
|/ | | | | | | | | 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: Replace `contextlib_nullcontext` with `contextlib.nullcontext`Bas van Beek2020-12-051-4/+3
|
* Fix docstring cross-referencingAlbert Villanova del Moral2020-09-041-5/+5
|
* ENH: Add support for file like objects to np.core.records.fromfile (#16675)Sidhant Bansal2020-08-131-10/+11
| | | | | * ENH: Add file like support to np.core.records.fromfile (#2504) Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* DOC: Improve `rec.array` function documentation (#15853) (#16260)Anthony Byuraev2020-06-261-1/+80
| | | | | | Add complete docstring with parameters and examples to numpy.core.records.array (gh-15853). Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* MAINT: Chain some exceptions. (#16418)Zuhair Ali-Khan2020-06-041-4/+6
| | | | | | * ENH: Chain extensions in numpy and numpy/core Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> Co-authored-by: Zuhair Ali-Khan <54608785+zalikh2@users.noreply.github.com>
* MAINT: core: Use a raw string for the fromstring docstring.Warren Weckesser2020-05-261-1/+1
| | | | | | | This docstring needs to be a raw string so the backslashes in the example are not processed by Python or Sphinx. Closes gh-16390.
* DOC: Improve docstring of ``numpy.core.records`` (#16199)dojafrat2020-05-131-2/+52
| | | | | | Add documentation and examples to fromstring function See #15853 Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* DOC: Improve record module documentation (#15899)dustanlevenstein2020-04-161-16/+82
| | | | | | | | Addresses parts of #15853 by adding full function documentions with parameters to `numpy/core/records.py`. Co-authored-by: Dustan Levenstein <dlevenstein@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* MAINT: records: Remove private `format_parser._descr` attributeEric Wieser2020-04-031-15/+13
| | | | | | There's no need for this attribute to exist any more, it's already exposes publically via `.dtype`. Also removes the one use of `._names`, which is equivalent to `.dtype.names`.
* MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-261-4/+4
| | | | | types (#15816) Cleanup from the dropping of python 2
* MAINT: refactoring in np.core.records (gh-15195)Daniel Hrisca2020-01-281-19/+18
| | | | | | | | | * remove parentheses in the if statements * use tuples instead of lists in if conditions * use tuples instead of chained OR conditions Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* MAINT: Clean up, mostly unused imports.Warren Weckesser2020-01-231-1/+0
|
* Merge pull request #15217 from eric-wieser/deprecate-shape-0Sebastian Berg2020-01-161-6/+29
|\ | | | | DEP: records: Deprecate treating shape=0 as shape=None
| * DEP: records: Deprecate treating shape=0 as shape=NoneEric Wieser2020-01-011-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | `shape=n` is a shorthand for `shape=(n,)` except in the case when `n==0`, when it is a shorthand for `shape=None`. This special case is dangerous, as it makes `fromrecords(..., shape=len(a))` behave surprisingly when a is an empty sequence. Users impacted by this warning either: * Have a bug in their code, and will need to either: - wait for the deprecation to expire - change their code to use `(len(a),)` instead of `len(a)` * Are using the non-preferred spellling, and will need to replace a literal `0` or `False` with `None`
* | MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-1/+1
| | | | | | | | | | | | | | 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.
* BUG: Exceptions tracebacks are droppedEric Wieser2019-12-031-2/+1
| | | | For some reason this code reconstructed brand new exception objects with no traceback, rather than just re-raising
* Merge remote-tracking branch 'upstream/master' into fix-if-fieldsEric Wieser2019-08-191-67/+78
|\
| * MAINT: Replace integers in places where booleans are expectedMSeifert042019-07-011-1/+1
| |
| * BUG: Ensure that np.core.records.fromfile closes its file if something goes ↵Eric Wieser2019-06-041-29/+29
| | | | | | | | wrong
| * BUG: Fix np.rec.fromarrays on arrays which are already structured (#12887)Daniel Hrisca2019-03-141-4/+2
| | | | | | | | Previously fromarrays would fail when trying to construct a nested structured array. Fixed by using the dtype object directly, rather than round-tripping it through a string.
| * Merge pull request #12604 from danielhrisca/fromfile-bugfixCharles Harris2019-01-191-1/+4
| |\ | | | | | | BUG: Check dtype and formats arguments for None in numpy.core.records.fromfile
| | * chage ValueError to TypeError after reviewdanielhrisca2018-12-241-2/+2
| | |
| | * BUG: check if dtype or formats arguments are not None when calling ↵danielhrisca2018-12-231-0/+3
| | | | | | | | | | | | numpy.core.records.fromfile
| * | ENH: improve performance of numpy.core.records.fromarrays (#12596)Daniel Hrisca2019-01-131-5/+6
| |/ | | | | * ENH: improve performance of numpy.core.records.fromarrays and add benchmarks
| * Rename OrderedCounter to _OrderedCounterEric Wieser2018-12-181-2/+3
| | | | | | Let's not add to the namespace
| * use OrderedCounter recipe from Python documentationdanielhrisca2018-12-181-9/+17
| |
| * ENH: improve performance for core/records/find_duplicatedanielhrisca2018-12-171-6/+9
| |
| * MAINT: address several reviewer commentsTyler Reddy2018-12-141-4/+4
| |
| * TST, DOC: enable refguide_checkTyler Reddy2018-12-141-20/+17
| | | | | | | | | | | | | | | | * 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: Fix crash in recarray if nested structured dtypes contain paddingEric Wieser2019-08-191-2/+2
| | | | | | | | Previously attempting to access a field of such an array (such as when printing it!) would result in `ValueError: Changing the dtype of a 0d array is only supported if the itemsize is unchanged`.
* | BUG: Make np.record work on structured fields with no fieldsEric Wieser2019-08-191-7/+7
|/ | | | | | This replaces some more uses of `bool(dt.fields)` and `bool(dt.names)` with `dt.names is not None`. `dt.fields is not None` would have worked too, but checking `.names` is more prevalent elsewhere
* BUG: Fix `/` that should be `//`.Charles Harris2018-12-061-1/+1
| | | | Seems this old style division was missed when going to Python3 compatibility.
* BUG: fix records.fromfile fails to read data >4 GBcgohlke2018-12-051-2/+2
| | | Use 64-bit integer accumulator for calculating the product of array shapes on 64-bit systems. Fixes #12442.
* MAINT: Use list and dict comprehension when possible (#12445)Roman Yurchak2018-12-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use list comprehension * More list comprehension migration * Revert key copying in dict * A few more fixes * More reverts * Use dict comprehension * Fix dict comprehension * Address review comments * More review comments * Fix for empty unpacking of zip(* * Revert zip(* unpacking altogether * Fix dict copying * More simplifications