Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 0.6.x branch for 0.6.1 release #228

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:
envs: |
- linux: py39-parallel-cov
- linux: py311-test-devdeps-parallel-cov
- linux: py39-astropylts-parallel-cov
- linux: py39-transformlts-parallel-cov
- linux: py312-test-predeps-parallel-cov
coverage: codecov

asdf-schemas:
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.6.1 (2024-04-05)
------------------

- update ``copy`` usage in ``Quantity`` converter to
deal with astropy 6.1 changes. [#224]

0.6.0 (2024-03-13)
------------------

Expand Down
8 changes: 7 additions & 1 deletion asdf_astropy/converters/unit/quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ def to_yaml_tree(self, obj, tag, ctx):
return node

def from_yaml_tree(self, node, tag, ctx):
# numpy 2.0 changed behavior for copy where an error is produced
# if False and a copy is required (previously there was no error)
# astropy 6.1 changed Quantity in a similar way
import numpy as np
from astropy.units import Quantity

copy = None if np.lib.NumpyVersion(np.__version__) >= "2.0.0b1" else False

value = node["value"]
dtype = node.get("datatype", None)
if isinstance(value, NDArrayType):
Expand All @@ -33,4 +39,4 @@ def from_yaml_tree(self, node, tag, ctx):
value = value._make_array()
dtype = value.dtype

return Quantity(value, unit=node["unit"], copy=False, dtype=dtype)
return Quantity(value, unit=node["unit"], copy=copy, dtype=dtype)
9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ envlist =
py{39,310}-test{,-alldeps}
py38-test-devdeps{,-numpydev}
py38-cov
py38-astropylts
py39-test-oldestdep-parallels-cov
requires =
setuptools >= 30.3.0
pip >= 19.3.1
isolated_build = true


[testenv]
description =
run tests
alldeps: with all optional dependencies
devdeps: with the latest developer version of key dependencies
cov: and test coverage
astropylts: with astropy LTS

setenv =
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple

pip_pre =
predeps: true
!predeps: false

# The following provides some specific pinnings for key packages
deps =
cov: coverage
astropylts: astropy==5.0.*
transformlts: asdf-transform-schemas==0.2.*

devdeps: -rrequirements-dev.txt
oldestdeps: minimum_dependencies
Expand Down
Loading