Commit a3e66c5e authored by Ole Streicher's avatar Ole Streicher

New upstream version 1.2.1

parent 921e36b8
1.2.1(2016-11-07)
-----------------
- Make asdf conditionally dependent on the version of astropy to allow
running it with older versions of astropy. [#228]
1.2.0(2016-10-04)
-----------------
......
Metadata-Version: 1.0
Name: asdf
Version: 1.2.0
Version: 1.2.1
Summary: Python tools to handle ASDF files
Home-page: http://github.com/spacetelescope/asdf
Author: Erik Bray, Michael Droettboom
......
......@@ -8,3 +8,5 @@ from .compound import *
from .projections import *
from .polynomial import *
from .tabular import *
......@@ -10,6 +10,8 @@ except ImportError:
else:
HAS_ASTROPY = True
from astropy.modeling import mappings
from astropy.utils import minversion
ASTROPY_12 = minversion(astropy, "1.2")
from ...asdftypes import AsdfType
from ... import tagged
......@@ -51,9 +53,14 @@ class TransformType(AsdfType):
@classmethod
def _to_tree_base_transform_members(cls, model, node, ctx):
if getattr(model, '_user_inverse', None) is not None:
node['inverse'] = yamlutil.custom_tree_to_tagged_tree(
if ASTROPY_12:
if getattr(model, '_user_inverse', None) is not None:
node['inverse'] = yamlutil.custom_tree_to_tagged_tree(
model._user_inverse, ctx)
else:
if getattr(model, '_custom_inverse', None) is not None:
node['inverse'] = yamlutil.custom_tree_to_tagged_tree(
model._custom_inverse, ctx)
if model.name is not None:
node['name'] = model.name
......
......@@ -6,18 +6,31 @@ from __future__ import absolute_import, division, unicode_literals, print_functi
import numpy as np
from numpy.testing import assert_array_equal
from ... import yamlutil
from .basic import TransformType
__all__ = ['TabularType']
try:
import astropy
except ImportError:
HAS_ASTROPY = False
else:
HAS_ASTROPY = True
from astropy.utils import minversion
ASTROPY_13 = minversion(astropy, "1.3")
if HAS_ASTROPY and ASTROPY_13:
__all__ = ['TabularType']
else:
__all__ = []
class TabularType(TransformType):
import astropy
name = "transform/tabular"
types = [astropy.modeling.models.Tabular2D,
astropy.modeling.models.Tabular1D
]
if HAS_ASTROPY and ASTROPY_13:
types = [astropy.modeling.models.Tabular2D,
astropy.modeling.models.Tabular1D
]
else:
types = []
@classmethod
def from_tree_transform(cls, node, ctx):
......
......@@ -12,6 +12,8 @@ except ImportError:
test_models = []
else:
HAS_ASTROPY = True
from astropy.utils import minversion
ASTROPY_13 = minversion(astropy, "1.3")
from astropy.modeling import models as astmodels
test_models = [astmodels.Identity(2), astmodels.Polynomial1D(2, c0=1, c1=2, c2=3),
......@@ -131,6 +133,7 @@ def test_generic_projections(tmpdir):
@pytest.mark.skipif('not HAS_ASTROPY')
@pytest.mark.skipif('not ASTROPY_13')
def test_tabular_model(tmpdir):
points = np.arange(0, 5)
values = [1., 10, 2, 45, -3]
......
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2016-11-04 12:12:20.844448
# Autogenerated by Astropy-affiliated package asdf's setup.py on 2016-11-07 13:28:04.887470
from __future__ import unicode_literals
import datetime
......@@ -181,8 +181,8 @@ def _get_repo_path(pathname, levels=None):
return None
_packagename = "asdf"
_last_generated_version = "1.2.0"
_last_githash = "6da339b6d77c826c5aeaae1481594cf455edb98d"
_last_generated_version = "1.2.1"
_last_githash = "ec4f51e9df58ee949da4c44e7d61d734195f00a6"
# Determine where the source code for this module
# lives. If __file__ is not a filesystem path then
......@@ -200,10 +200,10 @@ else:
major = 1
minor = 2
bugfix = 0
bugfix = 1
release = True
timestamp = datetime.datetime(2016, 11, 4, 12, 12, 20, 844448)
timestamp = datetime.datetime(2016, 11, 7, 13, 28, 4, 887470)
debug = False
try:
......
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2016-11-04 11:34:20.823540
# Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2016-11-07 13:19:11.911401
from __future__ import unicode_literals
import datetime
......@@ -11,7 +11,7 @@ minor = 2
bugfix = 0
release = True
timestamp = datetime.datetime(2016, 11, 4, 11, 34, 20, 823540)
timestamp = datetime.datetime(2016, 11, 7, 13, 19, 11, 911401)
debug = False
try:
......
......@@ -51,7 +51,7 @@ LONG_DESCRIPTION = package.__doc__
builtins._PACKAGE_NAME_ = 'asdf'
# VERSION should be PEP386 compatible (http://www.python.org/dev/peps/pep-0386)
VERSION = '1.2.0'
VERSION = '1.2.1'
# Indicates if this version is a release version
RELEASE = 'dev' not in VERSION
......
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