Skip to content

Commit

Permalink
Merge branch 'master' into libgalpy
Browse files Browse the repository at this point in the history
  • Loading branch information
jobovy committed Mar 25, 2020
2 parents 511ae1d + 0541daa commit 14387a3
Show file tree
Hide file tree
Showing 34 changed files with 634 additions and 366 deletions.
56 changes: 51 additions & 5 deletions .appveyor.yml
@@ -1,21 +1,24 @@
build: off

environment:
PYTHON_VERSION: 3.7
PYTHON_VERSION: 3.8
MINICONDA: C:\\Miniconda37-x64

matrix:
- TEST_FILES: tests\test_orbit.py tests\test_orbits.py
ADDL_CONDA_PKGS: astropy astroquery
COMPILE_NOOPENMP:
BUILD_WHEELS: "true"

- TEST_FILES: "tests\\ --ignore=tests\\test_actionAngleTorus.py --ignore=tests\\test_snapshotpotential.py --ignore=tests\\test_qdf.py --ignore=tests\\test_pv2qdf.py --ignore=tests\\test_diskdf.py --ignore=tests\\test_orbit.py --ignore=tests\\test_orbits.py --ignore=tests\\test_streamdf.py --ignore=tests\\test_streamgapdf.py --ignore=tests\\test_evolveddiskdf.py --ignore=tests\\test_quantity.py --ignore=tests\\test_nemo.py --ignore=tests\\test_amuse.py --ignore=tests\\test_coords.py"
ADDL_CONDA_PKGS:
COMPILE_NOOPENMP:

- TEST_FILES: tests\test_orbit.py tests\test_orbits.py
ADDL_CONDA_PKGS: astropy astroquery
COMPILE_NOOPENMP: "--no-openmp"
BUILD_WHEELS: "false"

- TEST_FILES: tests\test_quantity.py tests\test_coords.py
ADDL_CONDA_PKGS: astropy
COMPILE_NOOPENMP: "--no-openmp"
BUILD_WHEELS: "false"

platform:
- x64
Expand All @@ -42,3 +45,46 @@ install:

test_script:
- pytest -v %TEST_FILES% --cov galpy --cov-config .coveragerc_travis --disable-pytest-warnings

after_test:
# Build wheels for different python versions of BUILD_WHEELS, otherwise done
- ps: |
if ($env:BUILD_WHEELS -eq "false") {
Exit-AppVeyorBuild
}
- conda deactivate
- conda remove --name test-environment --all
# Python 3.8
- conda create -n py38 python=3.8 numpy scipy matplotlib setuptools pip pytest gsl
- conda activate py38
- pip install wheel
- set INCLUDE=%CONDA_PREFIX%\Library\include;%INCLUDE%
- set LIB=%CONDA_PREFIX%\Library\lib;%LIB%
- set LIBPATH=%CONDA_PREFIX%\Library\lib;%LIBPATH%
- python setup.py bdist_wheel
- conda deactivate
# Python 3.7
- conda create -n py37 python=3.7 numpy scipy matplotlib setuptools pip pytest gsl
- conda activate py37
- conda remove --name py38 --all
- pip install wheel
- set INCLUDE=%CONDA_PREFIX%\Library\include;%INCLUDE%
- set LIB=%CONDA_PREFIX%\Library\lib;%LIB%
- set LIBPATH=%CONDA_PREFIX%\Library\lib;%LIBPATH%
- python setup.py bdist_wheel
- conda deactivate
# Python 3.6
- conda create -n py36 python=3.6 numpy scipy matplotlib setuptools pip pytest gsl
- conda activate py36
- conda remove --name py37 --all
- pip install wheel
- set INCLUDE=%CONDA_PREFIX%\Library\include;%INCLUDE%
- set LIB=%CONDA_PREFIX%\Library\lib;%LIB%
- set LIBPATH=%CONDA_PREFIX%\Library\lib;%LIBPATH%
- python setup.py bdist_wheel
- conda deactivate
# Upload as artifacts
- ps: |
if ($env:BUILD_WHEELS -eq "true") {
Get-ChildItem dist\*.whl | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
}
18 changes: 18 additions & 0 deletions .github/stale.yml
@@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. If the
issue has been resolved since the last activity, please close the issue.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
14 changes: 9 additions & 5 deletions .travis.yml
@@ -1,15 +1,15 @@
dist: xenial
dist: bionic
sudo: false
language: python
# Working towards support https://numpy.org/neps/nep-0029-deprecation_policy.html
python:
- "3.7"
- "3.8"
env: #split tests
global:
- REQUIRES_PYNBODY=false
- REQUIRES_ASTROPY=false
- REQUIRES_ASTROQUERY=false
- PYTHON_COVREPORTS_VERSION=3.7 # Version for which reports are uploaded
- PYTHON_COVREPORTS_VERSION=3.8 # Version for which reports are uploaded
matrix:
- TEST_FILES='tests/ --ignore=tests/test_qdf.py --ignore=tests/test_pv2qdf.py --ignore=tests/test_diskdf.py --ignore=tests/test_orbit.py --ignore=tests/test_streamdf.py --ignore=tests/test_streamgapdf.py --ignore=tests/test_evolveddiskdf.py --ignore=tests/test_quantity.py --ignore=tests/test_nemo.py --ignore=tests/test_amuse.py --ignore=tests/test_coords.py --ignore=tests/test_jeans.py --ignore=tests/test_orbits.py' REQUIRES_PYNBODY=true
- TEST_FILES='tests/test_quantity.py tests/test_coords.py' REQUIRES_ASTROPY=true # needs to be separate for different config
Expand All @@ -18,12 +18,14 @@ env: #split tests
- TEST_FILES='tests/test_diskdf.py'
- TEST_FILES='tests/test_qdf.py tests/test_pv2qdf.py tests/test_streamgapdf.py'
- TEST_FILES='tests/test_streamdf.py'
matrix: # only run crucial tests for python 2.7, 3.6
matrix: # only run crucial tests for python 2.7, 3.6, 3.7
include:
- python: "2.7"
env: TEST_FILES='tests/test_orbit.py tests/test_orbits.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true REQUIRES_ASTROQUERY=true
- python: "3.6"
env: TEST_FILES='tests/test_orbit.py tests/test_orbits.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true REQUIRES_ASTROQUERY=true
- python: "3.7"
env: TEST_FILES='tests/test_orbit.py tests/test_orbits.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true REQUIRES_ASTROQUERY=true
addons:
apt:
packages:
Expand All @@ -49,7 +51,9 @@ before_install:
- conda config --set always_yes yes --set changeps1 no
- conda update conda
- conda config --add channels conda-forge
- conda create -n test-environment python=$TRAVIS_PYTHON_VERSION "numpy>=1.16" scipy matplotlib numexpr setuptools pip "cython>=0.20" pytest
# setuptools >= 45 no longer supports Python 2
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then SETUPTOOLS_VERSION="<45"; else SETUPTOOLS_VERSION=""; fi
- conda create -n test-environment python=$TRAVIS_PYTHON_VERSION "numpy>=1.16" scipy matplotlib numexpr "setuptools$SETUPTOOLS_VERSION" pip "cython>=0.20" pytest
- source activate test-environment
#Switch to conda defaults python, because conda-forge python has issues with gcc compiler similar to https://github.com/conda/conda/issues/6030
- conda install python=$TRAVIS_PYTHON_VERSION -c defaults
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1,4 +1,4 @@
include README.rst README.dev README.nemo LICENSE HISTORY.txt AUTHORS.txt
include README.md README.dev README.nemo LICENSE HISTORY.txt AUTHORS.txt
include gsl-config.bat
include galpy/df/data/*.sav
include galpy/orbit/named_objects.json
Expand Down
99 changes: 99 additions & 0 deletions README.md
@@ -0,0 +1,99 @@
<p align="center">
<a href="http://www.galpy.org" target="_blank"><img src="https://galpy.readthedocs.io/en/latest/_static/galpy-logo-small.gif"></a><br/>
<b>Galactic Dynamics in python</b>
</p>

[galpy](http://www.galpy.org) is a Python 2 and 3 package for galactic dynamics. It supports orbit integration in a variety of potentials, evaluating and sampling various distribution functions, and the calculation of action-angle coordinates for all static potentials. `galpy` is an [astropy](http://www.astropy.org/) [affiliated package](http://www.astropy.org/affiliated/) and provides full support for astropy’s [Quantity](http://docs.astropy.org/en/stable/api/astropy.units.Quantity.html) framework for variables with units.

[![image](https://travis-ci.org/jobovy/galpy.svg?branch=master)](http://travis-ci.org/jobovy/galpy) [![image](https://ci.appveyor.com/api/projects/status/wmgs1sq3i7tbtap2/branch/master?svg=true)](https://ci.appveyor.com/project/jobovy/galpy) [![image](https://img.shields.io/coveralls/jobovy/galpy.svg)](https://coveralls.io/r/jobovy/galpy?branch=master) [![image](http://codecov.io/github/jobovy/galpy/coverage.svg?branch=master)](http://codecov.io/github/jobovy/galpy?branch=master) [![image](https://readthedocs.org/projects/galpy/badge/?version=latest)](http://docs.galpy.org/en/latest/) [![image](http://img.shields.io/pypi/v/galpy.svg)](https://pypi.python.org/pypi/galpy/) [![image](https://anaconda.org/conda-forge/galpy/badges/installer/conda.svg)](https://anaconda.org/conda-forge/galpy) [![image](http://img.shields.io/badge/license-New%20BSD-brightgreen.svg)](https://github.com/jobovy/galpy/blob/master/LICENSE) [![image](http://img.shields.io/badge/DOI-10.1088/0067%2D%2D0049/216/2/29-blue.svg)](http://dx.doi.org/10.1088/0067-0049/216/2/29) [![image](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/) [![image](https://slackin-galpy.herokuapp.com/badge.svg)](https://galpy.slack.com/) [![image](https://img.shields.io/badge/join-slack-E01563.svg?style=flat&logo=slack&logoWidth=10)](https://slackin-galpy.herokuapp.com)

AUTHOR
======

Jo Bovy - bovy at astro dot utoronto dot ca

See
[AUTHORS.txt](https://github.com/jobovy/galpy/blob/master/AUTHORS.txt)
for a full list of contributors.

If you find this code useful in your research, please let me know. **If
you use galpy in a publication, please cite** [Bovy
(2015)](http://adsabs.harvard.edu/abs/2015ApJS..216...29B) **and link to
http://github.com/jobovy/galpy**. See [the acknowledgement documentation
section](http://docs.galpy.org/en/latest/index.html#acknowledging-galpy)
for a more detailed guide to citing parts of the code. Please also send
me a reference to the paper or send a pull request including your paper
in the list of galpy papers on [this
page](http://docs.galpy.org/en/latest/) (this page is at
doc/source/index.rst). Thanks!

LOOKING FOR HELP?
=================

The latest documentation can be found
[here](http://docs.galpy.org/en/latest/). You can also join the
[galpy slack community](https://galpy.slack.com/) for any questions
related to `galpy`; join
[here](https://slackin-galpy.herokuapp.com).

If you find *any* bug in the code, please report these using the [Issue
Tracker](http://github.com/jobovy/galpy/issues) or by joining the [galpy
slack community](https://galpy.slack.com/).

If you are having issues with the installation of `galpy`, please first
consult the [Installation
FAQ](http://docs.galpy.org/en/latest/installation.html#installation-faq).

PYTHON VERSIONS AND DEPENDENCIES
================================

`galpy` supports both Python 2 and 3. Specifically, galpy supports
Python 2.7 and Python 3.6 and 3.7. It should also work on earlier Python
3.\* versions, but this is not extensively tested on an ongoing basis.
Travis CI builds regularly check support for Python 2.7 and 3.7 (and of
3.6 using a more limited, core set of tests) and Appveyor builds
regularly check support for Python 3.7 on Windows.

This package requires [Numpy](https://numpy.org/),
[Scipy](http://www.scipy.org/), and
[Matplotlib](http://matplotlib.sourceforge.net/). Certain advanced
features require the GNU Scientific Library
([GSL](http://www.gnu.org/software/gsl/)), with action calculations
requiring version 1.14 or higher. Use of `SnapshotRZPotential` and
`InterpSnapshotRZPotential` requires
[pynbody](https://github.com/pynbody/pynbody). Support for providing
inputs and getting outputs as Quantities with units is provided through
[astropy](http://www.astropy.org/).

CONTRIBUTING TO GALPY
=====================

If you are interested in contributing to galpy\'s development, take a
look at [this brief
guide](https://github.com/jobovy/galpy/wiki/Guide-for-new-contributors)
on the wiki. This will hopefully help you get started!

Some further development notes can be found on the
[wiki](http://github.com/jobovy/galpy/wiki/). This includes a list of
small and larger extensions of galpy that would be useful
[here](http://github.com/jobovy/galpy/wiki/Possible-galpy-extensions) as
well as a longer-term roadmap
[here](http://github.com/jobovy/galpy/wiki/Roadmap). Please let the main
developer know if you need any help contributing!

DISK DF CORRECTIONS
===================

The dehnendf and shudf disk distribution functions can be corrected to
follow the desired surface-mass density and radial-velocity-dispersion
profiles more closely (see
[1999AJ\....118.1201D](http://adsabs.harvard.edu/abs/1999AJ....118.1201D)).
Calculating these corrections is expensive, and a large set of
precalculated corrections can be found
[here](http://github.com/downloads/jobovy/galpy/galpy-dfcorrections.tar.gz)
\[tar.gz archive\]. Install these by downloading them and unpacking them
into the galpy/df/data directory before running the setup.py
installation. E.g.:

curl -O https://github.s3.amazonaws.com/downloads/jobovy/galpy/galpy-dfcorrections.tar.gz
tar xvzf galpy-dfcorrections.tar.gz -C ./galpy/df/data/

0 comments on commit 14387a3

Please sign in to comment.