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

feat!: Add implicit importing of modules #461

Merged
merged 4 commits into from
Sep 11, 2024
Merged

Conversation

mark-koch
Copy link
Collaborator

@mark-koch mark-koch commented Sep 5, 2024

Closes #133 and closes #462.

  • When using implicit modules, automatically import definitions by inspecting the __dict__ of the containing Python module.
  • Implicit modules are no longer discarded once they are compiled for the first time.
  • Updated examples to use implicit modules

BREAKING CHANGE: guppy.take_module renamed to guppy.get_module and no longer removes the module from the state.

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.00%. Comparing base (ce0f746) to head (f943fe8).

Files with missing lines Patch % Lines
guppylang/decorator.py 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #461      +/-   ##
==========================================
+ Coverage   91.91%   92.00%   +0.08%     
==========================================
  Files          58       58              
  Lines        5891     5900       +9     
==========================================
+ Hits         5415     5428      +13     
+ Misses        476      472       -4     

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

Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

Nice!

guppylang/decorator.py Show resolved Hide resolved
@mark-koch mark-koch enabled auto-merge September 11, 2024 09:33
@mark-koch mark-koch added this pull request to the merge queue Sep 11, 2024
Merged via the queue into main with commit 1b73032 Sep 11, 2024
3 checks passed
@mark-koch mark-koch deleted the feat/implicit-imports branch September 11, 2024 09:38
github-merge-queue bot pushed a commit that referenced this pull request Sep 11, 2024
🤖 I have created a release *beep* *boop*
---


## [0.11.0](v0.10.0...v0.11.0)
(2024-09-11)


### ⚠ BREAKING CHANGES

* `guppy.take_module` renamed to `guppy.get_module` and no longer
removes the module from the state.
* Quantum operations `rx`, `rz`, `phased_x`, and `zz_max` use the
`angle` type instead of floats.

### Features

* Add implicit importing of modules
([#461](#461))
([1b73032](1b73032))
* Use angle type in quantum operations
([#467](#467))
([ce0f746](ce0f746))


### Bug Fixes

* hseries ops use floats instead of angles
([#483](#483))
([7ed3853](7ed3853)),
closes [#477](#477)
* Keep track of definitions that are implicitly imported
([#481](#481))
([a89f225](a89f225)),
closes [#480](#480)

---
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.

Allow importing of implicit modules Implicit module imports
3 participants