Wrapper for GaussianBeam3DSource to warn the user when running 2D simulations that this behavior is deprecated and they should be using GaussianBeam2DSource.
| 1068 | |
| 1069 | |
| 1070 | class GaussianBeamSource(GaussianBeam3DSource): |
| 1071 | """ |
| 1072 | Wrapper for GaussianBeam3DSource to warn the user when running 2D simulations that this behavior is deprecated and they should be using GaussianBeam2DSource. |
| 1073 | """ |
| 1074 | |
| 1075 | def add_source(self, sim): |
| 1076 | if sim.dimensions == 2: |
| 1077 | warnings.warn( |
| 1078 | "GaussianBeamSource is deprecated for 2D simulations. For more accurate results, use GaussianBeam2DSource instead. In the future, this will be the default behavior.", |
| 1079 | DeprecationWarning, |
| 1080 | ) |
| 1081 | super().add_source(sim) |
| 1082 | |
| 1083 | |
| 1084 | class IndexedSource(Source): |
nothing calls this directly
no outgoing calls
no test coverage detected