From 0e92e95aa4cc7208043058106f594b75c3218f4f Mon Sep 17 00:00:00 2001 From: Yannick Augenstein Date: Wed, 4 Sep 2024 18:04:14 +0200 Subject: [PATCH] Tyler comments 1 --- tidy3d/components/autograd/utils.py | 6 +++--- tidy3d/components/data/data_array.py | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/tidy3d/components/autograd/utils.py b/tidy3d/components/autograd/utils.py index 659fd1965..d9d745041 100644 --- a/tidy3d/components/autograd/utils.py +++ b/tidy3d/components/autograd/utils.py @@ -27,10 +27,10 @@ def get_tracer(x: typing.Any) -> typing.Any: if not is_traced(x): return None - if not _is_traced_objary(x): - return x + if _is_traced_objary(x): + return anp.array(x.tolist()) - return anp.array(x.tolist()) + return x def split_list(x: list[typing.Any], index: int) -> (list[typing.Any], list[typing.Any]): diff --git a/tidy3d/components/data/data_array.py b/tidy3d/components/data/data_array.py index f38f61dea..8022c4ae8 100644 --- a/tidy3d/components/data/data_array.py +++ b/tidy3d/components/data/data_array.py @@ -161,10 +161,6 @@ def _interp_validator(self, field_name: str = None) -> None: This does not check every 'DataArray' by default. Instead, when required, this check can be called from a validator, as is the case with 'CustomMedium' and 'CustomFieldSource'. """ - # skip this validator if currently tracing for autograd - if self.has_tracers: - return - if field_name is None: field_name = "DataArray"