-
Notifications
You must be signed in to change notification settings - Fork 35
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
base: master
Are you sure you want to change the base?
Hash test #64
Conversation
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
simphony/tests/test_models.py
Outdated
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__() |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
simphony/tests/test_hash.py
Outdated
|
||
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__()) |
There was a problem hiding this comment.
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.
Can you remind me what this is supposed to be for? @SkandanC |
Austen wanted me to add |
PR after SiPANN dependency conflict fix merge.