{"id":13574686,"url":"https://github.com/radioactivedecay/radioactivedecay","last_synced_at":"2025-10-21T20:24:21.660Z","repository":{"id":40323054,"uuid":"268682586","full_name":"radioactivedecay/radioactivedecay","owner":"radioactivedecay","description":"A Python package for radioactive decay modelling that supports 1252 radionuclides, decay chains, branching, and metastable states.","archived":false,"fork":false,"pushed_at":"2025-02-10T04:51:02.000Z","size":25996,"stargazers_count":91,"open_issues_count":5,"forks_count":25,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-02-10T05:28:02.190Z","etag":null,"topics":["decay","decay-chains","medical-physics","nuclear-physics","pypi-package","python","radioactive-decay-calculations","radioactivity","radiochemistry","radioisotopes","radionuclides"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/radioactivedecay/","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/radioactivedecay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-06-02T02:31:32.000Z","updated_at":"2025-02-10T04:51:06.000Z","dependencies_parsed_at":"2024-04-03T20:01:01.438Z","dependency_job_id":"2f170582-3a78-4f6a-b40f-4b5f60956fd6","html_url":"https://github.com/radioactivedecay/radioactivedecay","commit_stats":{"total_commits":292,"total_committers":5,"mean_commits":58.4,"dds":"0.17808219178082196","last_synced_commit":"20971083592617389f11add650fe1c4c24d192dc"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactivedecay%2Fradioactivedecay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactivedecay%2Fradioactivedecay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactivedecay%2Fradioactivedecay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactivedecay%2Fradioactivedecay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radioactivedecay","download_url":"https://codeload.github.com/radioactivedecay/radioactivedecay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247229545,"owners_count":20905073,"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":["decay","decay-chains","medical-physics","nuclear-physics","pypi-package","python","radioactive-decay-calculations","radioactivity","radiochemistry","radioisotopes","radionuclides"],"created_at":"2024-08-01T15:00:53.764Z","updated_at":"2025-10-21T20:24:21.573Z","avatar_url":"https://github.com/radioactivedecay.png","language":"Python","funding_links":[],"categories":["Depletion / Transmutation / Decay"],"sub_categories":["Related Tools"],"readme":"﻿\u003cimg src=\"https://raw.githubusercontent.com/radioactivedecay/radioactivedecay/main/docs/source/images/radioactivedecay.png\" alt=\"radioactivedecay logo\" width=\"500\"/\u003e\n\n***\n\n[![PyPI](https://img.shields.io/pypi/v/radioactivedecay)](https://pypi.org/project/radioactivedecay/)\n[![Conda](https://anaconda.org/conda-forge/radioactivedecay/badges/version.svg)](https://anaconda.org/conda-forge/radioactivedecay)\n[![Python Version](https://img.shields.io/pypi/pyversions/radioactivedecay)](https://pypi.org/project/radioactivedecay/)\n[![Latest Documentation](https://img.shields.io/badge/docs-latest-brightgreen)](https://radioactivedecay.github.io/)\n[![Tests](https://github.com/radioactivedecay/radioactivedecay/actions/workflows/1_tests.yml/badge.svg)](https://github.com/radioactivedecay/radioactivedecay/actions/workflows/1_tests.yml)\n[![Tests Coverage](https://codecov.io/gh/radioactivedecay/radioactivedecay/branch/master/graph/badge.svg?token=RX5HSELRYH)](https://codecov.io/gh/radioactivedecay/radioactivedecay)\n[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/radioactivedecay/radioactivedecay/actions/workflows/3_code_formatting.yml)\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.03318/status.svg)](https://doi.org/10.21105/joss.03318)\n[![Downloads](https://static.pepy.tech/badge/radioactivedecay)](https://pepy.tech/project/radioactivedecay)\n\n``radioactivedecay`` is a Python package for radioactive decay calculations.\nIt supports decay chains of radionuclides, metastable states and branching\ndecays. By default it uses the decay data from ICRP Publication 107, which\ncontains 1252 radionuclides of 97 elements, and atomic mass data from the\nAtomic Mass Data Center.\n\nThe code solves the radioactive decay differential equations analytically using\nNumPy and SciPy linear algebra routines. There is also a high numerical\nprecision calculation mode employing SymPy routines. This gives more accurate\nresults for decay chains containing radionuclides with orders of magnitude\ndifferences between the half-lives.\n\nThis is free-to-use open source software. It was created for engineers,\ntechnicians and researchers who work with radioactivity, and for\neducational use.\n\n- **Full Documentation**: \n[https://radioactivedecay.github.io/](https://radioactivedecay.github.io/)\n\n\n## Installation\n\n``radioactivedecay`` requires Python 3.9+. Install ``radioactivedecay`` from\nthe [Python Package Index](https://pypi.org/project/radioactivedecay/) using\n``pip``:\n\n```console\n$ pip install radioactivedecay\n```\n\nor from [conda-forge](https://anaconda.org/conda-forge/radioactivedecay):\n\n```console\n$ conda install -c conda-forge radioactivedecay\n```\n\nEither command will attempt to install the dependencies (Matplotlib, NetworkX,\nNumPy, Pandas, SciPy, Setuptools \u0026 SymPy) if they are not already present in\nthe environment.\n\n\n## Usage\n\n### Decay calculations\n\nCreate an ``Inventory`` of radionuclides and decay it as follows:\n\n```pycon\n\u003e\u003e\u003e import radioactivedecay as rd\n\u003e\u003e\u003e Mo99_t0 = rd.Inventory({'Mo-99': 2.0}, 'Bq')\n\u003e\u003e\u003e Mo99_t1 = Mo99_t0.decay(20.0, 'h')\n\u003e\u003e\u003e Mo99_t1.activities('Bq')\n{'Mo-99': 1.6207863893776937, 'Ru-99': 0.0,\n 'Tc-99': 9.05304236308454e-09, 'Tc-99m': 1.3719829376710406}\n```\n\nAn ``Inventory`` of 2.0 Bq of Mo-99 was decayed for 20 hours, producing the\nradioactive progeny Tc-99m and Tc-99, and the stable nuclide Ru-99.\n\nWe supplied ``'h'`` as an argument to ``decay()`` to specify the decay time\nperiod had units of hours. Supported time units include ``'μs'``, ``'ms'``,\n``'s'``, ``'m'``, ``'h'``, ``'d'``, ``'y'`` etc. Note seconds (``'s'``) is the\ndefault if no unit is supplied to ``decay()``.\n\nUse `cumulative_decays()` to calculate the total number of atoms of each\nradionuclide that decay over the decay time period:\n\n```pycon\n\u003e\u003e\u003e Mo99_t0.cumulative_decays(20.0, 'h')\n{'Mo-99': 129870.3165339939, 'Tc-99m': 71074.31925850797,\n'Tc-99': 0.0002724635511147602}\n```\n\nRadionuclides can be specified in four equivalent ways in ``radioactivedecay``:\nthree variations of nuclide strings or by\n[canonical ids](https://pyne.io/usersguide/nucname.html). For example, the\nfollowing are equivalent ways of specifying \u003csup\u003e222\u003c/sup\u003eRn and\n\u003csup\u003e192n\u003c/sup\u003eIr:\n\n* ``'Rn-222'``, ``'Rn222'``, ``'222Rn'``, ``862220000``,\n* ``'Ir-192n'``, ``'Ir192n'``, ``'192nIr'``, ``771920002``.\n\nInventories can be created by supplying activity (``'Bq'``, ``'Ci'``,\n``'dpm'``...), mass (``'g'``, ``'kg'``...), mole (``'mol'``, ``'kmol'``...)\nunits, or numbers of nuclei (``'num'``) to the ``Inventory()`` constructor. Use\nthe methods ``activities()``, ``masses()``, ``moles()``, ``numbers()``,\n``activity_fractions()``, ``mass_fractions()`` and ``mole_fractions()`` to\nobtain the contents of the inventory in different formats:\n\n```pycon\n\u003e\u003e\u003e H3_t0 = rd.Inventory({'H-3': 3.0}, 'g')\n\u003e\u003e\u003e H3_t1 = H3_t0.decay(12.32, 'y')\n\u003e\u003e\u003e H3_t1.masses('g')\n{'H-3': 1.5, 'He-3': 1.4999900734297729}\n\u003e\u003e\u003e H3_t1.mass_fractions()\n{'H-3': 0.5000016544338455, 'He-3': 0.4999983455661545}\n\n\u003e\u003e\u003e C14_t0 = rd.Inventory({'C-14': 3.2E24}, 'num')\n\u003e\u003e\u003e C14_t1 = C14_t0.decay(3000, 'y')\n\u003e\u003e\u003e C14_t1.moles('mol')\n{'C-14': 3.6894551567795797, 'N-14': 1.6242698581767292}\n\u003e\u003e\u003e C14_t1.mole_fractions()\n{'C-14': 0.6943255713073281, 'N-14': 0.3056744286926719}\n```\n\n\n### Plotting decay graphs\n\nUse the ``plot()`` method to graph of the decay of an inventory over time:\n\n```pycon\n\u003e\u003e\u003e Mo99_t0.plot(20, 'd', yunits='Bq')\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/radioactivedecay/radioactivedecay/main/docs/source/images/Mo-99_decay.png\" alt=\"Mo-99 decay graph\" width=\"450\"/\u003e\n\nThe graph shows the decay of Mo-99 over 20 days, leading to the ingrowth of\nTc-99m and a trace quantity of Tc-99. The activity of Ru-99 is strictly zero as\nit is the stable nuclide at the end of the decay chain. Graphs are drawn using\nMatplotlib.\n\n\n### Fetching decay data\n\nThe ``Nuclide`` class can be used to fetch decay information for\nindividual radionuclides, e.g. for Rn-222:\n\n```pycon\n\u003e\u003e\u003e nuc = rd.Nuclide('Rn-222')\n\u003e\u003e\u003e nuc.half_life('s')\n330350.4\n\u003e\u003e\u003e nuc.half_life('readable')\n'3.8235 d'\n\u003e\u003e\u003e nuc.progeny()\n['Po-218']\n\u003e\u003e\u003e nuc.branching_fractions()\n[1.0]\n\u003e\u003e\u003e nuc.decay_modes()\n['α']\n\u003e\u003e\u003e nuc.Z  # proton number\n86\n\u003e\u003e\u003e nuc.A  # nucleon number\n222\n\u003e\u003e\u003e nuc.atomic_mass  # atomic mass in g/mol\n222.01757601699998\n```\n\nThere are similar inventory methods for fetching decay data:\n\n```pycon\n\u003e\u003e\u003e Mo99_t1.half_lives('readable')\n{'Mo-99': '65.94 h', 'Ru-99': 'stable', 'Tc-99': '0.2111 My', 'Tc-99m': '6.015 h'}\n\u003e\u003e\u003e Mo99_t1.progeny()\n{'Mo-99': ['Tc-99m', 'Tc-99'], 'Ru-99': [], 'Tc-99': ['Ru-99'], 'Tc-99m': ['Tc-99', 'Ru-99']}\n\u003e\u003e\u003e Mo99_t1.branching_fractions()\n{'Mo-99': [0.8773, 0.1227], 'Ru-99': [], 'Tc-99': [1.0], 'Tc-99m': [0.99996, 3.7e-05]}\n\u003e\u003e\u003e Mo99_t1.decay_modes()\n{'Mo-99': ['β-', 'β-'], 'Ru-99': [], 'Tc-99': ['β-'], 'Tc-99m': ['IT', 'β-']}\n```\n\n\n### Decay chain diagrams\n\nThe ``Nuclide`` class includes a `plot()` method for drawing decay chain\ndiagrams:\n\n```pycon\n\u003e\u003e\u003e nuc = rd.Nuclide('Mo-99')\n\u003e\u003e\u003e nuc.plot()\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/radioactivedecay/radioactivedecay/main/docs/source/images/Mo-99_chain.png\" alt=\"Mo-99 decay chain\" width=\"300\"/\u003e\n\nThese diagrams are drawn using NetworkX and Matplotlib.\n\n\n### High numerical precision decay calculations\n\n``radioactivedecay`` includes an ``InventoryHP`` class for high numerical\nprecision calculations. This class can give more reliable decay calculation\nresults for chains containing long- and short-lived radionuclides:\n\n```pycon\n\u003e\u003e\u003e U238_t0 = rd.InventoryHP({'U-238': 1.0})\n\u003e\u003e\u003e U238_t1 = U238_t0.decay(10.0, 'd')\n\u003e\u003e\u003e U238_t1.activities()\n{'At-218': 1.4511675857141352e-25,\n 'Bi-210': 1.8093327888942224e-26,\n 'Bi-214': 7.09819414496093e-22,\n 'Hg-206': 1.9873081129046843e-33,\n 'Pa-234': 0.00038581180879502017,\n 'Pa-234m': 0.24992285949158477,\n 'Pb-206': 0.0,\n 'Pb-210': 1.0508864357335218e-25,\n 'Pb-214': 7.163682655782086e-22,\n 'Po-210': 1.171277829871092e-28,\n 'Po-214': 7.096704966148592e-22,\n 'Po-218': 7.255923469955255e-22,\n 'Ra-226': 2.6127168262000313e-21,\n 'Rn-218': 1.4511671865210924e-28,\n 'Rn-222': 7.266530698712501e-22,\n 'Th-230': 8.690585458641225e-16,\n 'Th-234': 0.2499481473619856,\n 'Tl-206': 2.579902288672889e-32,\n 'Tl-210': 1.4897029111914831e-25,\n 'U-234': 1.0119788393651999e-08,\n 'U-238': 0.9999999999957525}\n```\n\n\n## How radioactivedecay works\n\n``radioactivedecay`` calculates an analytical solution to the radioactive decay\ndifferential equations using linear algebra operations. It implements the\nmethod described in this paper:\n[M Amaku, PR Pascholati \u0026 VR Vanin, Comp. Phys. Comm. 181, 21-23\n(2010)](https://doi.org/10.1016/j.cpc.2009.08.011). See the\n[theory docpage](https://radioactivedecay.github.io/theory.html) for more\ndetails.\n\nIt uses NumPy and SciPy routines for standard decay calculations\n(double-precision floating-point operations), and SymPy for arbitrary numerical\nprecision calculations.\n\nBy default ``radioactivedecay`` uses decay data from\n[ICRP Publication 107\n(2008)](https://journals.sagepub.com/doi/pdf/10.1177/ANIB_38_3) and atomic mass\ndata from the [Atomic Mass Data Center](https://www-nds.iaea.org/amdc/)\n(AMDC - AME2020 and Nubase2020 evaluations).\n\nThe [datasets repo](https://github.com/radioactivedecay/datasets) contains\nJupyter Notebooks for creating decay datasets that can be used by\n``radioactivedecay``, e.g. [ICRP\n107](https://github.com/radioactivedecay/datasets/blob/main/icrp107_ame2020_nubase2020/icrp107_dataset.ipynb).\n\nThe [comparisons repo](https://github.com/radioactivedecay/comparisons)\ncontains some checks of ``radioactivedecay`` against\n[PyNE](https://github.com/radioactivedecay/comparisons/blob/main/pyne/rd_pyne_truncated_compare.ipynb)\nand [Radiological\nToolbox](https://github.com/radioactivedecay/comparisons/blob/main/radiological_toolbox/radiological_toolbox_compare.ipynb).\n\n\n## Tests\n\nFrom the base directory run:\n\n```console\n$ python -m unittest discover\n```\n\n\n## License\n\n``radioactivedecay`` is open source software released under the MIT License.\nSee [LICENSE](https://github.com/radioactivedecay/radioactivedecay/blob/main/LICENSE)\nfile for details.\n\nThe default decay data used by ``radioactivedecay`` (ICRP-107) is copyright\n2008 A. Endo and K.F. Eckerman and distributed under a separate\n[license](https://github.com/radioactivedecay/radioactivedecay/blob/main/LICENSE.ICRP-07).\nThe default atomic mass data is from AMDC\n([license](https://github.com/radioactivedecay/radioactivedecay/blob/main/LICENSE.AMDC)).\n\n\n## Citation\n\nIf you find this package useful for your research, please consider citing the\npaper on ``radioactivedecay`` published in the\n[Journal of Open Source Software](https://doi.org/10.21105/joss.03318):\n\n\u003e Alex Malins \u0026 Thom Lemoine, *radioactivedecay: A Python package for radioactive decay\ncalculations*. Journal of Open Source Software, **7** (71), 3318 (2022). DOI:\n[10.21105/joss.03318](https://doi.org/10.21105/joss.03318).\n\n\n## Contributing\n\nContributors are welcome to fix bugs, add new features or make feature\nrequests. Please open an Issue, Pull Request or new Discussions thread at\n[GitHub repository](https://github.com/radioactivedecay/radioactivedecay).\n\nPlease read the\n[contribution guidelines](https://github.com/radioactivedecay/radioactivedecay/blob/main/CONTRIBUTING.md).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradioactivedecay%2Fradioactivedecay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradioactivedecay%2Fradioactivedecay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradioactivedecay%2Fradioactivedecay/lists"}