{"id":37076196,"url":"https://github.com/tgwoodcock/convmag","last_synced_at":"2026-01-14T08:57:59.066Z","repository":{"id":62564693,"uuid":"382689320","full_name":"tgwoodcock/convmag","owner":"tgwoodcock","description":"Conversion between units used in magnetism","archived":false,"fork":false,"pushed_at":"2025-04-10T11:42:16.000Z","size":49,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-06T17:58:48.117Z","etag":null,"topics":["conversion","magnetic","magnetism","python","units"],"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/tgwoodcock.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":"2021-07-03T18:52:54.000Z","updated_at":"2025-04-18T12:26:09.000Z","dependencies_parsed_at":"2024-06-17T11:48:05.647Z","dependency_job_id":"7d75dab7-9424-48fb-be2c-6f5bf30c233a","html_url":"https://github.com/tgwoodcock/convmag","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"d1aec42b2735c66601652a679dac732ac944a888"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tgwoodcock/convmag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgwoodcock%2Fconvmag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgwoodcock%2Fconvmag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgwoodcock%2Fconvmag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgwoodcock%2Fconvmag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tgwoodcock","download_url":"https://codeload.github.com/tgwoodcock/convmag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgwoodcock%2Fconvmag/sbom","scorecard":{"id":876244,"data":{"date":"2025-08-11","repo":{"name":"github.com/tgwoodcock/convmag","commit":"5eae2282ff75ee91a8a1b5f3d2fe4b14a671c7a0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":"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"}}]},"last_synced_at":"2025-08-24T06:06:36.979Z","repository_id":62564693,"created_at":"2025-08-24T06:06:36.979Z","updated_at":"2025-08-24T06:06:36.979Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["conversion","magnetic","magnetism","python","units"],"created_at":"2026-01-14T08:57:58.451Z","updated_at":"2026-01-14T08:57:59.059Z","avatar_url":"https://github.com/tgwoodcock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI Version](https://img.shields.io/pypi/v/convmag.svg)](https://pypi.python.org/pypi/convmag/)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/convmag.svg)](https://pypi.python.org/pypi/convmag/)\n\n# convmag\nConversion between various units used in magnetism\n\nThe conversions between *base units* available are:\n\n             T  \u003c-\u003e  G         :    1e4\n             T  \u003c-\u003e  Oe        :    1e4\n           A/m  \u003c-\u003e  T         :    MU_0\n           A/m  \u003c-\u003e  G         :    1e4 * MU_0\n             G  \u003c-\u003e  Oe        :    1\n           A/m  \u003c-\u003e  Oe        :    1e4 * MU_0\n      emu/cm^3  \u003c-\u003e  T         :    1e3 * MU_0\n    erg/Oecm^3  \u003c-\u003e  A/m       :    1e3\n         emu/g  \u003c-\u003e  Am^2/kg   :    1\n         J/m^3  \u003c-\u003e  GOe       :    1e8 * MU_0\n         J/m^3  \u003c-\u003e  erg/cm^3  :    1e1\n      erg/cm^3  \u003c-\u003e  GOe       :    1e7 * MU_0\n          Am^2  \u003c-\u003e  emu       :    1e3\n          Am^2  \u003c-\u003e  erg/G     :    1e3\n          Am^2  \u003c-\u003e  erg/Oe    :    1e3\n           emu  \u003c-\u003e  erg/G     :    1\n           muB  \u003c-\u003e  Am^2      :    MU_B\n           muB  \u003c-\u003e  emu       :    1e3 * MU_B\n        muB/fu  \u003c-\u003e  T         :    requires user input of lattice parameters\n\n(the factors given above are for the forward conversion)\n\n- permeability of free space, MU_0 = 4 * 3.14159 * 1e-7 H/m  (== Vs/Am)\n\n- Bohr magneton, MU_B =  9.274015e-24 Am^2\n      (muB is the unit string for conversions with Bohr magnetons)\n\nThe *prefactors* available for any base unit are: M (1e6), k (1e3), m (1e-3), µ (1e-6)\n\nYou can combine *prefactors* and *base units* to give e.g. MA/m or kJ/m^3\n\n\u003cbr\u003e\n\n### A word about emu\n\nemu is not a unit but indicates the system of cgs units being used (emu == electromagnetic units)\n\nThe magnetisation data from magnetometers is very often given in emu, and in these cases emu implies the units erg/G.\nThis is why the equivalence emu = erg/G is given above. Many authors still quote emu/g or emu/cm^3 and therefore,\nthese conversions are listed in the table above. convmag always assumes that emu has the units erg/G.\n\n**In some cases emu may take other units, so it's always worth checking this!**\n\n\u003cbr\u003e\n\n## Installation:\n\n### Pip\nYou can install the current release with pip:\n```bash\n    pip install convmag\n```\n\nPure python, no other dependencies.\n\nRequires Python \u003e= 3.6 because f-strings are used\n\n\u003cbr\u003e\n\n## Usage options:\n\n1) command line: a console script is provided and should be located in the Scripts directory of\n   your Python distribution after installation. If you have this directory in\n   your Path (environment variable on Windows) you can start the program by\n   typing \"convmag\" in the terminal. In this case only single values can be\n   converted (one at a time).\n\n2) the package can be imported into python and then you can pass numpy arrays\n   into the function convert_unit(), making sure to keep the default verbose=False.\n   That way many values can be converted at once. The converted\n   values are returned as a numpy array for further processing.\n\n```python\n    \u003e\u003e\u003e import numpy as np\n    \u003e\u003e\u003e import convmag as cm\n    \u003e\u003e\u003e vals_in_T = np.arange(0, 100, 20)\n    \u003e\u003e\u003e vals_in_T\n    array([ 0, 20, 40, 60, 80])\n    \u003e\u003e\u003e vals_in_Oe = cm.convert_unit(vals_in_T, \"T\", \"Oe\", verbose=False)\n    \u003e\u003e\u003e vals_in_Oe\n    array([     0., 200000., 400000., 600000., 800000.])\n```\n\n\u003cbr\u003e\n\n## Converting between Bohr Magnetons per formula unit and Tesla\n\nThis conversion requires additional user input of:\n\n- the lattice parameters *a*, *b*, *c* and *gamma*, and\n\n- the number of formula units per unit cell.\n\nOnly orthogonal (cubic, tetragonal and orthorhombic) and hexagonal unit cells can be handled\nand therefore *gamma* = 90° or 120°.\n\nAs an example of the number of formula units per unit cell, Nd2Fe14B is the formula unit, which\nhas 17 atoms, and the unit cell contains 68 atoms, so in this case there are 4 formula units per unit cell.\n\nAfter calling \"convmag\" in the command line, the conversion from muB to T looks like this:\n\n```\n    Input: 2.3 muB/fu T\n\n    ***INFO: muB per formula unit \u003c-\u003e T***\n\n    Please enter lattice parameters: a b c in Angstrom\n    a b c: 3.0 3.0 4.0\n\n    Limited to orthogonal or hexagonal unit cells:\n    Please enter gamma in deg. (90 or 120): 90\n    Please enter the number of formula units per unit cell:\n    f.u./unit cell: 2\n\n    2.3 muB per f.u. = 1.48913 T (2 f.u./unit cell, cell volume = 3.600e-29 m^3)\n```\n\n\u003cbr\u003e\n\n## Code Archive and Citation\n\nThis code is archived on Zenodo and can be cited using the following doi and\nassociated metadata: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15182513.svg)](https://doi.org/10.5281/zenodo.15182513)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgwoodcock%2Fconvmag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftgwoodcock%2Fconvmag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgwoodcock%2Fconvmag/lists"}