ToFuProject / tofu

Project for an open-source python library for synthetic diagnostics and tomography for Fusion devices
https://tofuproject.github.io/tofu/index.html
MIT License
72 stars 11 forks source link

Get rid of `np.int` #986

Closed Didou09 closed 1 week ago

Didou09 commented 1 week ago

Main changes:

New strategy for int/ float type checks

# Useful scalar types
_NINT = (np.int32, np.int64)
_INT = (int,) + _NINT
_NFLOAT = (np.float32, np.float64)
_FLOAT = (float,) + _NFLOAT
_NUMB = _INT + _FLOAT

And always run isinstance()

Because the behaviour of np.int, np.int_ or np.integer is too dependent on the version of numpy and on the plateform Also shows different results depending is using type() or dtype or isinstance()

Issues:

Fixes, in devel, issue #983

pep8speaks commented 1 week ago

Hello @Didou09! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 376:80: E501 line too long (83 > 79 characters) Line 1500:71: E231 missing whitespace after ',' Line 1500:80: E501 line too long (83 > 79 characters)

Line 208:16: W292 no newline at end of file

Comment last updated at 2024-11-13 18:37:09 UTC