Skip to content
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

Allow design-grid resolution to accept a tuple #2599

Merged
merged 3 commits into from Aug 9, 2023

Conversation

mawc2019
Copy link
Contributor

This PR allows the resolution argument in filters.py to accept a tuple, so that different resolutions along different directions can be supported. This PR also refactors the code in filters.py.

@codecov-commenter
Copy link

codecov-commenter commented Jul 31, 2023

Codecov Report

Merging #2599 (9c48402) into master (cd9a7eb) will decrease coverage by 0.09%.
Report is 1 commits behind head on master.
The diff coverage is 86.44%.

❗ 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    #2599      +/-   ##
==========================================
- Coverage   73.90%   73.81%   -0.09%     
==========================================
  Files          18       18              
  Lines        5293     5294       +1     
==========================================
- Hits         3912     3908       -4     
- Misses       1381     1386       +5     
Files Changed Coverage Δ
python/adjoint/filters.py 77.20% <86.44%> (-2.49%) ⬇️

Copy link
Collaborator

@oskooi oskooi left a comment

Choose a reason for hiding this comment

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

Would be good to include a unit test for this feature. One suggestion would be to simply verify that defining a filter with the resolution tuple (res, res) produces the same result as passing in just res.

python/adjoint/filters.py Show resolved Hide resolved
@mawc2019 mawc2019 force-pushed the design_resolution_tuple_in_filters branch from 1b59762 to 6c94f35 Compare August 4, 2023 21:39
@mawc2019
Copy link
Contributor Author

mawc2019 commented Aug 4, 2023

One suggestion would be to simply verify that defining a filter with the resolution tuple (res, res) produces the same result as passing in just res.

I have added a different but more stringent test, in which one of the elements of the resolution tuple is zero, which defines a 1d design pattern. Suppose a 1d design pattern is defined in the x direction. Whether this 1d design pattern is periodic in the y direction or not should make no difference in the filtered 1d patterns. Likewise, suppose a 1d design pattern is defined in the y direction. There should be no difference whether this 1d design pattern is periodic in the x direction. The new test function checks this identity based on lengthscale constraint functions.

Copy link
Collaborator

@oskooi oskooi left a comment

Choose a reason for hiding this comment

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

LGTM.

python/tests/test_adjoint_solver.py Outdated Show resolved Hide resolved
@oskooi oskooi merged commit dad3e52 into NanoComp:master Aug 9, 2023
5 checks passed
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.

None yet

3 participants