This PR decouples the CrossSection from the Cell. This has the advantage that a CrossSection will no longer have a z_min and z_max (present in Cell) which should improve caching of previously calculated modes.
This required some breaking changes:
Cell is no longer an attribute of CrossSection. Wherever you used cs.cell or similar you'll have to find an alternative way of accessing the needed information. Note: mesh is now a native attribute of CrossSection.
Use CrossSection.from_cell(cell=cell, env=env) wherever you used to use CrossSection(cell=cell, env=env)
A Mode depends on a CrossSection not on a Cell and hence its .cell attribute is now also gone. This will obviously improve caching but unfortunately this also means you'll have to provide cells as a second argument to compute_s_matrix from now on. Since compute_s_matrix only depends on the cell length you can also skip supplying cells and specify cell_lengths as a keyword argument for that function.
The ez_interfaces attribute (previously in Cell) is now moded to Mesh.
There are a bunch of other minor changes under the hood (such as Geometry->Geometry2D,Geometry3D and Structure->Structure2D,Structure3D) but these should not touch the user API.
@Jan-David-Black , feel free to comment or request changes. I'm planning to merge this branch on Thursday.
This PR decouples the CrossSection from the Cell. This has the advantage that a CrossSection will no longer have a z_min and z_max (present in Cell) which should improve caching of previously calculated modes.
This required some breaking changes:
cs.cell
or similar you'll have to find an alternative way of accessing the needed information. Note:mesh
is now a native attribute ofCrossSection
.CrossSection.from_cell(cell=cell, env=env)
wherever you used to useCrossSection(cell=cell, env=env)
Mode
depends on aCrossSection
not on aCell
and hence its.cell
attribute is now also gone. This will obviously improve caching but unfortunately this also means you'll have to providecells
as a second argument tocompute_s_matrix
from now on. Sincecompute_s_matrix
only depends on the cell length you can also skip supplyingcells
and specifycell_lengths
as a keyword argument for that function.ez_interfaces
attribute (previously inCell
) is now moded toMesh
.There are a bunch of other minor changes under the hood (such as Geometry->Geometry2D,Geometry3D and Structure->Structure2D,Structure3D) but these should not touch the user API.
@Jan-David-Black , feel free to comment or request changes. I'm planning to merge this branch on Thursday.