diff --git a/docs/notebooks b/docs/notebooks index 7eb7e637ec..5a8123cd4b 160000 --- a/docs/notebooks +++ b/docs/notebooks @@ -1 +1 @@ -Subproject commit 7eb7e637ec1cc3b14c462adcc67597345a945fa3 +Subproject commit 5a8123cd4b3fd1a816dc9c2acfe4b6de619fe7c4 diff --git a/tests/test_plugins/test_component_modeler.py b/tests/test_plugins/test_component_modeler.py index 35f811dfac..a513184ee8 100644 --- a/tests/test_plugins/test_component_modeler.py +++ b/tests/test_plugins/test_component_modeler.py @@ -12,18 +12,6 @@ ) from tidy3d.exceptions import SetupError, Tidy3dKeyError from ..utils import run_emulated -from ..test_web.test_webapi import ( - mock_upload, - mock_metadata, - mock_get_info, - mock_start, - mock_monitor, - mock_download, - mock_load, - mock_job_status, - mock_load, - set_api_key, -) # Waveguide height wg_height = 0.22 @@ -402,7 +390,7 @@ def test_import_smatrix_smatrix(): def test_to_from_file_batch(monkeypatch, tmp_path): modeler = make_component_modeler(path_dir=str(tmp_path)) - s_matrix = run_component_modeler(monkeypatch, modeler) + _ = run_component_modeler(monkeypatch, modeler) batch = td.web.Batch(simulations=dict()) diff --git a/tests/test_plugins/test_invdes.py b/tests/test_plugins/test_invdes.py index 9bd505d0dd..8a06a08044 100644 --- a/tests/test_plugins/test_invdes.py +++ b/tests/test_plugins/test_invdes.py @@ -9,15 +9,11 @@ import tidy3d as td import tidy3d.plugins.adjoint as tda import tidy3d.plugins.invdes as tdi -import matplotlib.pyplot as plt # use single threading pipeline from . import test_adjoint as ta -ta.NUM_PROC_PARALLEL = 1 - -from .test_adjoint import use_emulated_run, use_emulated_run_async -from ..utils import run_emulated, log_capture, assert_log_level, AssertLogLevel +from ..utils import run_emulated, assert_log_level, AssertLogLevel FREQ0 = 1e14 L_SIM = 1.0 @@ -25,6 +21,8 @@ MNT_NAME2 = "mnt_name2" HISTORY_FNAME = "tests/data/invdes_history.pkl" +ta.NUM_PROC_PARALLEL = 1 + mnt1 = td.FieldMonitor( center=(L_SIM / 3.0, 0, 0), size=(0, td.inf, td.inf), freqs=[FREQ0], name=MNT_NAME1 ) @@ -72,10 +70,10 @@ def test_region_params(): design_region = make_design_region() - PARAMS_0 = np.random.random(design_region.params_shape) - PARAMS_0 = design_region.params_random - PARAMS_0 = design_region.params_ones - PARAMS_0 = design_region.params_zeros + _ = np.random.random(design_region.params_shape) + _ = design_region.params_random + _ = design_region.params_ones + _ = design_region.params_zeros def test_region_penalties(): @@ -287,7 +285,7 @@ def test_invdes_multi_same_length(): output_monitor_names = [([MNT_NAME1, MNT_NAME2], None)[i % 2] for i in range(n)] invdes = invdes.updated_copy(output_monitor_names=output_monitor_names) - ds = invdes.designs + _ = invdes.designs def make_optimizer(): @@ -316,7 +314,7 @@ def test_default_params(use_emulated_run): optimizer = make_optimizer() - PARAMS_0 = np.random.random(optimizer.design.design_region.params_shape) + _ = np.random.random(optimizer.design.design_region.params_shape) optimizer.run() @@ -366,7 +364,7 @@ def test_result_store_full_results_is_false(use_emulated_run): assert len(result.history[key]) == optimizer.num_steps # this should still work, even if ``store_full_results == False`` - val_last1 = result.last["params"] + _ = result.last["params"] def test_continue_run_fns(use_emulated_run): @@ -411,21 +409,21 @@ def test_result(use_emulated_run, use_emulated_run_async, tmp_path): assert np.allclose(val_last1, val_last2) result.plot_optimization() - sim_data_last = result.sim_data_last(task_name="last") + _ = result.sim_data_last(task_name="last") def test_result_data(use_emulated_run): """Test methods of the ``InverseDesignResult`` object.""" result = make_result(use_emulated_run) - sim_last = result.sim_last - sim_data_last = result.sim_data_last(task_name="last") + _ = result.sim_last + _ = result.sim_data_last(task_name="last") def test_result_data_multi(use_emulated_run_async, tmp_path): result_multi = make_result_multi(use_emulated_run_async) - sim_last = result_multi.sim_last - sim_data_last = result_multi.sim_data_last(task_name="last") + _ = result_multi.sim_last + _ = result_multi.sim_data_last(task_name="last") def test_result_empty(): @@ -496,8 +494,6 @@ def test_jax_array_impl_import_pass(tmp_path, log_capture): def test_fn_source_error(monkeypatch, exception, ok): """Make sure type errors are caught when grabbing function source code.""" - import inspect - def getsource_error(*args, **kwargs): raise exception