From ed78fc82fa9035dc0dcd6b089b59e2290ab26569 Mon Sep 17 00:00:00 2001 From: Marc Bolinches Date: Fri, 24 Jan 2025 17:28:47 +0100 Subject: [PATCH] Final comment --- tests/test_components/test_heat_charge.py | 12 ++++++------ tidy3d/components/scene.py | 2 +- tidy3d/components/tcad/doping.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_components/test_heat_charge.py b/tests/test_components/test_heat_charge.py index aa39ae66e1..b41fea8b4d 100644 --- a/tests/test_components/test_heat_charge.py +++ b/tests/test_components/test_heat_charge.py @@ -1134,7 +1134,7 @@ def test_gaussian_doping_sigma_calculation(): def test_gaussian_doping_get_contrib(): - """Test get_contrib method in GaussianDoping.""" + """Test _get_contrib method in GaussianDoping.""" max_N = 1e18 min_N = 1e15 width = 0.1 @@ -1142,24 +1142,24 @@ def test_gaussian_doping_get_contrib(): box = td.GaussianDoping(ref_con=min_N, concentration=max_N, width=width, source="xmin") coords = {"x": [0], "y": [0], "z": [0]} - contrib = box.get_contrib(coords) + contrib = box._get_contrib(coords) assert np.isclose(float(contrib), max_N, rtol=1e-6) coords = {"x": [0.5], "y": [0], "z": [0]} - contrib = box.get_contrib(coords) + contrib = box._get_contrib(coords) assert np.isclose(float(contrib), min_N, rtol=1e-6) coords = {"x": [0.5 - width / 2], "y": [0], "z": [0]} - contrib = box.get_contrib(coords) + contrib = box._get_contrib(coords) expected_value = max_N * np.exp(-width * width / 4 / box.sigma / box.sigma / 2) assert np.isclose(float(contrib), expected_value, rtol=1e-6) def test_gaussian_doping_get_contrib_2d_coords(): - """Test get_contrib method in GaussianDoping with 2D coordinates.""" + """Test _get_contrib method in GaussianDoping with 2D coordinates.""" box = td.GaussianDoping(ref_con=1e15, concentration=1e18, width=0.1, source="xmin") coords = {"x": [0], "y": [0], "z": [-0.5, 0, 0.5]} - contrib = box.get_contrib(coords) + contrib = box._get_contrib(coords) def test_gaussian_doping_bounds_behavior(): diff --git a/tidy3d/components/scene.py b/tidy3d/components/scene.py index 74564eb547..cbe31a741b 100644 --- a/tidy3d/components/scene.py +++ b/tidy3d/components/scene.py @@ -1871,7 +1871,7 @@ def _pcolormesh_shape_doping_box( struct_doping[n] = struct_doping[n] + contrib if isinstance(doping_box, GaussianDoping): coords_dict = {"xyz"[d]: coords_2D[d] for d in plane_axes_inds} - contrib = doping_box.get_contrib(coords_dict) + contrib = doping_box._get_contrib(coords_dict) struct_doping[n] = struct_doping[n] + contrib if plt_type == "doping": diff --git a/tidy3d/components/tcad/doping.py b/tidy3d/components/tcad/doping.py index 9a64a6252d..5c2d7bfb45 100644 --- a/tidy3d/components/tcad/doping.py +++ b/tidy3d/components/tcad/doping.py @@ -158,7 +158,7 @@ def sigma(self): """The sigma parameter of the pseudo-gaussian""" return np.sqrt(-self.width * self.width / 2 / np.log(self.ref_con / self.concentration)) - def get_contrib(self, coords: dict, meshgrid: bool = True): + def _get_contrib(self, coords: dict, meshgrid: bool = True): """Returns the contribution to the doping a the locations specified in coords""" # work out whether x,y, and z are present