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

Function get_masked_subclass

numpy/ma/core.py:693–717  ·  view source on GitHub ↗

Return the youngest subclass of MaskedArray from a list of (masked) arrays. In case of siblings, the first listed takes over.

(*arrays)

Source from the content-addressed store, hash-verified

691
692
693def get_masked_subclass(*arrays):
694 """
695 Return the youngest subclass of MaskedArray from a list of (masked) arrays.
696
697 In case of siblings, the first listed takes over.
698
699 """
700 if len(arrays) == 1:
701 arr = arrays[0]
702 if isinstance(arr, MaskedArray):
703 rcls = type(arr)
704 else:
705 rcls = MaskedArray
706 else:
707 arrcls = [type(a) for a in arrays]
708 rcls = arrcls[0]
709 if not issubclass(rcls, MaskedArray):
710 rcls = MaskedArray
711 for cls in arrcls[1:]:
712 if issubclass(cls, rcls):
713 rcls = cls
714 # Don't return MaskedConstant as result: revert to MaskedArray
715 if rcls.__name__ == 'MaskedConstant':
716 return MaskedArray
717 return rcls
718
719
720def getdata(a, subok=True):

Callers 9

__call__Method · 0.85
__call__Method · 0.85
reduceMethod · 0.85
outerMethod · 0.85
accumulateMethod · 0.85
__call__Method · 0.85
concatenateFunction · 0.85
resizeFunction · 0.85
dotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…