{"id":20116269,"url":"https://github.com/spirali/haydi","last_synced_at":"2025-05-06T13:33:43.727Z","repository":{"id":137467305,"uuid":"48799199","full_name":"spirali/haydi","owner":"spirali","description":"Python framework for generating discrete structures","archived":false,"fork":false,"pushed_at":"2017-12-04T09:07:08.000Z","size":667,"stargazers_count":7,"open_issues_count":7,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T12:42:59.912Z","etag":null,"topics":["distributed","enumeration","generator","isomorphism","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spirali.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2015-12-30T12:13:28.000Z","updated_at":"2024-04-29T02:59:45.000Z","dependencies_parsed_at":"2023-07-18T22:30:41.220Z","dependency_job_id":null,"html_url":"https://github.com/spirali/haydi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirali%2Fhaydi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirali%2Fhaydi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirali%2Fhaydi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spirali%2Fhaydi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spirali","download_url":"https://codeload.github.com/spirali/haydi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252693843,"owners_count":21789764,"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":["distributed","enumeration","generator","isomorphism","python"],"created_at":"2024-11-13T18:39:48.136Z","updated_at":"2025-05-06T13:33:43.722Z","avatar_url":"https://github.com/spirali.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/spirali/haydi.svg?branch=master)](https://travis-ci.org/spirali/haydi)\n\n\n# Haystack Diver\n\nHaydi (Haystack diver) is a **framework for generating discrete structures**. It\nprovides a way to define a structure from basic building blocks (e.g. Cartesian\nproduct, mappings) and then enumerate all elements, all non-isomorphic elements,\nor generate random elements.\n\n* Pure Python implementation (Python 2.7+, PyPy supported)\n* MIT license\n* Sequential or distributed computation (via dask/distributed\n  (https://github.com/dask/distributed)\n\n## Documentation\n\nFull documentation is available at: https://haydi.readthedocs.io/en/latest/\n\n## Example of usage\n\n* Let us define **directed graphs on two vertices** (represented as a set of\n  edges):\n\n```python\n    \u003e\u003e\u003e import haydi as hd\n    \u003e\u003e\u003e nodes = hd.USet(2, \"n\")  # A two-element set with (unlabeled) elements {n0, n1}\n    \u003e\u003e\u003e graphs = hd.Subsets(nodes * nodes)  # Subsets of a cartesian product\n```\n\n* Now we can **iterate all elements**:\n\n```python\n    \u003e\u003e\u003e list(graphs.iterate())\n    [{}, {(n0, n0)}, {(n0, n0), (n0, n1)}, {(n0, n0), (n0, n1), (n1, n0)}, {(n0,\n    # ... 3 lines removed ...\n    n1)}, {(n1, n0)}, {(n1, n0), (n1, n1)}, {(n1, n1)}]\n```\n\n* or **iterate all non-isomorphic ones**:\n\n```python\n    \u003e\u003e\u003e list(graphs.cnfs())  # cnfs = canonical forms\n    [{}, {(n0, n0)}, {(n0, n0), (n1, n1)}, {(n0, n0), (n0, n1)}, {(n0, n0), (n0,\n    n1), (n1, n1)}, {(n0, n0), (n0, n1), (n1, n0)}, {(n0, n0), (n0, n1), (n1, n0),\n    (n1, n1)}, {(n0, n0), (n1, n0)}, {(n0, n1)}, {(n0, n1), (n1, n0)}]\n```\n\n* or **generate random instances**:\n\n```python\n    \u003e\u003e\u003e list(graphs.generate(3))\n    [{(n1, n0)}, {(n1, n1), (n0, n0)}, {(n0, n1), (n1, n0)}]\n```\n\n\n* Haydi supports standard operations like **map, filter and reduce**:\n\n```python\n    \u003e\u003e\u003e op = graphs.map(lambda g: len(g)).reduce(lambda x, y: x + y)\n    # Just a demonstration pipeline; nothing usefull\n    \u003e\u003e\u003e op.run()\n```\n\n* We can run it transparently as a **distributed application**:\n\n```python\n    \u003e\u003e\u003e from haydi import DistributedContext\n    # We are now assuming that dask/distributed is running at hostname:1234\n    \u003e\u003e\u003e context = DistributedContext(\"hostname\", 1234)\n    \u003e\u003e\u003e op.run(ctx=context)\n```\n\n## Authors\n\n  * Stanislav Böhm \u003cstanislav.bohm at vsb.cz\u003e\n  * Jakub Beránek \u003cberykubik at gmail.com\u003e\n  * Martin Šurkovský \u003cmartin.surkovsky at gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirali%2Fhaydi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspirali%2Fhaydi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspirali%2Fhaydi/lists"}