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

Hash test #64

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Hash test #64

wants to merge 33 commits into from

Conversation

SkandanC
Copy link
Contributor

PR after SiPANN dependency conflict fix merge.

SkandanC and others added 29 commits March 15, 2022 09:58
Delete one of the hash test files and put tests into a class method under one file.

Change print statements to assert statements.
SiPANN is needed in the `py` virtual environment.
SiPANN needed for SiPANN hash tests.

numpy version of at least 1.22 needed to avoid nlopt import issues (See here: https://githubhot.com/repo/stevengj/nlopt/issues/447)
Python 3,8 is required to install numpy>=1.22.0, which is needed yo avoid nlopt import errors while attempting to import sipann.
Python 3.8+ is needed to install numpy>=1.22.0
brancher.multiconnect(wg1, wg2, wg3)

assert brancher.circuit == wg1.circuit
assert wg1.circuit == wg2.circuit
assert wg2.circuit == wg3.circuit
assert brancher.__hash__() == brancher2.__hash__()
assert brancher.__hash__() != brancher3.__hash__()
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to have any tests here. The other tests you have are sufficient.

assert (hr1siepic.__hash__() == hr2siepic.__hash__())

hr1siepic = siepic.HalfRing(gap=8e-8, radius=10e-6, width=5.2e-7, thickness=2.1e-7)
hr2siepic = siepic.HalfRing(gap=1e-7, radius=1e-5, width=5e-7, thickness=2.2e-7)
Copy link
Contributor

Choose a reason for hiding this comment

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

For components with multiple parameters, you should probably do multiple tests where each test only has 1 parameter different. That way you can get full coverage.


bdc1 = siepic.BidirectionalCoupler(thickness=2.2e-7, width=5e-7)
bdc2 = siepic.BidirectionalCoupler(thickness=2.2e-7, width=5e-7)
assert (bdc1.__hash__() == bdc2.__hash__())
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the extra layer of parenthesis on this assert and all of the rest to match the rest of the testing code.

@AustP AustP self-requested a review July 19, 2022 19:05
@sequoiap
Copy link
Collaborator

sequoiap commented Oct 27, 2022

Can you remind me what this is supposed to be for? @SkandanC

@SkandanC
Copy link
Contributor Author

Austen wanted me to add __hash__() methods to components. I discovered that SiPANN cannot eb installed on py3.11 because tensorflow is not available on py3.11, so merging this would fail checks for py3.11 now.

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.

3 participants