File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1979,8 +1979,8 @@ def perturbed_mediums_copy(
19791979 def doping_bounds (self ):
19801980 """Get the maximum and minimum of the doping"""
19811981
1982- acceptors_lims = [1e50 , - 1e50 ]
1983- donors_lims = [1e50 , - 1e50 ]
1982+ acceptors_lims = [np . inf , - np . inf ]
1983+ donors_lims = [np . inf , - np . inf ]
19841984
19851985 for struct in self .all_structures :
19861986 if isinstance (struct .medium .charge , SemiconductorMedium ):
@@ -2020,6 +2020,15 @@ def doping_bounds(self):
20202020 limits [0 ] = min_value
20212021 if max_value > limits [1 ]:
20222022 limits [1 ] = max_value
2023+ # make sure we have recorded some values. Otherwise, set to 0
2024+ if np .isinf (acceptors_lims [0 ]):
2025+ acceptors_lims [0 ] = 0
2026+ if np .isinf (acceptors_lims [1 ]):
2027+ acceptors_lims [1 ] = 0
2028+ if np .isinf (donors_lims [0 ]):
2029+ donors_lims [0 ] = 0
2030+ if np .isinf (donors_lims [1 ]):
2031+ donors_lims [1 ] = 0
20232032 return acceptors_lims , donors_lims
20242033
20252034 def doping_absolute_minimum (self ):
You can’t perform that action at this time.
0 commit comments