MCPcopy Index your code
hub / github.com/numpy/numpy / _do_upgrade

Method _do_upgrade

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

Source from the content-addressed store, hash-verified

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

Callers 2

upgradeMethod · 0.95
iterupgradeMethod · 0.95

Calls 2

ConverterLockErrorClass · 0.85
ConverterErrorClass · 0.85

Tested by

no test coverage detected