XanaduAI / MrMustard

A differentiable bridge between phase space and Fock space
https://mrmustard.readthedocs.io/
Apache License 2.0
78 stars 27 forks source link

Updating type hints #466

Closed apchytr closed 2 months ago

apchytr commented 3 months ago

Reopening to avoid unwanted commits

Context: The use of Optional and Union should be replaced with | according to PEP standards.

Description of the Change: Optional -> | None, Union -> |, Tuple -> tuple, etc

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 96.87500% with 5 lines in your changes missing coverage. Please review.

Project coverage is 89.23%. Comparing base (4b2eb81) to head (5718df6). Report is 1 commits behind head on develop.

Files Patch % Lines
mrmustard/training/parameter_update.py 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #466 +/- ## ======================================== Coverage 89.22% 89.23% ======================================== Files 102 102 Lines 7201 7206 +5 ======================================== + Hits 6425 6430 +5 Misses 776 776 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | Coverage Δ | | |---|---|---| | [mrmustard/lab/abstract/state.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab%2Fabstract%2Fstate.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYi9hYnN0cmFjdC9zdGF0ZS5weQ==) | `92.66% <100.00%> (ø)` | | | [mrmustard/lab/abstract/transformation.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab%2Fabstract%2Ftransformation.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYi9hYnN0cmFjdC90cmFuc2Zvcm1hdGlvbi5weQ==) | `89.53% <100.00%> (ø)` | | | [mrmustard/lab/circuit.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab%2Fcircuit.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYi9jaXJjdWl0LnB5) | `95.08% <100.00%> (-0.08%)` | :arrow_down: | | [mrmustard/lab/detectors.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab%2Fdetectors.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYi9kZXRlY3RvcnMucHk=) | `79.86% <100.00%> (+0.13%)` | :arrow_up: | | [mrmustard/lab/gates.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab%2Fgates.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYi9nYXRlcy5weQ==) | `97.25% <100.00%> (+<0.01%)` | :arrow_up: | | [mrmustard/lab/states.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab%2Fstates.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYi9zdGF0ZXMucHk=) | `100.00% <100.00%> (ø)` | | | [mrmustard/lab/utils.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab%2Futils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYi91dGlscy5weQ==) | `100.00% <100.00%> (ø)` | | | [mrmustard/lab\_dev/circuit\_components.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuit_components.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdF9jb21wb25lbnRzLnB5) | `98.38% <100.00%> (ø)` | | | [...mustard/lab\_dev/circuit\_components\_utils/b\_to\_q.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuit_components_utils%2Fb_to_q.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdF9jb21wb25lbnRzX3V0aWxzL2JfdG9fcS5weQ==) | `100.00% <ø> (ø)` | | | [mrmustard/lab\_dev/circuits.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fcircuits.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvY2lyY3VpdHMucHk=) | `93.02% <100.00%> (ø)` | | | ... and [33 more](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [4b2eb81...5718df6](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/466?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI).