or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
C-API
Actual changes
Delete all old macro names.
Intp/UIntp
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →(True ABI break, but on almost no platforms, only OpenVMS?)
npy_uintp
tosize_t
andnpy_intp
asPy_ssize_t
(same size assize_t
, C has no standard name). Yes, it is a misnomer.npy_intp
will be technically wrong. Quick grep: NumPy/SciPy don't do this, it should be rare).Opaquify (most of) PyArray_Descr struct
Assume Cython 3 availability.
descr->elsize
: Force them to update to macro. (cython 3 not a problem)PyArray_DescrProto
struct (same layout)MapIter
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →All MapIter API should be private, its too messy. No known users exist and to iterate fast you need to dig deep into the structs. It makes cleaning up impossible:
Replacement: None Only user I found is Thaeno which is EOL, its replacement doesn't use it. Even in thaeno it is really just used to implement a slow version of
np.add.at
andarr[...] = vals
.Neighborhood Iterator
This would be nice to remove. It is quite messy and not really tested or used outside of SciPy, it also unlikely to generalize over all dtypes to begin with.
NPY_NEIGHBORHOOD_ITER_ZERO_PADDING
Replacement: Vedor into SciPy and hope SciPy eventually replaces it. The
ndimage
version is much better (but no object support and maybe subtly different).Other iterators
Yes, I am sure it would be nice to slim out some there too, but I am less confident about that.
General functions/macros removal (mostly small)
(Deleted items that are already dealt with)
arr.getfield
(use indexing)arr.setfield
(use indexing)np.dtype(...)
C-apiLimited API (may only work with builtin types for example)
Functions that use type numbers could be hidden behind a warning. But, I don't think this is a priority for a 2.0. It can be done at any point.
PyArray_INCREF PyArray_XDECREF PyArray_Item_INCREF PyArray_Item_XDECREF
PyArray_DescrFromType
PyArray_CanCastSafely
PyArray_DescrFromScalar
PyArray_FromScalar
PyArray_ValidType
PyArray_EquivTypenums
Opaquify?
If we can rely on Cython 3, and agree on compile against "NumPy 2" we can opaquify structs quite liberally. (Note: I am happy with not making the array struct opaque, I feel that changes to the "typical" fields probably mean more interesting behavior changes. And I suspect that will mean a new type)
ABI/API changes that I can think of
Affects: Very rather few, the new iterator API never really took off.
How: Breaks things hard, impacted code will report errors where there are none (a bit hard to track down). Fix itself is easy.
New API
We have a bit of new API, which we could (with small limitations) "backport" header only: