MCPcopy Create free account
hub / github.com/shapely/shapely / wrapped

Function wrapped

shapely/decorators.py:74–91  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

72
73 @wraps(func)
74 def wrapped(*args, **kwargs):
75 array_args = [
76 arg for arg in args if isinstance(arg, np.ndarray) and arg.dtype == object
77 ] + [
78 arg
79 for name, arg in kwargs.items()
80 if name not in {"where", "out"}
81 and isinstance(arg, np.ndarray)
82 and arg.dtype == object
83 ]
84 old_flags = [arr.flags.writeable for arr in array_args]
85 try:
86 for arr in array_args:
87 arr.flags.writeable = False
88 return func(*args, **kwargs)
89 finally:
90 for arr, old_flag in zip(array_args, old_flags):
91 arr.flags.writeable = old_flag
92
93 return wrapped
94

Callers 2

test_requires_geos_okFunction · 0.85

Calls 1

funcFunction · 0.85

Tested by 2

test_requires_geos_okFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…