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

skip training on numpy, improve drawing #421

Closed timmysilv closed 5 months ago

timmysilv commented 5 months ago

Context: The drawing tool is not very useful today, so I touched it up a bit by adding plotly support.

Description of the Change:

  1. Skip all test_training tests when using numpy because they do nothing
  2. Add the plotly and plotly-grouped modes to the test visualizer because it's much better
  3. filter out test_about and any tests that always return 0.0 (in other words, that always finish in 50ms or less) because we can't get anything useful from that

Benefits:

Possible Drawbacks: N/A

How to use it (from a notebook) ``` # authenticate with AWS first! !aws s3 sync s3:/// /some/path/you/choose/ %run .github/workflows/scripts/visualize_timings.py /some/path/you/choose/numpy_tests/develop/ %run .github/workflows/scripts/visualize_timings.py /some/path/you/choose/tf_tests/develop/ --mode plotly-grouped --ncols 2 --short-name ```
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.77%. Comparing base (576bcf3) to head (e6ff10c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #421 +/- ## ======================================== Coverage 87.77% 87.77% ======================================== Files 81 81 Lines 6232 6232 ======================================== Hits 5470 5470 Misses 762 762 ``` | [Files](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/421?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\_dev/states/base.py](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/421?src=pr&el=tree&filepath=mrmustard%2Flab_dev%2Fstates%2Fbase.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI#diff-bXJtdXN0YXJkL2xhYl9kZXYvc3RhdGVzL2Jhc2UucHk=) | `96.91% <ø> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/421?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/421?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [576bcf3...e6ff10c](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/421?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).