Skip to content

Commit

Permalink
Merge pull request #3 from aburrell/path_length_fix
Browse files Browse the repository at this point in the history
Updated comments to reflect change in package manager, extended maximum allowable datafile path length (necessary for typical Mac OSX set up), improved PEP8 compliance, updated tests to account for difference in significant figures between operating systems and python versions.
  • Loading branch information
Angeline Burrell authored Feb 27, 2018
2 parents 5899751 + d9bc39c commit 78d366e
Show file tree
Hide file tree
Showing 19 changed files with 428 additions and 335 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ docs/_build
*.lo
*.o
*.obj
*.dSYM

# Precompiled Headers
*.gch
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ before_install:
- lsb_release -a

install:
- pip install pytest-capturelog coveralls pytest-cov coverage codecov
- pip install coveralls pytest-cov coverage codecov
- python setup.py clean --all build_ext --force --inplace
- python setup.py develop

Expand Down
3 changes: 2 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Authors
This python wrapper is made by:

* Karl M. Laundal
* Christer van der Meeren (maintainer)
* Christer van der Meeren
* Angeline G. Burrell (maintainer)

Fortran code by Emmert et al. [2010] [1]_. Quasi-dipole and modified
apex coordinates are defined by Richmond [1995] [2]_. The code uses
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

1.0.2 (2018-02-27)
-----------------------------------------

* Extend character limit for allowable data file path, and update documentation to reflect a change in maintainers. Also updated testing implimentation, reduced fortran compiler warnings, and improved PEP8 compliance.

1.0.1 (2016-03-10)
-----------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Bug reports, feature suggestions and other contributions are greatly appreciated
Short version
=============

* Submit bug reports and feature requests at `GitHub <https://github.com/cmeeren/apexpy/issues>`_
* Submit bug reports and feature requests at `GitHub <https://github.com/aburrell/apexpy/issues>`_
* Make pull requests to the ``develop`` branch

Bug reports
===========

When `reporting a bug <https://github.com/cmeeren/apexpy/issues>`_ please include:
When `reporting a bug <https://github.com/aburrell/apexpy/issues>`_ please include:

* Your operating system name and version
* Any details about your local setup that might be helpful in troubleshooting
Expand All @@ -22,7 +22,7 @@ When `reporting a bug <https://github.com/cmeeren/apexpy/issues>`_ please includ
Feature requests and feedback
=============================

The best way to send feedback is to file an issue at `GitHub <https://github.com/cmeeren/apexpy/issues>`_.
The best way to send feedback is to file an issue at `GitHub <https://github.com/aburrell/apexpy/issues>`_.

If you are proposing a feature:

Expand Down
5 changes: 1 addition & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
graft docs
graft examples
graft src
graft ci
graft tests

include .bumpversion.cfg
include .coveragerc
include .cookiecutterrc
include .isort.cfg
include .pylintrc
include pytest.ini

include AUTHORS.rst
Expand All @@ -19,4 +16,4 @@ include README.rst

include tox.ini .travis.yml appveyor.yml .codeclimate.yml .landscape.yaml

global-exclude *.py[cod] __pycache__ *.so *.dylib
global-exclude *.py[cod~] __pycache__ *.so *.dylib
23 changes: 9 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,25 @@ Install (requires NumPy)::
Conversion is done by creating an ``Apex`` object and using its methods to perform the desired calculations. Some simple examples::

>>> from apexpy import Apex
>>> from __future__ import print_function
>>> A = Apex(date=2015.3) # datetime objects are also supported
>>> # geo to apex, scalar input
>>> mlat, mlon = A.convert(60, 15, 'geo', 'apex', height=300)
>>> mlat
57.469573974609375
>>> mlon
93.633583068847656
>>> print("{:.12f}, {:.12f}".format(mlat, mlon))
57.469573974609, 93.633583068848
>>> # apex to geo, array input
>>> glat, glon = A.convert([90, -90], 0, 'apex', 'geo', height=0)
>>> glat
array([ 83.09959412, -74.38826752])
>>> glon
array([ -84.59458923, 125.71492767])
>>> print(["{:.12f}, {:.12f}".format(ll, glon[i]) for i,ll in enumerate(glat)])
['83.099594116211, -84.594589233398', '-74.388267517090, 125.714927673340']
>>> # geo to MLT
>>> import datetime as dt
>>> mlat, mlt = A.convert(60, 15, 'geo', 'mlt', datetime=dt.datetime(2015, 2, 10, 18, 0, 0))
>>> mlat
56.590423583984375
>>> mlt
19.108103879292806
>>> print("{:.12f}, {:.12f}".format(mlat, mlt))
56.590423583984, 19.108103879293
>>> # can also convert magnetic longitude to mlt
>>> mlt = A.mlon2mlt(120, dt.datetime(2015, 2, 10, 18, 0, 0))
>>> mlt
20.893547503153481
>>> print("{:.2f}".format(mlt))
20.89

If you don't know or use Python, you can also use the command line. See details in the full documentation.

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
master_doc = 'index'
project = u'Apex Python library'
year = u'2015'
author = u'Christer van der Meeren'
author = u'Christer van der Meeren, Angeline G. Burrell'
copyright = '{0}, {1}'.format(year, author)
version = release = u'1.0.1'
# on_rtd is whether we are on readthedocs.org
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ On Linux this will build apexpy from source, which requires a fortran compiler s

The package has been tested with the following setups (others might work, too):

* Windows (32/64 bit Python) and Linux (64 bit)
* Python 2.7, 3.3, 3.4 (and 3.5 on Linux [2]_)
* Windows (32/64 bit Python), Linux (64 bit), and Mac
* Python 2.7, 3.3, 3.4 (and 3.5 on Linux/Mac [2]_)

.. [1] pip is included with Python 2 from v2.7.9 and Python 3 from v3.4. If you don't have pip, `get it here <http://pip.readthedocs.org/en/stable/installing/>`_.
.. [2] I do not know of any way to compile the Fortran extension on Windows in a manner that is compatible with Python 3.5. If you get it working, let me know!
23 changes: 9 additions & 14 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,25 @@ Python library
For full documentation of the functions, see the reference for :class:`apexpy.Apex`.

>>> from apexpy import Apex
>>> from __future__ import print_function
>>> A = Apex(date=2015.3) # datetime objects are also supported
>>> # geo to apex, scalar input
>>> mlat, mlon = A.convert(60, 15, 'geo', 'apex', height=300)
>>> mlat
57.469573974609375
>>> mlon
93.633583068847656
>>> print("{:.12f}, {:.12f}".format(mlat, mlon))
57.469573974609, 93.633583068848
>>> # apex to geo, array input
>>> glat, glon = A.convert([90, -90], 0, 'apex', 'geo', height=0)
>>> glat
array([ 83.09959412, -74.38826752])
>>> glon
array([ -84.59458923, 125.71492767])
>>> print(["{:.12f}, {:.12f}".format(ll, glon[i]) for i,ll in enumerate(glat)])
['83.099594116211, -84.594589233398', '-74.388267517090, 125.714927673340']
>>> # geo to MLT
>>> import datetime as dt
>>> mlat, mlt = A.convert(60, 15, 'geo', 'mlt', datetime=dt.datetime(2015, 2, 10, 18, 0, 0))
>>> mlat
56.590423583984375
>>> mlt
19.107855542500815
>>> print("{:.12f}, {:.12f}".format(mlat, mlt))
56.590423583984, 19.108103879293
>>> # can also convert magnetic longitude to mlt
>>> mlt = A.mlon2mlt(120, dt.datetime(2015, 2, 10, 18, 0, 0))
>>> mlt
20.893299166361491
>>> print("{:.2f}".format(mlt))
20.89



Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[pytest]
log_cli=true
log_level=NOTSET
addopts = -vv --ignore=src --ignore=ci --ignore=docs --doctest-modules --doctest-glob='*.rst'
16 changes: 10 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
extensions = [
Extension(name='apexpy.fortranapex',
sources=['src/fortranapex/magfld.f', 'src/fortranapex/apex.f',
'src/fortranapex/makeapexsh.f90', 'src/fortranapex/apexsh.f90',
'src/fortranapex/makeapexsh.f90',
'src/fortranapex/apexsh.f90',
'src/fortranapex/checkapexsh.f90'])]
else:
from setuptools import setup
Expand All @@ -39,13 +40,15 @@ def read(*names, **kwargs):
if __name__ == "__main__":
setup(
name='apexpy',
version='1.0.1',
version='1.0.2',
license='MIT',
description='A Python wrapper for Apex coordinates',
long_description='%s\n%s' % (read('README.rst'), re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst'))),
author='Christer van der Meeren',
author_email='[email protected]',
url='https://github.com/cmeeren/apexpy',
long_description='%s\n%s' % (read('README.rst'),
re.sub(':[a-z]+:`~?(.*?)`', r'``\1``',
read('CHANGELOG.rst'))),
author='Christer van der Meeren; Angeline G. Burrell',
author_email='[email protected]',
url='https://github.com/aburrell/apexpy',
packages=find_packages('src'),
package_dir={'': 'src'},
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
Expand All @@ -59,6 +62,7 @@ def read(*names, **kwargs):
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Operating System :: Macintosh :: Sierra',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
Expand Down
Loading

0 comments on commit 78d366e

Please sign in to comment.