Skip to content

Refactor type coercion #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

mwiebe
Copy link
Member

@mwiebe mwiebe commented Nov 29, 2010

This started as a change to make type casting and coercion independent of the type number ordering. While it doesn't finish the job, it at least provides a slight performance improvement due to using lookup tables for the built-in types. I've included a testing script which prints out the cancast and coercion results, and they print out the same before/after these changes on my machine.

…Kinds, and CanCoerceScalar

Also add print_coercion_tables.py to aid when refactoring
type casting/coercion/promotion.
@mwiebe
Copy link
Member Author

mwiebe commented Nov 30, 2010

Committed.

mwiebe added a commit to mwiebe/numpy that referenced this pull request Sep 30, 2011
Also incorporated part of Han Genuit's pull request numpy#23, to try
and reduce the difficulty dealing with the merge conflict that
will result from these concurrent changes
mwiebe added a commit that referenced this pull request Oct 1, 2011
Also incorporated part of Han Genuit's pull request #23, to try
and reduce the difficulty dealing with the merge conflict that
will result from these concurrent changes
WeatherGod pushed a commit to WeatherGod/numpy that referenced this pull request Jan 22, 2012
Also incorporated part of Han Genuit's pull request numpy#23, to try
and reduce the difficulty dealing with the merge conflict that
will result from these concurrent changes
shoyer added a commit to shoyer/numpy that referenced this pull request Apr 26, 2017
* ENH: Better error message for __array_ufunc__ not implemented

New behavior:

    >>> import numpy as np

    >>> class Dummy:
    ...     def __array_ufunc__(self, *args, **kwargs):
    ...         return NotImplemented

    >>> np.negative(Dummy())
    TypeError: operand type(s) do not implement __array_ufunc__(
    <ufunc 'negative'>, '__call__', <__main__.Dummy object at 0x1106df8d0>):
    'Dummy'

* check for null errmsg_formatter
prototype99 referenced this pull request in prototype99/numpy Jan 4, 2021
fangerer added a commit to hpyproject/numpy-hpy that referenced this pull request Jul 7, 2022
Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from fa/ufunc2 to labs-hpy-port

* commit '749835fe8392b14da8fb8ab57fc6b363ed8056a8':
  Do not steal reference in HPyArray_FromAny
  Print debug warning in npy_get_context; introduce warning level
  Migrate PyArray_DescrFromScalar and PyArray_DescrNewFromType
  Move type helpers for scalar types to header
  Fix: free args array in ufunc_call_impl
  Migrate PyArray_FromAny, PyArray_AssignFromCache, and PyArray_Pack
  Migrate coercion_cache_obj to HPy
  Migrate function PyArray_CastDescrToDType
luyahan pushed a commit to plctlab/numpy that referenced this pull request Apr 25, 2024
test: Add testing tool to print var in u8 array
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants