Skip to content

Commit

Permalink
Revision2
Browse files Browse the repository at this point in the history
  • Loading branch information
weiliangjin2021 committed May 2, 2024
1 parent 7a56dd8 commit 0514f40
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tidy3d/plugins/dispersion/fit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Fit PoleResidue Dispersion models to optical NK data
"""
from __future__ import annotations

from typing import Tuple, List, Optional
import csv
Expand Down Expand Up @@ -564,7 +565,9 @@ def _validate_url_load(data_load: List):
raise ValidationError("Invalid URL. Too many k labels.")

@classmethod
def from_url(cls, url_file: str, delimiter: str = ",", ignore_k: bool = False, **kwargs):
def from_url(
cls, url_file: str, delimiter: str = ",", ignore_k: bool = False, **kwargs
) -> DispersionFitter:
"""loads :class:`DispersionFitter` from url linked to a csv/txt file that
contains wavelength (micron), n, and optionally k data. Preferred from
refractiveindex.info.
Expand Down Expand Up @@ -652,7 +655,7 @@ def from_url(cls, url_file: str, delimiter: str = ",", ignore_k: bool = False, *
return cls(wvl_um=n_lam[:, 0], n_data=n_lam[:, 1], **kwargs)

@classmethod
def from_file(cls, fname: str, **loadtxt_kwargs):
def from_file(cls, fname: str, **loadtxt_kwargs) -> DispersionFitter:
"""Loads :class:`DispersionFitter` from file containing wavelength, n, k data.
Parameters
Expand Down Expand Up @@ -705,7 +708,7 @@ def from_complex_permittivity(
eps_real: ArrayFloat1D,
eps_imag: ArrayFloat1D = None,
wvl_range: Tuple[Optional[float], Optional[float]] = (None, None),
):
) -> DispersionFitter:
"""Loads :class:`DispersionFitter` from wavelength and complex relative permittivity data
Parameters
Expand Down Expand Up @@ -737,7 +740,7 @@ def from_loss_tangent(
eps_real: ArrayFloat1D,
loss_tangent: ArrayFloat1D,
wvl_range: Tuple[Optional[float], Optional[float]] = (None, None),
):
) -> DispersionFitter:
"""Loads :class:`DispersionFitter` from wavelength and loss tangent data.
Parameters
Expand Down

0 comments on commit 0514f40

Please sign in to comment.