{"id":50392143,"url":"https://github.com/freegs-plasma/freegs","last_synced_at":"2026-06-16T10:00:44.653Z","repository":{"id":44677479,"uuid":"73807138","full_name":"freegs-plasma/freegs","owner":"freegs-plasma","description":"Free boundary Grad-Shafranov solver","archived":false,"fork":false,"pushed_at":"2025-12-30T22:02:20.000Z","size":2483,"stargazers_count":130,"open_issues_count":21,"forks_count":63,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-03-26T10:33:44.263Z","etag":null,"topics":["equilibrium","plasma-physics","tokamak"],"latest_commit_sha":null,"homepage":"http://freegs.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freegs-plasma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-11-15T11:28:29.000Z","updated_at":"2026-03-19T02:28:27.000Z","dependencies_parsed_at":"2025-12-31T08:05:11.502Z","dependency_job_id":null,"html_url":"https://github.com/freegs-plasma/freegs","commit_stats":{"total_commits":303,"total_committers":18,"mean_commits":"16.833333333333332","dds":0.471947194719472,"last_synced_commit":"aed114855fd3ffe3e7ecf2224acd1fd82e9cbb26"},"previous_names":["bendudson/freegs"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/freegs-plasma/freegs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freegs-plasma%2Ffreegs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freegs-plasma%2Ffreegs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freegs-plasma%2Ffreegs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freegs-plasma%2Ffreegs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freegs-plasma","download_url":"https://codeload.github.com/freegs-plasma/freegs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freegs-plasma%2Ffreegs/sbom","scorecard":{"id":234550,"data":{"date":"2025-08-11","repo":{"name":"github.com/freegs-plasma/freegs","commit":"de6ae95c85e8a8e9f66ab70b2e572132a2868f26"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5,"checks":[{"name":"Maintained","score":3,"reason":"3 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":5,"reason":"Found 4/8 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/benchmark.yml:1","Warn: no topLevel permission defined: .github/workflows/codecov.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/benchmark.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/benchmark.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/benchmark.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/benchmark.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/benchmark.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/benchmark.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/codecov.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codecov.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/python-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/freegs-plasma/freegs/tests.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/benchmark.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/benchmark.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/codecov.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:26","Info:   0 out of   9 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of  10 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:11"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T05:23:31.693Z","repository_id":44677479,"created_at":"2025-08-17T05:23:31.693Z","updated_at":"2025-08-17T05:23:31.693Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34400456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["equilibrium","plasma-physics","tokamak"],"created_at":"2026-05-30T19:00:23.278Z","updated_at":"2026-06-16T10:00:44.646Z","avatar_url":"https://github.com/freegs-plasma.png","language":"Python","funding_links":[],"categories":["🛠️ Tools \u0026 Libraries"],"sub_categories":["Reviews \u0026 Roadmaps"],"readme":"FreeGS: Free boundary Grad-Shafranov solver\n===========================================\n\n[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://img.shields.io/badge/license-GPL-blue.svg)\n[![py3comp](https://img.shields.io/badge/py3-compatible-brightgreen.svg)](https://img.shields.io/badge/py3-compatible-brightgreen.svg)\n[![Build Status](https://github.com/freegs-plasma/freegs/workflows/Tests/badge.svg)](https://github.com/freegs-plasma/freegs/workflows/Tests/badge.svg)\n[![codecov](https://codecov.io/gh/freegs-plasma/freegs/branch/master/graph/badge.svg?token=4dc6aHbu7K)](https://codecov.io/gh/freegs-plasma/freegs)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/freegs-plasma/freegs/tutorial?labpath=tutorial.ipynb)\n\nThis Python module calculates plasma equilibria for tokamak fusion experiments,\nby solving the Grad-Shafranov equation with free boundaries. Given a set of coils,\nplasma profiles and shape, FreeGS finds the currents in the coils which produce\na steady-state solution in force balance.\n\n**Note** This is a work in progress, and probably contains bugs. \nThere is a feature wishlist in issues, suggestions and contributions welcome!\n\nInstalling\n----------\n\nFreeGS is available on PyPI \n\n    $ pip install --user freegs\n\nor clone/download this repository and run setup:\n\n    $ git clone https://github.com/freegs-plasma/freegs.git\n    $ cd freegs\n    $ python setup.py install --user\n\nDocumentation\n-------------\n\nThe manual is in the `docs` subdirectory, and [hosted here on readthedocs](http://freegs.readthedocs.io/en/latest/).\n\nTesting\n-------\n\nUnit tests use [pytest](https://docs.pytest.org/en/latest/) so after installing, run with:\n\n    $ pytest\n\nThe tests are in the `src/` subdirectory.\n\nA convergence test is [described in the manual](https://freegs.readthedocs.io/en/latest/tests.html#convergence-test). To run:\n\n    $ python test-convergence.py\n\nExamples\n--------\n\nThe Jupyter notebooks contain examples wuth additional notes\n\n\n* [tutorial.ipynb](./tutorial.ipynb)\n\nLaunch tutorial in [![MyBinder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/freegs-plasma/freegs/tutorial?labpath=tutorial.ipynb)\n\n* MAST-example.ipynb \n\nThere are also some Python scripts to run short tests\nand examples\n\n    $ python 01-freeboundary.py\n\nThis solves a free boundary problem, specifying the desired location of two X-points.\nWrites the equilibrium to a G-EQDSK file \"lsn.geqdsk\"\n\n    $ python 02-read-geqdsk.py\n\nReads in the file \"lsn.geqdsk\", inferring the coil currents from the plasma boundary\nand profiles in the G-EQDSK file.\n\n    $ python 03-mast.py\n\nCalculates a double-null (CDND) equilibrium for MAST from scratch. Writes solution to\nG-EQDSK file \"mast.geqdsk\"\n\n    $ python 04-read-mast-geqdsk.py\n\nReads the file \"mast.geqdsk\", inferring the coil currents.\n\n    $ python 05-fixed-boundary.py \n\nThis example solves a fixed boundary problem, in which the square edges of the domain\nare fixed. The plasma pressure on axis and plasma current are fixed.\n\n    $ python 06-xpoints.py\n\nThis demonstrates the coil current control code, finding X-points, and marking core region\nThese routines are used inside the free boundary solver\n\nFiles\n-----\n\nThe \"freegs\" module consists of the following files:\n\n* **boundary.py**        - Operators for applying boundary conditions to plasma psi\n* **control.py**         - Routines for controlling coil currents based on constraints\n* **critical.py**        - Finds critical points (O- and X-points)\n* **equilibrium.py**     - Represents the plasma equilibrium state\n* **gradshafranov.py**   - Greens functions and operators for the Grad-Shafranov equation\n* **jtor.py**            - Routines for calculating toroidal current density (profiles)\n* **machine.py**         - Represents the coils and power supply circuits\n* **multigrid.py**       - The multigrid solver for the linear elliptic operator\n* **picard.py**          - Nonlinear solver, iterating the profiles and constraints\n* **plotting.py**        - Plotting routines using matplotlib\n\nLicense\n-------\n\n    Copyright 2016-2022 Ben Dudson, University of York, and other contributors.\n    Email: benjamin.dudson@york.ac.uk\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\nReferences\n----------\n\n* YoungMu Jeon, [Development of a free boundary Tokamak Equlibrium Solver](http://link.springer.com/article/10.3938/jkps.67.843)  [arXiv:1503.03135](https://arxiv.org/abs/1503.03135)\n* S.Jardin \"Computational Methods in Plasma Physics\" CRC Press\n\n\nVersions\n--------\n\n0.7.0  16th August 2022\n  - Fixes and additional features for equilibrium measurements\n  - Limited plasma detection and handling throughout code\n  - Optional adittional constraints on coil currents\n  - Constraints on coil currents when reading geqdsks\n  - Replacement of MultiCoil with FilamentCoil\n  - Addition of PreCalcCoil\n\n0.6.1  11th February 2021\n  - Fixes for HDF5 reading and writing\n  - Fix Numpy deprecations\n  - Catch errors in optimisation measures, making that more robust\n  - Fix core mask in geqdsk file reading\n  - Flake8 fixes\n  - Move to Github actions\n\n0.6.0  29th January 2021\n  - Improve separatrix finding (Pablo Rodriguez-Fernandez)\n  - Update MAST-U machine description (James Harrison)\n  - Updated documentation\n  - Add tests for critical point finding\n  - Black format all library code\n  - Fix wall intersection calculation in optimisation\n  - Fix factor of pi in effectiveElongation (Chris Winnard)\n  - Miscellaneous fixes and tidying (Chris Winnard)\n  - Fix psi_bndry test in critical.core_mask\n  - Fix comments in Greens functions (James Morris)\n\n0.5.0  25th March 2020\n  - More tests, thanks to @ZedThree.\n  - Added more flexible coil types, thanks to Chris Marsden.\n    Includes support for shaped coils, multi-strand coils,\n    and up-down mirrored coils.\n  - Basic support for reading and writing AEQDSK files\n  - Added h5py to requirements, fixes for latest NumPy\n\n0.4.0  10th November 2019\n  - Add optimisation with Differential Evolution\n  - More unit testing, documentation\n\n0.3.0  28th July 2019\n  - Add 4th-order solver for potential\n  - Add convergence test\n\n0.2.0  12th March 2019\n  - Add field line tracer, `freegs.fieldtracer`\n  - Add Equilibrium.Btor toroidal field calculation\n  - Add Equilibrium.plasmaVolume\n  - Fix rlim, zlim saved into GEQDSK files","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreegs-plasma%2Ffreegs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreegs-plasma%2Ffreegs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreegs-plasma%2Ffreegs/lists"}