MCPcopy Create free account
hub / github.com/circuitnet/CircuitNet / compute_density

Method compute_density

feature_extraction/src/read.py:717–731  ·  view source on GitHub ↗
(self, density, location_on_gcell)

Source from the content-addressed store, hash-verified

715 Functions for computing density.
716 """
717 def compute_density(self, density, location_on_gcell):
718 gcell_left, gcell_lower, gcell_right, gcell_upper = location_on_gcell
719 if gcell_left == self.gcell_coordinate_x.size: # avoid getting size+1 from bisect_left
720 gcell_left = gcell_left - 1
721 if gcell_lower == self.gcell_coordinate_y.size:
722 gcell_lower = gcell_lower - 1
723 if gcell_right == self.gcell_coordinate_x.size:
724 gcell_right = gcell_right - 1
725 if gcell_upper == self.gcell_coordinate_y.size:
726 gcell_upper = gcell_upper - 1
727
728 for j in my_range(gcell_left, gcell_right):
729 for k in my_range(gcell_lower, gcell_upper):
730 density[j, k] += 1
731 return density
732
733 def compute_density_with_overlap(self, density, location_on_coordinate, location_on_gcell):
734 x_left, y_lower, x_right, y_upper = location_on_coordinate

Callers 3

compute_cell_densityMethod · 0.95
get_RUDYMethod · 0.95
compute_DRC_densityMethod · 0.95

Calls 1

my_rangeFunction · 0.90

Tested by

no test coverage detected