Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 141
    • Merge requests 141
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !2126

Merged
Created Jun 30, 2025 by Xiaowu Zhang@xiaowu.zhangDeveloper

Restricted: allow more numpy dtypes

  • Overview 7
  • Commits 2
  • Changes 2

i observe new behavior of numpy dtype, it seems they already introduce New and extensible DTypes in recent numpy , at lease 1.26.4

in numpy 1.16.6

import numpy as np

for dtype in ('int8', 'int16', 'int32', 'int64',
              'uint8', 'uint16', 'uint32', 'uint64',
              'float16', 'float32', 'float64',
              'complex64', 'complex128']
             ):
  print(type(np.dtype(dtype)))
return printed

return always <type 'numpy.dtype'>, there has only one dtype

but in numpy 1.26.4, it returns differently

<class 'numpy.dtypes.Int8DType'>
<class 'numpy.dtypes.Int16DType'>
<class 'numpy.dtypes.Int32DType'>
<class 'numpy.dtypes.Int64DType'>
<class 'numpy.dtypes.UInt8DType'>
<class 'numpy.dtypes.UInt16DType'>
<class 'numpy.dtypes.UInt32DType'>
<class 'numpy.dtypes.UInt64DType'>
<class 'numpy.dtypes.Float16DType'>
<class 'numpy.dtypes.Float32DType'>
<class 'numpy.dtypes.Float64DType'>
<class 'numpy.dtypes.Complex64DType'>
<class 'numpy.dtypes.Complex128DType'>

from what i know, it miss <class 'numpy.dtypes.BoolDType'> and <class 'numpy.dtypes.VoidDType'>

if we access attribute of those missing dtypes, we'll get Unauthorized error, like the error message below:

  zbigarray = out_data_array.initArray(shape=(0,), dtype= ndarray.dtype.fields) 
AccessControl.unauthorized.Unauthorized: You are not allowed to access 'fields' in this context

this merge request aim to allow more dtype

Edited Jul 01, 2025 by Xiaowu Zhang
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7