You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a brief proposal for changing the directory structure of the repository to prevent undesired cross-module dependencies but still enable fast development and iteration.
Current State
The current directory structure of the ucc repository is
Here both ucc and benchmarks are python packages. However in switching to poetry from setuptools, we no longer distribute the benchmarks module in the python wheel. This is preferred, as users might be confused to have benchmarks as an available package even though they only installed ucc.
Some ucc unit tests also import from the benchmarks module. These would fail for users that want to run tests directly on the python packages. (Tangentially related, I think the recommend pattern, as shown in the poetry docs is to hoist the unit tests up a level and not distribute them as a submodule of ucc.)
Proposal
Long term, I think @nathanshammah has the right idea of moving benchmarking to a separate repository (perhaps even metriq) as users of ucc won't need them. But in the alpha phase of the project, I believe there is a benefit of having this monorepo-like structure, where it will be easier to iterate on benchmark and core ucc code together.
Keep benchmarks and ucc folders as siblings, but hoist the ucc/tests module up a level.
Move the function referenced in the docs to a new ucc.helper or ucc.common submodule (not sure on name).
from benchmarks.scripts.common import count_multi_qubit_gates_qiskit
Add a pre-commit hook/lint check (as part of adding those generally) which prevents any code in ucc module importing from the benchmarks file.
Open Questions
The unit test below imports two helpers from the benchmark module. Should those helpers be moved as well? We can leave as is if we no longer "ship" the unit test code, but it feels off to have this cross dependency
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a brief proposal for changing the directory structure of the repository to prevent undesired cross-module dependencies but still enable fast development and iteration.
Current State
The current directory structure of the
ucc
repository isucc ├── benchmarks │ ├── qasm_circuits │ ├── results │ └── scripts ├── docs │ └── source └── ucc ├── tests ├── transpiler_passes └── transpilers
Here both
ucc
andbenchmarks
are python packages. However in switching topoetry
fromsetuptools
, we no longer distribute thebenchmarks
module in the python wheel. This is preferred, as users might be confused to havebenchmarks
as an available package even though they only installeducc
.But this causes two issues:
count_multi_qubit_gates_qiskit
#204 , an example in the docs imports helper functions from thebenchmarks
module, but these won't be availableucc
unit tests also import from thebenchmarks
module. These would fail for users that want to run tests directly on the python packages. (Tangentially related, I think the recommend pattern, as shown in thepoetry
docs is to hoist the unit tests up a level and not distribute them as a submodule of ucc.)Proposal
Long term, I think @nathanshammah has the right idea of moving benchmarking to a separate repository (perhaps even metriq) as users of
ucc
won't need them. But in the alpha phase of the project, I believe there is a benefit of having this monorepo-like structure, where it will be easier to iterate on benchmark and core ucc code together.benchmarks
anducc
folders as siblings, but hoist theucc/tests
module up a level.ucc.helper
orucc.common
submodule (not sure on name).ucc/docs/source/user_guide.rst
Line 33 in 9f5e96c
ucc
module importing from thebenchmarks
file.Open Questions
benchmark
module. Should those helpers be moved as well? We can leave as is if we no longer "ship" the unit test code, but it feels off to have this cross dependencyucc/ucc/tests/test_compile.py
Line 11 in 9f5e96c
Beta Was this translation helpful? Give feedback.
All reactions