Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tidy3d/components/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,8 +1979,8 @@ def perturbed_mediums_copy(
def doping_bounds(self):
"""Get the maximum and minimum of the doping"""

acceptors_lims = [1e50, -1e50]
donors_lims = [1e50, -1e50]
acceptors_lims = [np.inf, -np.inf]
donors_lims = [np.inf, -np.inf]

for struct in self.all_structures:
if isinstance(struct.medium.charge, SemiconductorMedium):
Expand Down Expand Up @@ -2020,6 +2020,15 @@ def doping_bounds(self):
limits[0] = min_value
if max_value > limits[1]:
limits[1] = max_value
# make sure we have recorded some values. Otherwise, set to 0
if np.isinf(acceptors_lims[0]):
acceptors_lims[0] = 0
if np.isinf(acceptors_lims[1]):
acceptors_lims[1] = 0
if np.isinf(donors_lims[0]):
donors_lims[0] = 0
if np.isinf(donors_lims[1]):
donors_lims[1] = 0
return acceptors_lims, donors_lims

def doping_absolute_minimum(self):
Expand Down
Loading