{"id":22927025,"url":"https://github.com/inducer/pymetis","last_synced_at":"2025-05-15T14:05:49.652Z","repository":{"id":4048767,"uuid":"2199177","full_name":"inducer/pymetis","owner":"inducer","description":"A Python wrapper around Metis, a graph partitioning package","archived":false,"fork":false,"pushed_at":"2025-05-05T19:12:25.000Z","size":5365,"stargazers_count":180,"open_issues_count":6,"forks_count":33,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-09T09:53:37.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mathema.tician.de/software/pymetis","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inducer.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-08-12T21:01:07.000Z","updated_at":"2025-05-06T13:26:48.000Z","dependencies_parsed_at":"2025-04-12T15:47:09.649Z","dependency_job_id":"76cd267c-059b-4920-b91a-e9a15c0f32c1","html_url":"https://github.com/inducer/pymetis","commit_stats":{"total_commits":161,"total_committers":14,"mean_commits":11.5,"dds":"0.21118012422360244","last_synced_commit":"c328599dd19561378f7fb9fbcb60838d6c30397b"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inducer%2Fpymetis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inducer%2Fpymetis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inducer%2Fpymetis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inducer%2Fpymetis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inducer","download_url":"https://codeload.github.com/inducer/pymetis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"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":[],"created_at":"2024-12-14T09:07:31.448Z","updated_at":"2025-05-15T14:05:44.641Z","avatar_url":"https://github.com/inducer.png","language":"C","readme":"PyMetis: A Python Wrapper for METIS\n===================================\n\n.. image:: https://gitlab.tiker.net/inducer/pymetis/badges/main/pipeline.svg\n    :alt: Gitlab Build Status\n    :target: https://gitlab.tiker.net/inducer/pymetis/commits/main\n.. image:: https://github.com/inducer/pymetis/workflows/CI/badge.svg?branch=main\n    :alt: Github Build Status\n    :target: https://github.com/inducer/pymetis/actions?query=branch%3Amain+workflow%3ACI\n.. image:: https://badge.fury.io/py/PyMetis.png\n    :alt: Python Package Index Release Page\n    :target: https://pypi.org/project/pymetis/\n.. image:: https://zenodo.org/badge/2199177.svg\n    :alt: Zenodo DOI for latest release\n    :target: https://zenodo.org/badge/latestdoi/2199177\n\nPyMetis is a Python wrapper for the `Metis\n\u003chttp://glaros.dtc.umn.edu/gkhome/views/metis\u003e`_ graph partitioning software\nby George Karypis, Vipin Kumar and others. It includes version 5.1.0 of Metis\nand wraps it using the `Pybind11 \u003chttps://pybind11.readthedocs.io/en/stable/\u003e`_\nwrapper generator library. So far, it only wraps the most basic graph\npartitioning functionality (which is enough for my current use), but extending\nit in case you need more should be quite straightforward. Using PyMetis to\npartition your meshes is really easy--essentially all you need to pass into\nPyMetis is an adjacency list for the graph and the number of parts you would\nlike.\n\nLinks\n-----\n\n* `Documentation \u003chttps://documen.tician.de/pymetis\u003e`__ (read how things work)\n* `Conda Forge \u003chttps://anaconda.org/conda-forge/pymetis\u003e`_ (download binary packages for Linux, macOS, Windows)\n* `Python package index \u003chttps://pypi.python.org/pypi/pymetis\u003e`_ (download releases)\n* `C. Gohlke's Windows binaries \u003chttps://www.lfd.uci.edu/~gohlke/pythonlibs/#pymetis\u003e`_ (download Windows binaries)\n* `Github \u003chttps://github.com/inducer/pymetis\u003e`_ (get latest source code, file bugs)\n\nInstallation\n------------\n\nThe following line should do the job::\n\n    pip install pymetis\n\nQuick Start\n-----------\n\nThis graph, adapted from Figure 2 of the Metis\n`manual \u003chttp://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/manual.pdf\u003e`_ to\nuse zero-based indexing,\n\n.. image:: doc/_static/tiny_01.png\n\ncan be defined and partitioned into two graphs with\n\n.. code:: python\n\n    import numpy as np\n    import pymetis\n    adjacency_list = [np.array([4, 2, 1]),\n                      np.array([0, 2, 3]),\n                      np.array([4, 3, 1, 0]),\n                      np.array([1, 2, 5, 6]),\n                      np.array([0, 2, 5]),\n                      np.array([4, 3, 6]),\n                      np.array([5, 3])]\n    n_cuts, membership = pymetis.part_graph(2, adjacency=adjacency_list)\n    # n_cuts = 3\n    # membership = [1, 1, 1, 0, 1, 0, 0]\n\n    nodes_part_0 = np.argwhere(np.array(membership) == 0).ravel() # [3, 5, 6]\n    nodes_part_1 = np.argwhere(np.array(membership) == 1).ravel() # [0, 1, 2, 4]\n\n.. image:: doc/_static/tiny_01_partitioned.png\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finducer%2Fpymetis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finducer%2Fpymetis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finducer%2Fpymetis/lists"}