NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.19k stars 610 forks source link

Make contraint functions for periodic designs compatible with autograd #2518

Closed mawc2019 closed 1 year ago

mawc2019 commented 1 year ago

PR #2465 introduced a bug that made constraint functions incompatible with autograd, although the forward run of those constraint functions does not fail. This PR fixes the bug and add some tests to check the gradients of the constraint functions also observe periodicity.

codecov-commenter commented 1 year ago

Codecov Report

Merging #2518 (b87cb53) into master (28ee9f6) will decrease coverage by 0.02%. The diff coverage is 100.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #2518      +/-   ##
==========================================
- Coverage   73.92%   73.90%   -0.02%     
==========================================
  Files          18       18              
  Lines        5296     5292       -4     
==========================================
- Hits         3915     3911       -4     
  Misses       1381     1381              
Impacted Files Coverage Δ
python/adjoint/filters.py 79.47% <100.00%> (-0.43%) :arrow_down: