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

Method update_weights

python/geom.py:699–708  ·  view source on GitHub ↗

Reset the `weights` to `x`.

(self, x: np.ndarray)

Source from the content-addressed store, hash-verified

697 self.swigobj = None
698
699 def update_weights(self, x: np.ndarray):
700 """
701 Reset the `weights` to `x`.
702 """
703 if x.size != self.num_params:
704 raise ValueError(
705 f"weights of shape {self.weights.size} do not match user specified grid dimension: {self.grid_size}"
706 )
707
708 self.weights[:] = self.check_weights(x).flatten().astype(np.float64)
709
710
711class Susceptibility:

Callers 1

Calls 1

check_weightsMethod · 0.95

Tested by

no test coverage detected