55
66import warnings
77
8- from .machar import MachAr
8+ from ._machar import MachAr
99from .overrides import set_module
1010from . import numeric
1111from . import numerictypes as ntypes
@@ -385,6 +385,8 @@ class finfo:
385385 machar : MachAr
386386 The object which calculated these parameters and holds more
387387 detailed information.
388+
389+ .. deprecated:: 1.22
388390 machep : int
389391 The exponent that yields `eps`.
390392 max : floating point number of the appropriate type
@@ -501,7 +503,7 @@ def _init(self, dtype):
501503 self .eps = machar .eps .flat [0 ]
502504 self .nexp = machar .iexp
503505 self .nmant = machar .it
504- self .machar = machar
506+ self ._machar = machar
505507 self ._str_tiny = machar ._str_xmin .strip ()
506508 self ._str_max = machar ._str_xmax .strip ()
507509 self ._str_epsneg = machar ._str_epsneg .strip ()
@@ -551,11 +553,11 @@ def smallest_normal(self):
551553 """
552554 # This check is necessary because the value for smallest_normal is
553555 # platform dependent for longdouble types.
554- if isnan (self .machar .smallest_normal .flat [0 ]):
556+ if isnan (self ._machar .smallest_normal .flat [0 ]):
555557 warnings .warn (
556558 'The value of smallest normal is undefined for double double' ,
557559 UserWarning , stacklevel = 2 )
558- return self .machar .smallest_normal .flat [0 ]
560+ return self ._machar .smallest_normal .flat [0 ]
559561
560562 @property
561563 def tiny (self ):
@@ -574,6 +576,20 @@ def tiny(self):
574576 """
575577 return self .smallest_normal
576578
579+ @property
580+ def machar (self ):
581+ """The object which calculated these parameters and holds more
582+ detailed information.
583+
584+ .. deprecated:: 1.22
585+ """
586+ # Deprecated 2021-10-27, NumPy 1.22
587+ warnings .warn (
588+ "`finfo.machar` is deprecated (NumPy 1.22)" ,
589+ DeprecationWarning , stacklevel = 2 ,
590+ )
591+ return self ._machar
592+
577593
578594@set_module ('numpy' )
579595class iinfo :
0 commit comments