Package: becquerel
Becquerel is a Python package for analyzing nuclear spectroscopicmeasurements. The core functionalities are reading and writing differentspectrum file types, fitting spectral features, performing detectorcalibrations, and interpreting measurement results. It includes tools forplotting radiation spectra as well as convenient access to tabulated nucleardata, and it will include fits of different spectral features. It reliesheavily on the standard scientific Python stack of numpy, scipy, matplotlib,and pandas. It is intended to be general-purpose enough that it can be usefulto anyone from an undergraduate taking a laboratory course to the advancedresearcher.InstallationpipinstallbecquerelFeatures in development (contributions welcome!)Reading additionalSpectrumfile types (N42, CHN, CSV)WritingSpectrumobjects to various standard formatsFitting spectral features with Poisson likelihoodIf you are interested in contributing or are want to install the package fromsource, please see the instructions inCONTRIBUTING.md.Reporting issuesWhen reporting issues withbecquerel, please provide a minimum working exampleto help identify the problem and tag the issue as abug.Feature requestsFor a feature request, please create an issue and label it as anew feature.DependenciesExternal dependencies are listed inrequirements.txtand will be installedautomatically with the standardpipinstallation. They can also be installedmanually with the package manager of your choice (pip,conda, etc).The dependenciesbeautifulsoup4,lxmlandhtml5libare necessary forpandas.Developers require additional requirements which are listed inrequirements-dev.txt. We usepytestfor unit testing,blackforcode formatting and are converting tonumpydoc.Contribution guidelinesContributions tobecquerelare welcome and encouraged, whether it is
reporting bugs, requesting features, or contributing code.
Please follow these guidelines when contributing to this project.Developer Instructionspipinstall-rrequirements.txt
pipinstall-rrequirements-dev.txt
pythonsetup.pydevelop

pipinstallpre-commit
pre-commitinstall(It is more convenient to usedevelopso that the code is soft-linked
from the installation directory, and the installed package will always use
the current version of code.)We usepre-committo automatically run black.Running the tests(Requiresrequirements-dev.txtto be installed)
To run the tests usingpytest, from the root directory of the repo:pytest(python setup.py testis still supported also.)
By default, a code coverage report is printed to the terminal.
Tests markedwebtestorplottestare by default skipped for the sake of
speed. To run all tests, clear the pre-configured markers option:pytest-m""To produce an HTML code coverage report in directoryhtmlcovwith line-by-line highlighting:pytest--cov-reporthtml:htmlcovCode Style GuideUsegoogle standardsLinterThe code style/formatting will be checked withblackandflake8in the CIChecklist for code contributionsBranch off ofmainDevelop the feature or fixWrite tests to cover all use casesEnsure all tests pass (pytest)Ensure test coverage is >95%Autoformat (black .)Spellcheck your code and docstringsPush branch to GitHub and create a pull request tomainCopyright Noticebecquerel (bq) Copyright (c) 2017-2021, The Regents of the University ofCalifornia, through Lawrence Berkeley National Laboratory (subject to receiptof any required approvals from the U.S. Dept. of Energy) and University ofCalifornia, Berkeley. All rights reserved.If you have questions about your rights to use or distribute this software,please contact Berkeley Lab's Intellectual Property Office atIPO@lbl.gov.NOTICE. This Software was developed under funding from the U.S. Departmentof Energy and the U.S. Government consequently retains certain rights. Assuch, the U.S. Government has been granted for itself and others acting onits behalf a paid-up, nonexclusive, irrevocable, worldwide license in theSoftware to reproduce, distribute copies to the public, prepare derivativeworks, and perform publicly and display publicly, and to permit others to do so.