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

Serialisation schema for extensions. #1360

Closed
Tracked by #1344
ss2165 opened this issue Jul 25, 2024 · 0 comments · Fixed by #1371
Closed
Tracked by #1344

Serialisation schema for extensions. #1360

ss2165 opened this issue Jul 25, 2024 · 0 comments · Fixed by #1371
Assignees
Labels
python Pull requests that update Python code

Comments

@ss2165
Copy link
Member

ss2165 commented Jul 25, 2024

Defined from pydantic models.

Validate prelude and standard extensions against schema.

@ss2165 ss2165 added the python Pull requests that update Python code label Jul 25, 2024
@ss2165 ss2165 self-assigned this Jul 25, 2024
@ss2165 ss2165 changed the title HUGR-py utilities for extension definitions Serialisation schema for extensions. Jul 29, 2024
github-merge-queue bot pushed a commit that referenced this issue Jul 30, 2024
Fear not the diff, mostly schema update.


- Define a Pydantic model and serialised schema for extensions.
- Update the rust `SignatureFunc` serialisation to be compatible with
this.
- Serialized extension "declarations" can state they require binary
compute or validation functions. `SignatureFunc` reports this if they
are missing, and it is up to the caller (typically validation) to decide
how to recover from this.

Closes #1360 
Closes #1361

Addresses parts of #1228 

Best reviewed as individual commits.

BREAKING CHANGE: `TypeDefBound` uses struct-variants for serialization.
`SignatureFunc` now has variants for missing binary functions, and
serializes in to a new format that indicates expected binaries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant