Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix and update demo notebook #376

Merged
merged 3 commits into from
Aug 13, 2024
Merged

fix: Fix and update demo notebook #376

merged 3 commits into from
Aug 13, 2024

Conversation

mark-koch
Copy link
Collaborator

@mark-koch mark-koch commented Aug 12, 2024

Closes #371.

See https://github.com/CQCL/guppylang/blob/fix/demo-notebook/examples/demo.ipynb for the rendered notebook.

Drive-by: Add bool.__xor__ method for the example.

We should check for notebook regressions in CI to avoid breaking the example in the future. See #375

@mark-koch mark-koch requested a review from ss2165 August 12, 2024 16:21
@mark-koch mark-koch requested a review from a team as a code owner August 12, 2024 16:21
Comment on lines +90 to +91
@guppy.hugr_op(builtins, DummyOp("Xor"))
def __xor__(self: bool, other: bool) -> bool: ...
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic extension doesn't define Xor yet. See CQCL/hugr#1418

Base automatically changed from fix/ipython-structs to main August 12, 2024 16:26
@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 47.50000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 91.01%. Comparing base (1dfebef) to head (19942db).
Report is 1 commits behind head on main.

Files Patch % Lines
guppylang/definition/struct.py 44.73% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #376      +/-   ##
==========================================
- Coverage   91.32%   91.01%   -0.32%     
==========================================
  Files          47       47              
  Lines        5294     5322      +28     
==========================================
+ Hits         4835     4844       +9     
- Misses        459      478      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice intro, just two notes:

  1. Specify a version of guppy the notebook works with at the top, at least until we have CI checks.
  2. Qubit in Guppy typo, should be "Qubits"

@mark-koch mark-koch enabled auto-merge August 13, 2024 11:35
@mark-koch mark-koch added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit 23b2a15 Aug 13, 2024
3 checks passed
@mark-koch mark-koch deleted the fix/demo-notebook branch August 13, 2024 11:37
github-merge-queue bot pushed a commit that referenced this pull request Sep 11, 2024
🤖 I have created a release *beep* *boop*
---


## [0.10.0](v0.9.0...v0.10.0)
(2024-09-11)


### ⚠ BREAKING CHANGES

* Bumped the `hugr` dependency to `0.8.0`
* `GuppyModule.load` no longer loads the content of modules but instead
just brings the name of the module into scope. Use
`GuppyModule.load_all` to get the old behaviour.
* Removed `guppylang.hugr_builder.hugr.Hugr`, compiling a module returns
a `hugr.Package` instead.

### Features

* Add `__version__` field to guppylang
([#473](#473))
([b996c62](b996c62))
* Add angle type ([#449](#449))
([12e41e0](12e41e0))
* Add array literals
([#446](#446))
([a255c02](a255c02))
* Add equality test for booleans
([#394](#394))
([dd702ce](dd702ce)),
closes [#363](#363)
* Add pi constant ([#451](#451))
([9d35a78](9d35a78))
* Add qualified imports and make them the default
([#443](#443))
([553ec51](553ec51))
* Allow calling of methods
([#440](#440))
([5a59da3](5a59da3))
* Allow imports of function definitions and aliased imports
([#432](#432))
([e23b666](e23b666))
* Array indexing ([#415](#415))
([2199b48](2199b48)),
closes [#421](#421)
[#422](#422)
[#447](#447)
* Inout arguments ([#311](#311))
([060649b](060649b)),
closes [#315](#315)
[#316](#316)
[#349](#349)
[#344](#344)
[#321](#321)
[#331](#331)
[#350](#350)
[#340](#340)
[#351](#351)
* range() with single-argument
([#452](#452))
([d05f369](d05f369))
* Skip checking of redefined functions
([#457](#457))
([7f9ad32](7f9ad32))
* Support `nat`/`int` ↔ `bool` cast operations
([#459](#459))
([3b778c3](3b778c3))
* Use `hugr-cli` for validation
([#455](#455))
([1d0667b](1d0667b))
* Use cell name instead of file for notebook errors
([#382](#382))
([d542601](d542601))
* Use the hugr builder
([536abf9](536abf9))


### Bug Fixes

* Fix and update demo notebook
([#376](#376))
([23b2a15](23b2a15))
* Fix linearity checking bug
([#441](#441))
([0b8ea21](0b8ea21))
* Fix struct definitions in notebooks
([#374](#374))
([b009465](b009465))


### Documentation

* Update readme, `cargo build` instead of `--extra validation`
([#471](#471))
([c2a4c86](c2a4c86))


### Miscellaneous Chores

* Update hugr to `0.8.0`
([#454](#454))
([b02e0d0](b02e0d0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Fix demo notebook
3 participants