Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Add optional keyword arguments to SuperCircuit (#176)
Browse files Browse the repository at this point in the history
In some cases, we need to pass information into the
Circuit/SuperCircuit, and for that, we can use optional keyword
arguments sent through the constructor.

This PR adds this feature, already present in `Circuit`, into
`SuperCircuit`.
  • Loading branch information
sraver authored Nov 8, 2023
1 parent cfdb6dc commit bd68dbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chiquito"
version = "0.1.2023110700"
version = "0.1.2023110800"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Leo Lara <[email protected]>"]
Expand Down
7 changes: 6 additions & 1 deletion src/frontend/python/chiquito/dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ class SuperCircuitMode(Enum):


class SuperCircuit:
def __init__(self: SuperCircuit):
def __init__(
self: SuperCircuit,
**kwargs, # **kwargs is intended for arbitrary names for imports
):
for key, value in kwargs.items():
setattr(self, key, value)
self.ast = ASTSuperCircuit()
self.mode = SuperCircuitMode.SETUP
self.setup()
Expand Down

0 comments on commit bd68dbf

Please sign in to comment.