question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using __array_function__ beyond Quantity?

See original GitHub issue

This is a bit of a tracking issue: numpy is introducing __array_function__, with which one can override functionality of numpy functions for one’s classes. To implement for:

  • Quantity - finally, concatenate and friends will work! See #8808 and Quantity specific follow-up in #8825.
  • ShapedLikeNDArray - to cover shape-changing functions things like np.atleast_1d (#10337)
  • Extend ShapedLikeNDArray to np.where, np.concatenate and friends (like np.hstack, np.r_, etc.)
  • For Time, make actual implementations for functions that currently work by creating time object array (e.g., np.sum on TimeDelta, which is used in gammay [#10501]; also np.diff on Time, and np.median [requested in #10962]).
  • Extend Time with other functions that logically can work, such as np.linspace (which would fix #8596) and np.isclose (relevant for #8742)
  • And use it in NDData, where probably many more functions make sense.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
mhvkcommented, Jun 20, 2019

Actually, it turns out one of them brought an error in my tests to light, so it was OK. The other, with block is less clear, but we had discussion. Anyway, fix is on the way…

1reaction
pllimcommented, Jun 20, 2019

@mhvk, maybe Numpy should have a job to test against astropy-dev before merging. 😏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Array formulas and functions in Excel - examples and guidelines
The tutorial explains what is an array formula in Excel and provides examples of using Excel array functions and constants.
Read more >
Array methods - The Modern JavaScript Tutorial
Arrays provide a lot of methods. To make things easier, in this chapter they are split into groups. Add/remove items.
Read more >
Description of the limitations for working with arrays in Excel
In Excel, arrays in worksheets are limited by available random access memory, by the total number of array formulas, and by the "entire ......
Read more >
Array Functions - Manual - PHP
Compares values only. Ignores indexes of array. Example: array_diff, array_intersect. [prefix] u - will do comparison with user defined function. Letter u can ......
Read more >
5. Working with Arrays and Loops - JavaScript Cookbook [Book]
An array is an ordered collection of elements. In JavaScript, an array can be created using formal object notation, or it can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found