Skip to content

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
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