Skip to content

📡 RF modular restructure v1 #2567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

daquinteroflex
Copy link
Collaborator

@daquinteroflex daquinteroflex commented Jun 12, 2025

Initial reorganization into physics-domain specific structure what's shared between EM and what is RF specific.

Greptile Summary

Major reorganization of RF-specific functionality into a dedicated microwave module, separating it from the general EM components for better modularity and maintainability.

  • Moved RF components from tidy3d/plugins/smatrix and tidy3d/plugins/microwave to a new dedicated tidy3d/microwave package
  • Added RF license requirement warnings across microwave-related components for future licensing changes
  • Several critical import paths still need verification (import errors likely in tidy3d/microwave/__init__.py)
  • Maintained core functionality while restructuring, with key components like ports, component modelers, and path integrals being reorganized
  • Important validations needed: on-the-fly imports, submodule imports, and notebook compatibility checks still pending

@daquinteroflex daquinteroflex changed the base branch from develop to yaugenst-flex/pydantic-v2 June 12, 2025 12:43
@daquinteroflex daquinteroflex force-pushed the dario/rf_structure_refactor branch 2 times, most recently from ebb1315 to e1de4c7 Compare June 12, 2025 13:12
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/pydantic-v2 branch from bc3751e to 8f478bd Compare June 13, 2025 18:39
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/pydantic-v2 branch 4 times, most recently from 46e6015 to 0caf92f Compare June 26, 2025 06:18
@yaugenst-flex yaugenst-flex force-pushed the yaugenst-flex/pydantic-v2 branch 5 times, most recently from 09d1e4a to 7e2c693 Compare July 4, 2025 10:58
@daquinteroflex daquinteroflex changed the base branch from yaugenst-flex/pydantic-v2 to develop July 4, 2025 13:37
@daquinteroflex daquinteroflex force-pushed the dario/rf_structure_refactor branch from d35a9a3 to 978c5cc Compare July 4, 2025 13:37
@daquinteroflex daquinteroflex force-pushed the dario/rf_structure_refactor branch from 9c34ca6 to 122bab6 Compare July 4, 2025 13:41
@daquinteroflex daquinteroflex marked this pull request as ready for review July 4, 2025 13:42
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

35 files reviewed, 4 comments
Edit PR Review Bot Settings | Greptile

AxisAlignedPathIntegral,
CurrentIntegralAxisAligned,
VoltageIntegralAxisAligned,
)
from .rf_material_library import rf_material_library
from tidy3d.components.microwave.rf_material_library import rf_material_library
from tidy3d.microwave.lobe_measurer import LobeMeasurer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Inconsistent module placement - LobeMeasurer is imported from tidy3d.microwave while all other components are moved to tidy3d.components.microwave. This breaks the modularization pattern.

from .component_modelers.modal import ComponentModeler
from .ports.modal import Port
from tidy3d.components.microwave.component_modelers.modal import ComponentModeler
from tidy3d.components.microwave.ports.modal import Port

__all__ = ["ComponentModeler", "Port"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Add explicit version deprecation warning using warnings.warn to notify users about future path changes

Suggested change
__all__ = ["ComponentModeler", "Port"]
import warnings
warnings.warn(
"Importing from tidy3d.plugins.smatrix.smatrix is deprecated and will be removed in a future version. "
"Use 'from tidy3d.components.microwave.component_modelers.modal import ComponentModeler' instead.",
DeprecationWarning,
stacklevel=2,
)
__all__ = ["ComponentModeler", "Port"]

Comment on lines 7 to 17
from tidy3d.components.microwave.component_modelers.modal import (
AbstractComponentModeler,
ComponentModeler,
ModalPortDataArray,
)
from tidy3d.components.microwave.component_modelers.terminal import TerminalComponentModeler
from tidy3d.components.microwave.data.terminal import PortDataArray, TerminalPortDataArray
from tidy3d.components.microwave.ports.coaxial_lumped import CoaxialLumpedPort
from tidy3d.components.microwave.ports.modal import Port
from tidy3d.components.microwave.ports.rectangular_lumped import LumpedPort
from tidy3d.components.microwave.ports.wave import WavePort
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider grouping these imports by type (component modelers, data, ports) using separate import blocks with newlines for better readability

Comment on lines 11 to 25
__all__ = [
"AxisAlignedPathIntegral",
"CurrentIntegralAxisAligned",
"CurrentIntegralTypes",
"CustomCurrentIntegral2D",
"CustomPathIntegral2D",
"CustomVoltageIntegral2D",
"ImpedanceCalculator",
"LobeMeasurer",
"RectangularAntennaArrayCalculator",
"VoltageIntegralAxisAligned",
"VoltageIntegralTypes",
"models",
"path_integrals_from_lumped_element",
"rf_material_library",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Several symbols listed in all are not imported anywhere in this file (e.g., AxisAlignedPathIntegral, ImpedanceCalculator)

@daquinteroflex
Copy link
Collaborator Author

@dmarek-flex it'd be good if we can chat about this at some point

Copy link
Contributor

github-actions bot commented Jul 7, 2025

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/init.py (100%)
  • tidy3d/components/grid/grid_spec.py (100%)
  • tidy3d/components/simulation.py (100%)
  • tidy3d/em/microwave/init.py (100%)
  • tidy3d/em/microwave/array_factor.py (100%)
  • tidy3d/em/microwave/auto_path_integrals.py (100%)
  • tidy3d/em/microwave/component_modelers/base.py (100%)
  • tidy3d/em/microwave/component_modelers/modal.py (100%)
  • tidy3d/em/microwave/component_modelers/terminal.py (100%)
  • tidy3d/em/microwave/lumped_element.py (100%)
  • tidy3d/em/microwave/ports/base_lumped.py (100%)
  • tidy3d/em/microwave/ports/coaxial_lumped.py (100%)
  • tidy3d/em/microwave/ports/rectangular_lumped.py (100%)
  • tidy3d/plugins/microwave/init.py (100%)
  • tidy3d/plugins/smatrix/init.py (100%)
  • tidy3d/plugins/smatrix/smatrix.py (100%)

Summary

  • Total: 63 lines
  • Missing: 0 lines
  • Coverage: 100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant