MCPcopy Create free account
hub / github.com/NanoComp/meep / check_weights

Method check_weights

python/geom.py:585–591  ·  view source on GitHub ↗
(self, w)

Source from the content-addressed store, hash-verified

583 """
584
585 def check_weights(self, w):
586 if np.amin(w) >= 0.0 and np.amax(w) <= 1.0:
587 return w
588 warnings.warn(
589 "The weights parameter of MaterialGrid must be in the range [0,1]."
590 )
591 return np.clip(w, 0.0, 1.0)
592
593 def __init__(
594 self,

Callers 2

__init__Method · 0.95
update_weightsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected