{"id":14985690,"url":"https://github.com/colltoaction/nx_yaml","last_synced_at":"2025-04-11T22:04:33.842Z","repository":{"id":183511745,"uuid":"670210502","full_name":"colltoaction/nx_yaml","owner":"colltoaction","description":"A higher-order syntax","archived":false,"fork":false,"pushed_at":"2025-02-16T22:50:43.000Z","size":1662,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T22:03:12.660Z","etag":null,"topics":["category-theory","geometric-deep-learning","higher-order","hypergraph","intermediate-representation","language","network-analysis","networkx","programming-language","yaml"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colltoaction.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-24T14:32:09.000Z","updated_at":"2025-02-16T22:50:46.000Z","dependencies_parsed_at":"2023-07-24T18:56:21.182Z","dependency_job_id":"45a22b3b-d624-4493-82e9-324d3eb9ad50","html_url":"https://github.com/colltoaction/nx_yaml","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":0.28,"last_synced_commit":"812c1c54ff1eb92647bbdd0739437816cf7c5a11"},"previous_names":["colltoaction/nx_yaml","yaml-programming/nx_yaml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colltoaction%2Fnx_yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colltoaction%2Fnx_yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colltoaction%2Fnx_yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colltoaction%2Fnx_yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colltoaction","download_url":"https://codeload.github.com/colltoaction/nx_yaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487717,"owners_count":21112191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["category-theory","geometric-deep-learning","higher-order","hypergraph","intermediate-representation","language","network-analysis","networkx","programming-language","yaml"],"created_at":"2024-09-24T14:11:29.602Z","updated_at":"2025-04-11T22:04:33.814Z","avatar_url":"https://github.com/colltoaction.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nx_yaml\n`nx_yaml` is a general purpose Hypergraph Intermediate Representation for [YAML](https://yaml.org/spec/1.2.2) using [NetworkX](https://github.com/networkx/networkx). It provides native semantics for higher-order applications such as Hypergraph Analysis, Quantum Computing, Geometric Deep Learning and Monoidal Computing.\n\nThere are two notebook tutorials: [a basic one](tutorial.ipynb) and an advanced one using [XGI](xgi.ipynb) for higher-order interpretation.\n\n## Design\nGraph Theory is well established in compiler infrastructure, popularized by the use of Abstract Syntax Trees, and recently projects such as [MLIR](https://mlir.llvm.org/docs/Rationale/RationaleGenericDAGRewriter/) have further explored Direct Acyclic Graphs. This project formalizes a [Hypergraph](https://en.wikipedia.org/wiki/Hypergraph) IR with native semantics for higher-order applications such as:\n* Hypergraph Analysis: https://github.com/pnnl/HyperNetX\n* Quantum Computing: https://github.com/zxcalc/pyzx\n* Geometric Deep Learning: https://github.com/pyg-team/pytorch_geometric\n* Monoidal Computing: https://github.com/discopy/discopy\n\nYAML has the advantage of being a widely known syntax that is implemented in all programming languages. NetworkX enables seamless collaboration between graph libraries. We can implement all sorts of document transformations, leveraging a large ecosystem of software and well-known algorithms for complex networks.\n\n## Implementation\nThis project implements the PyYAML `yaml.compose` and `yaml.serialize` APIs using the NetworkX graph library.\n`compose` takes text input and converts it to a graph, while `serialize` does the inverse operation.\nUnderstanding this data structure is key to create portable and correct tooling for YAML, moving freely between text-based and code representations.\n\nCheck out the [notebook tutorial](tutorial.ipynb).\nWe use `NxSafeLoader` and `NxSafeDumper` with the PyYAML `yaml.compose` and `yaml.serialize` APIs.\n\n### Milestone 1\n\n1. Copy and paste from PyYAML\n1. Replace uses of `nodes` with NetworkX\n1. Publish a drop-in pip replacement\n\n### Milestone 2\n\n1. Compare performance\n1. Compare alignment with spec\n1. Share findings\n\n## Development environment\n\nThis is work in progress.\n`pypi` is updated on demand.\n\nThe development environment is self-contained using the `pipenv` tool.\n\n### Testing\n\n* Just `pytest`\n* Store graphs in `resources/tests`\n\n\n[Representation Graph]: https://yaml.org/spec/1.2.2/#321-representation-graph\n[pyyaml.nodes]: https://github.com/yaml/pyyaml/blob/main/lib/yaml/nodes.py\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolltoaction%2Fnx_yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolltoaction%2Fnx_yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolltoaction%2Fnx_yaml/lists"}