MCPcopy Create free account
hub / github.com/numpy/numpy / _do_upgrade

Method _do_upgrade

numpy/lib/_iotools.py:704–722  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

702 return self._callingfunction(value)
703
704 def _do_upgrade(self):
705 # Raise an exception if we locked the converter...
706 if self._locked:
707 errmsg = "Converter is locked and cannot be upgraded"
708 raise ConverterLockError(errmsg)
709 _statusmax = len(self._mapper)
710 # Complains if we try to upgrade by the maximum
711 _status = self._status
712 if _status == _statusmax:
713 errmsg = "Could not find a valid conversion function"
714 raise ConverterError(errmsg)
715 elif _status < _statusmax - 1:
716 _status += 1
717 self.type, self.func, default = self._mapper[_status]
718 self._status = _status
719 if self._initial_default is not None:
720 self.default = self._initial_default
721 else:
722 self.default = default
723
724 def upgrade(self, value):
725 """

Callers 2

upgradeMethod · 0.95
iterupgradeMethod · 0.95

Calls 2

ConverterLockErrorClass · 0.85
ConverterErrorClass · 0.85

Tested by

no test coverage detected