Skip to content

Commit

Permalink
Merge pull request #40 from neutrons/36-switch-to-actions
Browse files Browse the repository at this point in the history
Switch to GitHub Actions, fix tox setup, and format updates
  • Loading branch information
marshallmcdonnell authored Dec 30, 2020
2 parents 53cd137 + 796697a commit b83dc02
Show file tree
Hide file tree
Showing 17 changed files with 452 additions and 251 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = pystog/_version.py
40 changes: 40 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: pystog_cd

env: {}

on:
push:
tags:
- 'v*'

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.7
channels: conda-forge

- name: Build Python package and Upload to PyPi
shell: bash -l {0}
env:
PYPI_TOKEN_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pip install wheel twine
python setup.py sdist bdist_wheel
twine upload --username "__token__" --password $PYPI_TOKEN_PASSWORD dist/*
- name: Build conda package and upload to Anaconda
shell: bash -l {0}
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
conda install -y anaconda-client conda-build conda-verify
cd conda.recipe
conda build --output-folder . .
anaconda upload --label main noarch/*.tar.bz2
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: pystog_ci

env: {}

on:
push:
branches:
- '*'
tags:
- 'v*'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge

- name: Conda install deps
shell: bash -l {0}
run: |
conda install --file requirements.txt --file requirements-dev.txt
conda install pip
pip install tox-gh-actions
- name: Lint and Test with Tox
shell: bash -l {0}
run: tox
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include versioneer.py
include pystog/_version.py
include requirements*.txt
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Total Scattering Function Manipulator:
-----------------------------------------------------------

| Dev | Other | Tutorials |
|-----|-------|------------|
|[![Build Status](https://travis-ci.org/neutrons/pystog.svg?branch=master)](https://travis-ci.org/neutrons/pystog) | [![PyPI version](https://badge.fury.io/py/pystog.svg)](https://badge.fury.io/py/pystog) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/neutrons/pystog/master?filepath=tutorials) |
| [![codecov](https://codecov.io/gh/neutrons/pystog/branch/master/graph/badge.svg)](https://codecov.io/gh/neutrons/pystog) | [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | |
|[![Documentation Status](https://readthedocs.org/projects/pystog/badge/?version=latest)](https://pystog.readthedocs.io/en/latest/?badge=latest) | [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) | |
| Health | Release | Other |
|--------|---------|------------|
| [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fneutrons%2Fpystog%2Fbadge%3Fref%3Dmaster&style=plastic)](https://actions-badge.atrox.dev/neutrons/pystog/goto?ref=master) | [![PyPI version](https://badge.fury.io/py/pystog.svg)](https://badge.fury.io/py/pystog) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/neutrons/pystog/master?filepath=tutorials) |
| [![codecov](https://codecov.io/gh/neutrons/pystog/branch/master/graph/badge.svg)](https://codecov.io/gh/neutrons/pystog) | [![Anaconda-Server Badge](https://anaconda.org/neutrons/pystog/badges/version.svg)](https://anaconda.org/neutrons/pystog)| [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) |
|[![Documentation Status](https://readthedocs.org/projects/pystog/badge/?version=latest)](https://pystog.readthedocs.io/en/latest/?badge=latest) | [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | |

From total scattering functions, we have reciprocal-space structure factors and real-space pair distribution functions that are related via a Fourier transform. PyStoG is a package that allows for:
1. Converting between the various functions used by different "communities" (ie researchers who study crystalline versus amorphous or glass materials). Conversions are for either real-space or reciprocal-space.
Expand Down
5 changes: 1 addition & 4 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set data = load_setup_py() %}
{% set data = load_setup_py_data() %}

package:
name: pystog
Expand All @@ -25,9 +25,6 @@ requirements:
test:
imports:
- pystog
- pystog.converter.Converter
- pystog.transformer.Transformer
- pystog.fourier_filter.FourierFilter

about:
home: https://github.com/neutrons/pystog
Expand Down
9 changes: 6 additions & 3 deletions pystog/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def F_to_DCS(self, q, fq, dfq=None, **kwargs):
:param dfq: uncertainty vector
:type dfq: numpy.array or list
:return: (:math:`\\frac{d \\sigma}{d \\Omega}(Q)` vector, uncertainty vector)
:return: (:math:`\\frac{d \\sigma}{d \\Omega}(Q)` vector,
uncertainty vector)
:rtype: (numpy.array, numpy.array)
"""
fq, dfq = self.F_to_FK(q, fq, dfq, **kwargs)
Expand Down Expand Up @@ -138,7 +139,8 @@ def S_to_DCS(self, q, sq, dsq=None, **kwargs):
:param dsq: uncertainty vector
:type dsq: numpy.array or list
:return: (:math:`\\frac{d \\sigma}{d \\Omega}(Q)` vector, uncertainty vector)
:return: (:math:`\\frac{d \\sigma}{d \\Omega}(Q)` vector,
uncertainty vector)
:rtype: (numpy.array, numpy.array)
"""
fq, dfq = self.S_to_FK(q, sq, dsq, **kwargs)
Expand Down Expand Up @@ -189,7 +191,8 @@ def FK_to_DCS(self, q, fq, dfq=None, **kwargs):
:param dfq: uncertainty vector
:type dfq: numpy.array or list
:return: (:math:`\\frac{d \\sigma}{d \\Omega}(Q)` vector, uncertainty vector)
:return: (:math:`\\frac{d \\sigma}{d \\Omega}(Q)` vector,
uncertainty vector)
:rtype: (numpy.array, numpy.array)
"""
return fq + kwargs['<b_tot^2>'], dfq
Expand Down
Loading

0 comments on commit b83dc02

Please sign in to comment.