Skip to content

Commit

Permalink
Merge pull request #246 from lbl-anp/gh-actions-coveralls
Browse files Browse the repository at this point in the history
Github action for coveralls, readme badges, metadata refactor
  • Loading branch information
jccurtis committed Apr 28, 2021
2 parents f3c4387 + 6a7cb95 commit 54d5fc9
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 116 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: coveralls

on:
push:
branches: [ $default-branch ]
pull_request:

jobs:
coveralls_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install --only-binary=numpy,scipy -r requirements-dev.txt
- name: Install package
run: |
pip install -e .
- name: Test with pytest
run: |
pytest
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Unit Test

coveralls_finish:
needs: coveralls_test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
debug: true
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This workflow will install dependencies, install becquerel and run tests.
# It runs on multiple python3 versions on macOS and Ubuntu.
# It runs on multiple python3 versions on macOS, Ubuntu and Windows.
# It runs when a commit (merge) is push to the main (default) branch or for updates to a PR targeting main.
# Based on: https://github.com/actions/starter-workflows/blob/main/ci/python-package.yml

name: Python package
name: tests

on:

Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
pip install -r requirements-dev.txt
- name: Install package
run: |
pip install -e .
pip install .
- name: Test with pytest
run: |
python -c 'import becquerel;'
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,3 @@ $RECYCLE.BIN/

# Becquerel settings
__df_cache_*.csv
__metadata__.py
13 changes: 13 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Becquerel v. 0.3.0, Copyright (c) 2017, The Regents of the University of
California (UC), through Lawrence Berkeley National Laboratory, and the UC
Berkeley campus (subject to receipt of any required approvals from the U.S.
Dept. of Energy). All rights reserved. If you have questions about your rights
to use or distribute this software, please contact Berkeley Lab's Innovation &
Partnerships Office at IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department of
Energy and the U.S. Government consequently retains certain rights. As such,
the U.S. Government has been granted for itself and others acting on its
behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software
to reproduce, distribute copies to the public, prepare derivative works, and
perform publicly and display publicly, and to permit other to do so.
21 changes: 13 additions & 8 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
*** License Agreement ***

*** Copyright Notice ***

Becquerel v. 0.3.0, Copyright (c) 2017, The Regents of the University of California (UC), through Lawrence Berkeley National Laboratory, and the UC Berkeley campus (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Innovation & Partnerships Office at IPO@lbl.gov.
Becquerel v. 0.3.0, Copyright (c) 2017, The Regents of the University of
California (UC), through Lawrence Berkeley National Laboratory, and the UC
Berkeley campus (subject to receipt of any required approvals from the U.S.
Dept. of Energy). All rights reserved. If you have questions about your rights
to use or distribute this software, please contact Berkeley Lab's Innovation &
Partnerships Office at IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit other to do so.
NOTICE. This Software was developed under funding from the U.S. Department of
Energy and the U.S. Government consequently retains certain rights. As such,
the U.S. Government has been granted for itself and others acting on its
behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software
to reproduce, distribute copies to the public, prepare derivative works, and
perform publicly and display publicly, and to permit other to do so.

**************************************************************************
*** License Agreement ***

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand All @@ -20,5 +27,3 @@ NOTICE. This Software was developed under funding from the U.S. Department of E
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license to Lawrence Berkeley National Laboratory, University if California, Berkeley, and the U.S. Dept. of Energy: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form.

***************************************************************************
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# becquerel

[![tests](https://github.com/lbl-anp/becquerel/actions/workflows/tests.yaml/badge.svg)](https://github.com/lbl-anp/becquerel/actions/workflows/tests.yaml)
[![Coverage Status](https://coveralls.io/repos/github/lbl-anp/becquerel/badge.svg?branch=main)](https://coveralls.io/github/lbl-anp/becquerel?branch=main)

Becquerel is a Python package for analyzing nuclear spectroscopic
measurements. The core functionalities are reading and writing different
spectrum file types, fitting spectral features, performing detector
Expand Down Expand Up @@ -60,8 +63,8 @@ Dept. of Energy). All rights reserved. If you have questions about your rights
to use or distribute this software, please contact Berkeley Lab's Innovation &
Partnerships Office at IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department of
Energy and the U.S. Government consequently retains certain rights. As such,
NOTICE. This Software was developed under funding from the U.S. Department of
Energy and the U.S. Government consequently retains certain rights. As such,
the U.S. Government has been granted for itself and others acting on its
behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software
to reproduce, distribute copies to the public, prepare derivative works, and
Expand Down
82 changes: 46 additions & 36 deletions becquerel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,78 @@
"""Becquerel: Tools for radiation spectral analysis."""

from . import core
from . import parsers
from . import tools
from .__metadata__ import __description__, __url__
from .__metadata__ import __version__, __license__, __copyright__
from .__metadata__ import (
__description__,
__url__,
__version__,
__license__,
__copyright__,
)

from .core.rebin import rebin, RebinError, RebinWarning
from .core.spectrum import Spectrum, SpectrumError, UncalibratedError
from .core.spectrum import SpectrumWarning
from . import core
from .core import utils, fitting
from .core.autocal import AutoCalibrator, AutoCalibratorError
from .core.energycal import LinearEnergyCal, EnergyCalError, BadInput
from .core.utils import UncertaintiesError
from .core.plotting import SpectrumPlotter, PlottingError
from .core.fitting import Fitter
from .core.peakfinder import (
PeakFilter,
PeakFilterError,
GaussianPeakFilter,
PeakFinder,
PeakFinderError,
)
from .core.autocal import AutoCalibrator, AutoCalibratorError
from .core.plotting import SpectrumPlotter, PlottingError
from .core.rebin import rebin, RebinError, RebinWarning
from .core.spectrum import Spectrum, SpectrumError, UncalibratedError, SpectrumWarning
from .core.utils import UncertaintiesError

from .core import utils
from .core import fitting
from .core.fitting import Fitter
from . import parsers

from .tools import nndc
from . import tools
from .tools import nndc, xcom, materials
from .tools.element import Element
from .tools.isotope import Isotope
from .tools.isotope_qty import IsotopeQuantity
from .tools import xcom
from .tools import materials

import warnings

warnings.simplefilter("default", DeprecationWarning)

__all__ = [
"__description__",
"__url__",
"__version__",
"__license__",
"__copyright__",
"core",
"parsers",
"tools",
"rebin",
"RebinError",
"RebinWarning",
"Spectrum",
"SpectrumError",
"SpectrumWarning",
"SpectrumPlotter",
"PlottingError",
"UncalibratedError",
"utils",
"fitting",
"AutoCalibrator",
"AutoCalibratorError",
"LinearEnergyCal",
"EnergyCalError",
"BadInput",
"UncertaintiesError",
"Fitter",
"PeakFilter",
"PeakFilterError",
"GaussianPeakFilter",
"PeakFinder",
"PeakFinderError",
"AutoCalibrator",
"AutoCalibratorError",
"__description__",
"__url__",
"__version__",
"__license__",
"__copyright__",
"SpectrumPlotter",
"PlottingError",
"rebin",
"RebinError",
"RebinWarning",
"Spectrum",
"SpectrumError",
"UncalibratedError",
"SpectrumWarning",
"UncertaintiesError",
"parsers",
"tools",
"nndc",
"xcom",
"materials",
"Element",
"Isotope",
"IsotopeQuantity",
]
40 changes: 40 additions & 0 deletions becquerel/__metadata__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""becquerel package metadata."""

__name__ = "becquerel"
__author__ = "The Becquerel Development Team"
__maintainer__ = __author__
__email__ = "becquerel-dev@lbl.gov"
__description__ = "Tools for radiation spectral analysis."
__url__ = "https://github.com/lbl-anp/becquerel"
__version__ = "0.3.0"
# classifiers from list at https://pypi.org/classifiers/
__classifiers__ = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: Other/Proprietary License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
]
__license__ = "Other/Proprietary License (see LICENSE.txt)"
__copyright__ = """\
Becquerel v. 0.3.0, Copyright (c) 2017, The Regents of the University of
California (UC), through Lawrence Berkeley National Laboratory, and the UC
Berkeley campus (subject to receipt of any required approvals from the U.S.
Dept. of Energy). All rights reserved. If you have questions about your rights
to use or distribute this software, please contact Berkeley Lab's Innovation &
Partnerships Office at IPO@lbl.gov.
NOTICE. This Software was developed under funding from the U.S. Department of
Energy and the U.S. Government consequently retains certain rights. As such,
the U.S. Government has been granted for itself and others acting on its
behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software
to reproduce, distribute copies to the public, prepare derivative works, and
perform publicly and display publicly, and to permit other to do so.
"""
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-r requirements.txt
coverage
flake8
black>=20.8b1
pytest>=3.0.0
pytest-cov
Expand Down
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[aliases]
test=pytest
test = pytest

[tool:pytest]
addopts = --black --cov=becquerel --cov-report term --cov-report html:htmlcov -m "not plottest"
Expand All @@ -10,3 +10,6 @@ filterwarnings =
always
; Not fixing the problem: https://github.com/pytest-dev/pytest/pull/3613
ignore:.*t resolve package from __spec__ or __package__.*:ImportWarning

[coverage:run]
relative_files = True

0 comments on commit 54d5fc9

Please sign in to comment.