Commit 766d9df2 authored by Stephan Kuschel's avatar Stephan Kuschel
Browse files

Merge branch 'master' into fbpic

parents 853f5d74 6efda939
name: run-tests
on: [push, pull_request]
jobs:
latest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r pip-requirements.txt
- name: run tests
run: |
./run-tests.py
other-os:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: [3.x]
# have to copy steps from above, as anchors are currently
# not supported by github workflow (Jan 2020).
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r pip-requirements.txt
- name: run tests
run: |
./run-tests.py
# Check this file before committing a new version:
# http://lint.travis-ci.org/
language: python
sudo: false
dist: xenial
notifications:
email:
on_success: change
on_failure: change
env:
- MATPLOTLIB_V=* NUMPY_V=* SCIPY_V=* CYTHON_V=* PYGMENTS_V="=*"
# - MATPLOTLIB_V=2.0.2 NUMPY_V=* SCIPY_V=* CYTHON_V=*
jobs:
fast_finish: true
# allow_failures:
# have this allowed as there is a bug in matplotlib 2.1.0
# - env: MATPLOTLIB_V=* NUMPY_V=* SCIPY_V=* CYTHON_V=*
include:
- stage: Fast test
python: 3.5
virtualenv:
system_site_packages: true
before_install: skip
install:
- pip install 'matplotlib<3.1'
- pip install -r pip-requirements.txt
before_script: skip
script: ./run-tests.py --fast
- stage: Tests
python: 2.7
env: MATPLOTLIB_V=2.2.3
- python: 3.5
env: MATPLOTLIB_V=3.0
- python: 3.6
- python: 3.7
# Ubuntu 14.04.5 LTS
# python 2.6 is explicitly NOT supported!
- name: "Ubuntu 14.04.5 LTS - Python 3.4"
python: 3.4
env: MATPLOTLIB_V=1.3.1 NUMPY_V=1.8.1 SCIPY_V=0.13.3 CYTHON_V=0.20.1 EXTRAPACK="libgfortran<3" PYGMENTS_V="<2.4"
# Ubuntu 16.04.3 LTS
- name: "Ubuntu 16.04.3 LTS - Python 2.7"
python: 2.7
env: MATPLOTLIB_V=1.5.1 NUMPY_V=1.11.0 SCIPY_V=0.17.0 CYTHON_V=0.23.4
- name: "Ubuntu 16.04.3 LTS - Python 3.5"
python: 3.5
env: MATPLOTLIB_V=1.5.1 NUMPY_V=1.11.0 SCIPY_V=0.17.0 CYTHON_V=0.23.4
# Ubuntu 18.04 LTS
- name: "Ubuntu 18.04 LTS - Python 2.7"
python: 2.7
env: MATPLOTLIB_V=2.1.1 NUMPY_V=1.13.3 SCIPY_V=0.19.1 CYTHON_V=0.26.1
- name: "Ubuntu 18.04 LTS - Python 3.6"
python: 3.6
env: MATPLOTLIB_V=2.1.1 NUMPY_V=1.13.3 SCIPY_V=0.19.1 CYTHON_V=0.26.1
# Install conda
before_install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- chmod +x miniconda.sh
- ./miniconda.sh -b -p $HOME/miniconda
- export PATH=$HOME/miniconda/bin:$PATH
- conda update --yes conda;
- conda config --append channels anaconda
- conda create -yn pyenv python=$TRAVIS_PYTHON_VERSION atlas numpy=$NUMPY_V scipy=$SCIPY_V matplotlib=$MATPLOTLIB_V nose cython=$CYTHON_V h5py numexpr sphinx pygments$PYGMENTS_V $EXTRAPACK
- source activate pyenv
install:
- pip install -r pip-requirements.txt
- python setup.py install
before_script:
- uname -a
- free -m
- df -h
- ulimit -a
- python -V
- cython --version
# run tests
script:
- ./run-tests.py
......@@ -72,6 +72,7 @@ class _fft:
@classmethod
def _get_defaultkwargf(cls, name):
wrapped = getattr(cls.fft_module, name)
@functools.wraps(wrapped)
def ret(*args, **kwargs):
kws = cls.fft_kwargs.copy()
......
......@@ -177,6 +177,9 @@ class SpeciesIdentifier(PhysicalConstants):
'Photon': _specdict(0, 0, False),
'Positron': _specdict(1, 1, False),
'positron': _specdict(1, 1, False),
'bw_positron': _specdict(1, 1, False),
'bw_electron': _specdict(1, -1, False),
'photon': _specdict(0, 0, False),
'gold1': _specdict(1836.2 * 197, 1, True),
'gold3': _specdict(1836.2 * 197, 3, True),
'gold4': _specdict(1836.2 * 197, 4, True),
......
......@@ -181,14 +181,18 @@ _defaultscalars = [
ScalarProperty('pz', 'pz', 'kg*m/s'),
ScalarProperty('sqrt(px**2 + py**2 + pz**2)', 'p', 'kg*m/s'),
ScalarProperty('(px**2 + py**2 + pz**2)/(mass * c)**2', '_np2', ''),
ScalarProperty('_np2 / (sqrt(1 + _np2) + 1)', 'gamma_m1', ''),
ScalarProperty('_np2 / (sqrt(1 + _np2) + 1)', 'gamma_m1', ''), # gamma - 1
ScalarProperty('_np2 / (sqrt(1 + _np2) + 1) + 1', 'gamma', ''),
ScalarProperty('gamma * mass', 'gamma_m', 'kg'),
ScalarProperty('gamma * mass', 'gamma_m', 'kg'), # gamma * mass
ScalarProperty('beta * c', 'v', 'm/s'),
ScalarProperty('px / (gamma * mass)', 'vx', 'm/s'),
ScalarProperty('py / (gamma * mass)', 'vy', 'm/s'),
ScalarProperty('pz / (gamma * mass)', 'vz', 'm/s'),
ScalarProperty('sqrt(gamma**2 - 1) / gamma', 'beta', ''),
# beta = sqrt(gamma**2 - 1) / gamma
# = sqrt(gamma_m1**2 + 2 * gamma_m1) / gamma
# = sqrt(gamma_m1**2 + 2 * gamma_m1) / (gamma_m1 + 1)
# numerically more stable and gamma_m1 has to be calculated just once.
ScalarProperty('sqrt(gamma_m1**2 + 2 * gamma_m1) / (gamma_m1 + 1)', 'beta', ''),
ScalarProperty('vx / c', 'betax', ''),
ScalarProperty('vy / c', 'betay', ''),
ScalarProperty('vz / c', 'betaz', ''),
......
......@@ -63,7 +63,8 @@ def run_alltests(python='python', fast=False, skip_setup=False):
cmdrpl = dict(python=python)
# make sure .pyx sources are up to date and compiled
if not skip_setup:
runcmd('{python} setup.py develop --user'.format(**cmdrpl))
# should be the same as `./setup.py develop --user`
runcmd('{python} -m pip install --user -e .'.format(**cmdrpl))
# find pep8 or pycodestyle (its successor)
try:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment