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 U.export_to("path.png)" syntax #358

Merged
merged 8 commits into from
Aug 19, 2024

Conversation

ohuettenhofer
Copy link
Contributor

@ohuettenhofer ohuettenhofer commented Aug 18, 2024

The current code does not seem to allow writing U.export_to("path.png") for me, even though it claims to, so I might be missing something.
But I believe the reason for this is that named arguments are processed after unnamed arguments, so even when adding a named argument for circuit, the filename still gets interpreted as a circuit argument.

A simple solution is to explicitly pass self as the first unnamed argument. Since this is a convenience function on the circuit, I can't think of a case where you'd want to pass something other than self.

@ohuettenhofer ohuettenhofer changed the base branch from master to devel August 18, 2024 18:27
@ohuettenhofer ohuettenhofer changed the base branch from devel to master August 18, 2024 18:27
@kottmanj
Copy link
Collaborator

This has annoyed quite some people for so long -- thanks!

@kottmanj kottmanj changed the base branch from master to devel August 19, 2024 08:22
@kottmanj kottmanj merged commit 7ad50e2 into tequilahub:devel Aug 19, 2024
11 checks passed
@ohuettenhofer ohuettenhofer deleted the export_to branch August 19, 2024 20:00
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.

2 participants