Commit f1013b49 authored by Ole Streicher's avatar Ole Streicher

New upstream version 0.11.1

parent 4e3ee23c
Metadata-Version: 2.1
Name: poliastro
Version: 0.11.0
Version: 0.11.1
Summary: Python package for Orbital Mechanics
Home-page: https://blog.poliastro.space/
Author: Juan Luis Cano
......@@ -21,7 +21,7 @@ Description: .. poliastro
:Name: poliastro
:Website: https://poliastro.github.io/
:Author: Juan Luis Cano Rodríguez |orcid|
:Version: 0.11.0
:Version: 0.11.1
.. |circleci| image:: https://img.shields.io/circleci/project/github/poliastro/poliastro/0.11.x.svg?style=flat-square&logo=circleci
:target: https://circleci.com/gh/poliastro/poliastro
......@@ -38,8 +38,8 @@ Description: .. poliastro
.. |codeclimate| image:: https://api.codeclimate.com/v1/badges/fd2aa5bf8c4b7984d11b/maintainability
:target: https://codeclimate.com/github/poliastro/poliastro/maintainability
.. |docs| image:: https://img.shields.io/badge/docs-v0.11.0-brightgreen.svg?style=flat-square
:target: https://docs.poliastro.space/en/v0.11.0/?badge=v0.11.0
.. |docs| image:: https://img.shields.io/badge/docs-v0.11.1-brightgreen.svg?style=flat-square
:target: https://docs.poliastro.space/en/v0.11.1/?badge=v0.11.1
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://github.com/poliastro/poliastro/raw/0.11.x/COPYING
......@@ -85,7 +85,7 @@ Description: .. poliastro
Complete documentation, including a user guide and an API reference, can be read on
the wonderful `Read the Docs`_.
https://docs.poliastro.space/en/v0.11.0/
https://docs.poliastro.space/en/v0.11.1/
.. _`Read the Docs`: https://readthedocs.org/
......@@ -140,7 +140,7 @@ Description: .. poliastro
Please check out the `documentation for alternative installation methods`_.
.. _`documentation for alternative installation methods`: https://docs.poliastro.space/en/v0.11.0/getting_started.html#alternative-installation-methods
.. _`documentation for alternative installation methods`: https://docs.poliastro.space/en/v0.11.1/getting_started.html#alternative-installation-methods
Testing
=======
......@@ -231,7 +231,7 @@ Description: .. poliastro
* It leaves out certain features that would be too Earth-specific, such as
TLE reading, SGP4 propagation, groundtrack plotting and others.
.. _`Related software`: https://docs.poliastro.space/en/v0.11.0/about.html#related-software
.. _`Related software`: https://docs.poliastro.space/en/v0.11.1/about.html#related-software
What's the future of the project?
---------------------------------
......
......@@ -12,7 +12,7 @@
:Name: poliastro
:Website: https://poliastro.github.io/
:Author: Juan Luis Cano Rodríguez |orcid|
:Version: 0.11.0
:Version: 0.11.1
.. |circleci| image:: https://img.shields.io/circleci/project/github/poliastro/poliastro/0.11.x.svg?style=flat-square&logo=circleci
:target: https://circleci.com/gh/poliastro/poliastro
......@@ -29,8 +29,8 @@
.. |codeclimate| image:: https://api.codeclimate.com/v1/badges/fd2aa5bf8c4b7984d11b/maintainability
:target: https://codeclimate.com/github/poliastro/poliastro/maintainability
.. |docs| image:: https://img.shields.io/badge/docs-v0.11.0-brightgreen.svg?style=flat-square
:target: https://docs.poliastro.space/en/v0.11.0/?badge=v0.11.0
.. |docs| image:: https://img.shields.io/badge/docs-v0.11.1-brightgreen.svg?style=flat-square
:target: https://docs.poliastro.space/en/v0.11.1/?badge=v0.11.1
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://github.com/poliastro/poliastro/raw/0.11.x/COPYING
......@@ -76,7 +76,7 @@ Documentation
Complete documentation, including a user guide and an API reference, can be read on
the wonderful `Read the Docs`_.
https://docs.poliastro.space/en/v0.11.0/
https://docs.poliastro.space/en/v0.11.1/
.. _`Read the Docs`: https://readthedocs.org/
......@@ -131,7 +131,7 @@ install poliastro using `conda <http://conda.io>`_::
Please check out the `documentation for alternative installation methods`_.
.. _`documentation for alternative installation methods`: https://docs.poliastro.space/en/v0.11.0/getting_started.html#alternative-installation-methods
.. _`documentation for alternative installation methods`: https://docs.poliastro.space/en/v0.11.1/getting_started.html#alternative-installation-methods
Testing
=======
......@@ -222,7 +222,7 @@ poliastro is focused on interplanetary applications. This has two consequences:
* It leaves out certain features that would be too Earth-specific, such as
TLE reading, SGP4 propagation, groundtrack plotting and others.
.. _`Related software`: https://docs.poliastro.space/en/v0.11.0/about.html#related-software
.. _`Related software`: https://docs.poliastro.space/en/v0.11.1/about.html#related-software
What's the future of the project?
---------------------------------
......
What's new
==========
poliastro 0.11.1 - 2018-12-27
-----------------------------
This release fixes some bugs found in 0.11.0 and prepares the ground for bigger
API and code changes.
Bugs fixed
..........
* `Issue #281`_: Plotly graphs not showing in documentation
* `Issue #469`_: :code:`OrbitPlotter.set_frame` error
* `Issue #476`_: Error when representing orbits with no reference frame
* `Issue #482`_: Non deterministic legend layout
* `Issue #492`_: Better error for collinear orbits in Lambert and corner case arithmetic
.. _`Issue #281`: https://github.com/poliastro/poliastro/issues/281
.. _`Issue #469`: https://github.com/poliastro/poliastro/issues/469
.. _`Issue #476`: https://github.com/poliastro/poliastro/issues/476
.. _`Issue #482`: https://github.com/poliastro/poliastro/issues/482
.. _`Issue #492`: https://github.com/poliastro/poliastro/issues/492
Do you want to help with the remaining ones? Check the current list here!
https://github.com/poliastro/poliastro/issues?q=is%3Aopen+is%3Aissue+label%3Abug
Contributors
............
This is the complete list of the people that contributed to this release, with a + sign indicating first contribution.
* Juan Luis Cano
* Shreyas Bapat
* Ole Streicher+
* Antoniya Karpova+
poliastro 0.11.0 - 2018-09-21
-----------------------------
......
......@@ -68,7 +68,7 @@ copyright = u'2013-2018, Juan Luis Cano Rodríguez and the poliastro development
# The short X.Y version.
version = '0.11'
# The full version, including alpha/beta/rc tags.
release = '0.11.0'
release = '0.11.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -118,6 +118,15 @@ intersphinx_mapping = {
}
#Nbsphinx configuration
# See https://github.com/jupyter/nbconvert/issues/878#issuecomment-419655951
# Should not be needed after nbconvert 5.5 is out
nbsphinx_kernel_name = "python3"
def setup(app):
# https://docs.readthedocs.io/en/latest/guides/adding-custom-css.html
# https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_js_file
app.add_js_file('https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js')
if os.environ.get('READTHEDOCS') == 'True':
nbsphinx_execute = 'never'
else:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -17,7 +17,7 @@ ignore = E731,W504
max-line-length = 120
[flake8]
ignore = E731,W504
ignore = E731,W504,F401,F841
max-line-length = 120
[egg_info]
......
......@@ -44,8 +44,7 @@ setup(
"pytest-cov<2.6.0",
"pycodestyle",
"sphinx",
"sphinx_rtd_theme",
"nbconvert<5.4",
# "sphinx_rtd_theme", # Use https://github.com/Juanlu001/sphinx_rtd_theme/archive/js-head.zip
"nbsphinx",
"ipython>=5.0",
"jupyter-client",
......
Metadata-Version: 2.1
Name: poliastro
Version: 0.11.0
Version: 0.11.1
Summary: Python package for Orbital Mechanics
Home-page: https://blog.poliastro.space/
Author: Juan Luis Cano
......@@ -21,7 +21,7 @@ Description: .. poliastro
:Name: poliastro
:Website: https://poliastro.github.io/
:Author: Juan Luis Cano Rodríguez |orcid|
:Version: 0.11.0
:Version: 0.11.1
.. |circleci| image:: https://img.shields.io/circleci/project/github/poliastro/poliastro/0.11.x.svg?style=flat-square&logo=circleci
:target: https://circleci.com/gh/poliastro/poliastro
......@@ -38,8 +38,8 @@ Description: .. poliastro
.. |codeclimate| image:: https://api.codeclimate.com/v1/badges/fd2aa5bf8c4b7984d11b/maintainability
:target: https://codeclimate.com/github/poliastro/poliastro/maintainability
.. |docs| image:: https://img.shields.io/badge/docs-v0.11.0-brightgreen.svg?style=flat-square
:target: https://docs.poliastro.space/en/v0.11.0/?badge=v0.11.0
.. |docs| image:: https://img.shields.io/badge/docs-v0.11.1-brightgreen.svg?style=flat-square
:target: https://docs.poliastro.space/en/v0.11.1/?badge=v0.11.1
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://github.com/poliastro/poliastro/raw/0.11.x/COPYING
......@@ -85,7 +85,7 @@ Description: .. poliastro
Complete documentation, including a user guide and an API reference, can be read on
the wonderful `Read the Docs`_.
https://docs.poliastro.space/en/v0.11.0/
https://docs.poliastro.space/en/v0.11.1/
.. _`Read the Docs`: https://readthedocs.org/
......@@ -140,7 +140,7 @@ Description: .. poliastro
Please check out the `documentation for alternative installation methods`_.
.. _`documentation for alternative installation methods`: https://docs.poliastro.space/en/v0.11.0/getting_started.html#alternative-installation-methods
.. _`documentation for alternative installation methods`: https://docs.poliastro.space/en/v0.11.1/getting_started.html#alternative-installation-methods
Testing
=======
......@@ -231,7 +231,7 @@ Description: .. poliastro
* It leaves out certain features that would be too Earth-specific, such as
TLE reading, SGP4 propagation, groundtrack plotting and others.
.. _`Related software`: https://docs.poliastro.space/en/v0.11.0/about.html#related-software
.. _`Related software`: https://docs.poliastro.space/en/v0.11.1/about.html#related-software
What's the future of the project?
---------------------------------
......
......@@ -18,8 +18,6 @@ pytest
pytest-cov<2.6.0
pycodestyle
sphinx
sphinx_rtd_theme
nbconvert<5.4
nbsphinx
ipython>=5.0
jupyter-client
......
......@@ -7,4 +7,4 @@ Utilities and Python wrappers for Orbital Mechanics
"""
__version__ = '0.11.0'
__version__ = '0.11.1'
......@@ -77,6 +77,10 @@ def izzo(k, r1, r2, tof, M, numiter, rtol):
assert tof > 0
assert k > 0
# Check collinearity of r1 and r2
if np.all(cross(r1, r2) == 0):
raise ValueError("Lambert solution cannot be computed for collinear vectors")
# Chord
c = r2 - r1
c_norm, r1_norm, r2_norm = norm(c), norm(r1), norm(r2)
......@@ -90,7 +94,7 @@ def izzo(k, r1, r2, tof, M, numiter, rtol):
i_h = i_h / norm(i_h) # Fixed from paper
# Geometry of the problem
ll = np.sqrt(1 - c_norm / s)
ll = np.sqrt(1 - min(1.0, c_norm / s))
if i_h[2] < 0:
ll = -ll
......
......@@ -118,7 +118,7 @@ class OrbitPlotter(object):
def _redraw(self):
for artist in self.ax.lines + self.ax.collections:
artist.remove()
self._attractor_radius = None
self._attractor = None
for orbit, label in self._orbits:
self.plot(orbit, label)
self.ax.relim()
......@@ -140,7 +140,7 @@ class OrbitPlotter(object):
lines.append(a)
if label:
a.set_label(label)
self.ax.legend(bbox_to_anchor=(1.05, 1), title="Names and epochs")
self.ax.legend(loc="upper left", bbox_to_anchor=(1.05, 1.015), title="Names and epochs")
return lines
......@@ -206,7 +206,7 @@ class OrbitPlotter(object):
self.ax.figure.set_size_inches(size)
label = _generate_label(orbit, label)
l.set_label(label)
self.ax.legend(bbox_to_anchor=(1.05, 1), title="Names and epochs")
self.ax.legend(loc="upper left", bbox_to_anchor=(1.05, 1.015), title="Names and epochs")
self.ax.set_xlabel("$x$ (km)")
self.ax.set_ylabel("$y$ (km)")
......
......@@ -45,5 +45,5 @@ def test_inertial_body_centered_to_pqw():
molniya_peri = Orbit.from_vectors(bodies.Earth, molniya_r_peri, molniya_v_peri, molniya.epoch)
assert_quantity_allclose(molniya_peri.e_vec[-2:], [0, 0])
assert_quantity_allclose(molniya_peri.e_vec[-2:], [0, 0], atol=1e-12)
assert_quantity_allclose(norm(molniya_peri.e_vec), norm(molniya.e_vec))
......@@ -99,3 +99,16 @@ def test_raises_exception_for_non_feasible_solution(lambert):
next(lambert(k, r0, r, tof, M=1))
assert ("ValueError: No feasible solution, try lower M"
in excinfo.exconly())
@pytest.mark.parametrize("lambert", [izzo.lambert])
def test_collinear_vectors_input(lambert):
k = Earth.k
r0 = [22592.145603, -1599.915239, -19783.950506] * u.km
r = [22592.145603, -1599.915239, -19783.950506] * u.km
tof = 5 * u.h
with pytest.raises(ValueError) as excinfo:
next(lambert(k, r0, r, tof, M=0))
assert ("ValueError: Lambert solution cannot be computed for collinear vectors"
in excinfo.exconly())
......@@ -97,3 +97,9 @@ def test_dark_mode_plots_dark_plot():
assert op.ax.get_facecolor() == (0.0, 0.0, 0.0, 1.0)
op = OrbitPlotter()
assert op.ax.get_facecolor() == (1.0, 1.0, 1.0, 1)
def test_redraw_makes_attractor_none():
op = plot_solar_system()
op._redraw()
assert op._attractor_radius is not None
......@@ -12,7 +12,7 @@ from astropy.time import Time
from poliastro.bodies import (
Body,
Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto,
Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, Moon,
)
from poliastro.frames import (
Planes,
......@@ -167,6 +167,16 @@ def test_orbit_representation():
assert str(ss) == repr(ss) == expected_str
def test_orbit_no_frame_representation():
date_launch = Time('2011-11-26 15:02', scale='utc')
r = [61445.76498656, 24827.93010168, 0.] * u.km
v = [-0.42581645, -0.18867869, 0.] * u.km / u.s
ss = Orbit.from_vectors(Moon, r, v, date_launch)
expected_str = "106 x -142299 km x 180.0 deg orbit around Moon (\u263E) at epoch 2011-11-26 15:02:00.000 (UTC)"
assert str(ss) == repr(ss) == expected_str
def test_sample_numpoints():
_d = 1.0 * u.AU # Unused distance
_ = 0.5 * u.one # Unused dimensionless value
......
......@@ -29,6 +29,8 @@ from ._base import BaseState # flake8: noqa
ORBIT_FORMAT = "{r_p:.0f} x {r_a:.0f} x {inc:.1f} ({frame}) orbit around {body} at epoch {epoch} ({scale})"
# String representation for orbits around bodies without predefined reference frame
ORBIT_NO_FRAME_FORMAT = "{r_p:.0f} x {r_a:.0f} x {inc:.1f} orbit around {body} at epoch {epoch} ({scale})"
class TimeScaleWarning(UserWarning):
......@@ -354,12 +356,18 @@ class Orbit(object):
else:
unit = u.km
return ORBIT_FORMAT.format(
r_p=self.r_p.to(unit).value, r_a=self.r_a.to(unit), inc=self.inc.to(u.deg),
frame=self.frame.__class__.__name__,
body=self.attractor,
epoch=self.epoch, scale=self.epoch.scale.upper(),
)
try:
return ORBIT_FORMAT.format(
r_p=self.r_p.to(unit).value, r_a=self.r_a.to(unit), inc=self.inc.to(u.deg),
frame=self.frame.__class__.__name__,
body=self.attractor,
epoch=self.epoch, scale=self.epoch.scale.upper(),)
except NotImplementedError:
return ORBIT_NO_FRAME_FORMAT.format(
r_p=self.r_p.to(unit).value, r_a=self.r_a.to(unit), inc=self.inc.to(u.deg),
body=self.attractor,
epoch=self.epoch, scale=self.epoch.scale.upper(),
)
def __repr__(self):
return self.__str__()
......
Markdown is supported
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