|
| 1 | +.. _microwave_migration: |
| 2 | + |
| 3 | +v2.10 Refactor Migration |
| 4 | +------------------------- |
| 5 | + |
| 6 | +In version ``v2.10.0``, microwave plugin path integral classes were renamed for improved consistency and clarity. This guide helps you update your scripts to use the new class names. |
| 7 | + |
| 8 | +Key Changes |
| 9 | +~~~~~~~~~~~ |
| 10 | + |
| 11 | +* **Renamed Classes**: Path integral classes have been renamed to follow a consistent naming pattern. |
| 12 | +* **Exports**: All renamed classes are exported from ``tidy3d.plugins.microwave`` - no import path changes needed. |
| 13 | + |
| 14 | +Class Name Changes |
| 15 | +~~~~~~~~~~~~~~~~~~ |
| 16 | + |
| 17 | +The following classes have been renamed for consistency: |
| 18 | + |
| 19 | +**Voltage Integrals:** |
| 20 | + |
| 21 | +* ``VoltageIntegralAxisAligned`` → ``AxisAlignedVoltageIntegral`` |
| 22 | +* ``CustomVoltageIntegral2D`` → ``Custom2DVoltageIntegral`` |
| 23 | + |
| 24 | +**Current Integrals:** |
| 25 | + |
| 26 | +* ``CurrentIntegralAxisAligned`` → ``AxisAlignedCurrentIntegral`` |
| 27 | +* ``CustomCurrentIntegral2D`` → ``Custom2DCurrentIntegral`` |
| 28 | + |
| 29 | +**Path Integrals:** |
| 30 | + |
| 31 | +* ``CustomPathIntegral2D`` → ``Custom2DPathIntegral`` |
| 32 | + |
| 33 | +Migration Examples |
| 34 | +~~~~~~~~~~~~~~~~~~ |
| 35 | + |
| 36 | +**Before (v2.9.x):** |
| 37 | + |
| 38 | +.. code-block:: python |
| 39 | +
|
| 40 | + from tidy3d.plugins.microwave import ( |
| 41 | + VoltageIntegralAxisAligned, |
| 42 | + CurrentIntegralAxisAligned, |
| 43 | + ) |
| 44 | +
|
| 45 | + voltage_path = VoltageIntegralAxisAligned( |
| 46 | + center=(0, 0, 0), |
| 47 | + size=(0, 0, 1), |
| 48 | + sign="+", |
| 49 | + ) |
| 50 | +
|
| 51 | + current_path = CurrentIntegralAxisAligned( |
| 52 | + center=(0, 0, 0), |
| 53 | + size=(2, 1, 0), |
| 54 | + sign="+", |
| 55 | + ) |
| 56 | +
|
| 57 | +**After (v2.10+):** |
| 58 | + |
| 59 | +.. code-block:: python |
| 60 | +
|
| 61 | + from tidy3d.plugins.microwave import ( |
| 62 | + AxisAlignedVoltageIntegral, |
| 63 | + AxisAlignedCurrentIntegral, |
| 64 | + ) |
| 65 | +
|
| 66 | + voltage_path = AxisAlignedVoltageIntegral( |
| 67 | + center=(0, 0, 0), |
| 68 | + size=(0, 0, 1), |
| 69 | + sign="+", |
| 70 | + ) |
| 71 | +
|
| 72 | + current_path = AxisAlignedCurrentIntegral( |
| 73 | + center=(0, 0, 0), |
| 74 | + size=(2, 1, 0), |
| 75 | + sign="+", |
| 76 | + ) |
| 77 | +
|
| 78 | +Custom 2D Path Integrals |
| 79 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 80 | + |
| 81 | +**Before:** |
| 82 | + |
| 83 | +.. code-block:: python |
| 84 | +
|
| 85 | + from tidy3d.plugins.microwave import ( |
| 86 | + CustomVoltageIntegral2D, |
| 87 | + CustomCurrentIntegral2D, |
| 88 | + ) |
| 89 | +
|
| 90 | + vertices = [[0, 0], [1, 0], [1, 1], [0, 1]] |
| 91 | +
|
| 92 | + voltage_path = CustomVoltageIntegral2D( |
| 93 | + axis=2, |
| 94 | + position=0.0, |
| 95 | + vertices=vertices, |
| 96 | + ) |
| 97 | +
|
| 98 | + current_path = CustomCurrentIntegral2D( |
| 99 | + axis=2, |
| 100 | + position=0.0, |
| 101 | + vertices=vertices, |
| 102 | + ) |
| 103 | +
|
| 104 | +**After:** |
| 105 | + |
| 106 | +.. code-block:: python |
| 107 | +
|
| 108 | + from tidy3d.plugins.microwave import ( |
| 109 | + Custom2DVoltageIntegral, |
| 110 | + Custom2DCurrentIntegral, |
| 111 | + ) |
| 112 | +
|
| 113 | + vertices = [[0, 0], [1, 0], [1, 1], [0, 1]] |
| 114 | +
|
| 115 | + voltage_path = Custom2DVoltageIntegral( |
| 116 | + axis=2, |
| 117 | + position=0.0, |
| 118 | + vertices=vertices, |
| 119 | + ) |
| 120 | +
|
| 121 | + current_path = Custom2DCurrentIntegral( |
| 122 | + axis=2, |
| 123 | + position=0.0, |
| 124 | + vertices=vertices, |
| 125 | + ) |
| 126 | +
|
| 127 | +Summary |
| 128 | +~~~~~~~ |
| 129 | + |
| 130 | +All functionality remains the same - only class names have changed. Simply update your imports and class names according to the table above, and your code will work with v2.10. |
0 commit comments