Skip to content

Commit

Permalink
Merge pull request #98 from jakevdp:float8-deprecation
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 566669686
  • Loading branch information
The ml_dtypes Authors committed Sep 19, 2023
2 parents 12d3532 + 65217c9 commit 66ca5ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ To release a new version (e.g. from `1.0.0` -> `2.0.0`):

* Dropped support for Python 3.8, following [NEP 29].
* Added support for Python 3.12.
* Removed deprecated name `ml_dtypes.float8_e4m3b11`;
use `ml_dtypes.float8_e4m3b11fnuz` instead.

## [0.2.0] - 2023-06-06

Expand Down
17 changes: 0 additions & 17 deletions ml_dtypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,3 @@
uint4: Type[np.generic]

del np, Type


# TODO(jakevdp) remove this deprecated name.
def __getattr__(name): # pylint: disable=invalid-name
if name == 'float8_e4m3b11':
import warnings # pylint: disable=g-import-not-at-top

warnings.warn(
(
'ml_dtypes.float8_e4m3b11 is deprecated. Use'
' ml_dtypes.float8_e4m3b11fnuz'
),
DeprecationWarning,
stacklevel=2,
)
return float8_e4m3b11fnuz
raise AttributeError(f'cannot import name {name!r} from {__name__!r}')

0 comments on commit 66ca5ae

Please sign in to comment.