{"id":29227325,"url":"https://github.com/royerlab/slurmkit","last_synced_at":"2025-07-03T09:10:26.249Z","repository":{"id":175327731,"uuid":"622403778","full_name":"royerlab/slurmkit","owner":"royerlab","description":"Simple SLURM python API","archived":false,"fork":false,"pushed_at":"2024-08-23T17:22:41.000Z","size":45,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-23T19:16:25.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/royerlab.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":"2023-04-02T02:12:04.000Z","updated_at":"2024-08-23T17:22:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"781e8567-7259-4359-8651-314f3d8aa7ed","html_url":"https://github.com/royerlab/slurmkit","commit_stats":null,"previous_names":["royerlab/slurmkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/royerlab/slurmkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royerlab%2Fslurmkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royerlab%2Fslurmkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royerlab%2Fslurmkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royerlab%2Fslurmkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/royerlab","download_url":"https://codeload.github.com/royerlab/slurmkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/royerlab%2Fslurmkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263296638,"owners_count":23444499,"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":"2025-07-03T09:10:25.596Z","updated_at":"2025-07-03T09:10:26.233Z","avatar_url":"https://github.com/royerlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slurmkit: \"Minimal\" Slurm Toolkit\n\nA python SLURM toolkit.\n\n## Installation\n\nIt can be installed using:\n\n```sh\npip install git+https://github.com/royerlab/slurmkit\n```\n\n## Examples\n\n### Minimal example\n\nSimple addition executed with a SLURM job.\n\n```python3\nfrom slurmkit import SlurmParams, slurm_function, submit_function\n\nshared_path = Path(...)  # update this\n\n@slurm_function\ndef add(a: int, b: int) -\u003e None:\n    c = a + b\n    print(f\"{a} + {b} = {c}\")\n\noutput = shared_path / \"output-%j.out\"\nparams = SlurmParams(output=output, mem=\"5M\")\njob = submit_function(add(1, 2), params)\n```\n\n### Dependencies example\n\nExample with job dependencies and using the `zarr` package to share data between different jobs.\n\n```python3\nimport zarr\n\nfrom slurmkit import SlurmParams, slurm_function, submit_function\n\nshared_path = Path(...)  # update this\n\ndef _create_ones(size: int, out_path: Path) -\u003e None:\n    zarr.ones(shape=(size, size), store=zarr.DirectoryStore(out_path))\n\n@slurm_function\ndef _sum_zarr(\n    in_path_1: Path,\n    in_path_2: Path,\n    out_path: Path,\n) -\u003e None:\n    in_arr1 = zarr.open(in_path_1)\n    in_arr2 = zarr.open(in_path_2)\n    out_arr = zarr.empty_like(in_arr1, store=zarr.DirectoryStore(out_path))\n    out_arr[:] = in_arr1[:] + in_arr2[:]\n\nsize = 5\nparams = SlurmParams(output=shared_path / \"slurmkit-test-%j.out\")\n\ncreate_ones = slurm_function(_create_ones)(size=size)\n\npaths = [shared_path / f\"{i}.zarr\" for i in range(2)]\n\njobs = [submit_function(create_ones, params, out_path=p) for p in paths]\n\nout_path = shared_path / \"out.zarr\"\nsubmit_function(_sum_zarr(*paths, out_path=out_path), params, dependencies=jobs)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyerlab%2Fslurmkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyerlab%2Fslurmkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyerlab%2Fslurmkit/lists"}