XanaduAI / MrMustard

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

Updating type hints #465

Closed apchytr closed 1 month ago

apchytr commented 1 month ago

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

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

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 89.21%. Comparing base (4ac64c1) to head (773530e).

Files Patch % Lines
mrmustard/training/parameter_update.py 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #465 +/- ## ======================================== Coverage 89.21% 89.21% ======================================== Files 102 102 Lines 7194 7198 +4 ======================================== + Hits 6418 6422 +4 Misses 776 776 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/465?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/465?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/465?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/465?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/465?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/465?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/465?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/465?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/465?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.36% <100.00%> (ø)` | | | [...mustard/lab\_dev/circuit\_components\_utils/b\_to\_q.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/465?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/465?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 [32 more](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/465?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/465?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/465?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [4ac64c1...773530e](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/465?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).