[Debian-astro-maintainers] Bug#976537: specutils: FTBFS: dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.8 3.9" returned exit code 13
Lucas Nussbaum
lucas at debian.org
Sat Dec 5 13:28:25 GMT 2020
Source: specutils
Version: 1.1-2
Severity: serious
Justification: FTBFS on arm64
Tags: bullseye sid ftbfs
Usertags: ftbfs-20201205 ftbfs-bullseye
Hi,
During a rebuild of all packages in sid, your package failed to build
on arm64 (I don't know if it also fails on amd64).
Relevant part (hopefully):
> dpkg-buildpackage
> -----------------
>
> Command: dpkg-buildpackage -us -uc -sa -rfakeroot
> dpkg-buildpackage: info: source package specutils
> dpkg-buildpackage: info: source version 1.1-2
> dpkg-buildpackage: info: source distribution unstable
> dpkg-buildpackage: info: source changed by Ole Streicher <olebole at debian.org>
> dpkg-source --before-build .
> dpkg-buildpackage: info: host architecture arm64
> debian/rules clean
> dh clean --with python3 --buildsystem=pybuild
> dh_auto_clean -O--buildsystem=pybuild
> I: pybuild base:232: python3.8 setup.py clean --use-system-astropy-helpers
> running clean
> removing '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build' (and everything under it)
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:161: AstropyDeprecationWarning: The package argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The package argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:166: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:171: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:186: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:239: AstropyDeprecationWarning: The packagename argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The packagename argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:244: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:249: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:264: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> 'build/bdist.linux-arm64' does not exist -- can't clean it
> 'build/scripts-3.8' does not exist -- can't clean it
> I: pybuild base:232: python3.9 setup.py clean --use-system-astropy-helpers
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:161: AstropyDeprecationWarning: The package argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The package argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:166: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:171: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:186: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:239: AstropyDeprecationWarning: The packagename argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The packagename argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:244: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:249: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:264: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> running clean
> removing '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build' (and everything under it)
> 'build/bdist.linux-arm64' does not exist -- can't clean it
> 'build/scripts-3.9' does not exist -- can't clean it
> dh_autoreconf_clean -O--buildsystem=pybuild
> dh_clean -O--buildsystem=pybuild
> dpkg-source -b .
> dpkg-source: info: using source format '3.0 (quilt)'
> dpkg-source: info: building specutils using existing ./specutils_1.1.orig.tar.gz
> dpkg-source: info: using patch list from debian/patches/series
> dpkg-source: warning: ignoring deletion of file specutils/version.py, use --include-removal to override
> dpkg-source: info: building specutils in specutils_1.1-2.debian.tar.xz
> dpkg-source: info: building specutils in specutils_1.1-2.dsc
> debian/rules binary
> dh binary --with python3 --buildsystem=pybuild
> dh_update_autotools_config -O--buildsystem=pybuild
> dh_autoreconf -O--buildsystem=pybuild
> dh_auto_configure -O--buildsystem=pybuild
> I: pybuild base:232: python3.8 setup.py config
> Download error on https://pypi.python.org/simple/astropy-helpers/: [Errno 111] Connection refused -- Some packages may not be found!
> Download error on https://pypi.python.org/simple/: [Errno 111] Connection refused -- Some packages may not be found!
> Freezing version number to ./specutils/version.py
> running config
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:163: AstropyDeprecationWarning: The package argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The package argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:168: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:173: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:188: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:242: AstropyDeprecationWarning: The packagename argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The packagename argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:247: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:252: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:267: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/git_helpers.py:114: UserWarning: Error running git: [Errno 2] No such file or directory: 'git'
> warnings.warn('Error running git: ' + str(e))
> I: pybuild base:232: python3.9 setup.py config
> Download error on https://pypi.python.org/simple/astropy-helpers/: [Errno 111] Connection refused -- Some packages may not be found!
> Download error on https://pypi.python.org/simple/: [Errno 111] Connection refused -- Some packages may not be found!
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:163: AstropyDeprecationWarning: The package argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The package argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:168: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:173: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/setup_helpers.py:188: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:242: AstropyDeprecationWarning: The packagename argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The packagename argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:247: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:252: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /<<PKGBUILDDIR>>/astropy_helpers/astropy_helpers/version_helpers.py:267: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> running config
> dh_auto_build -O--buildsystem=pybuild
> I: pybuild base:232: /usr/bin/python3.8 setup.py build --use-system-astropy-helpers
> running build
> running build_py
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils
> copying specutils/version.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils
> copying specutils/_astropy_init.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils
> copying specutils/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils
> copying specutils/conftest.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io
> copying specutils/io/parsing_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io
> copying specutils/io/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io
> copying specutils/io/_list_of_loaders.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io
> copying specutils/io/registers.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> copying specutils/spectra/spectrum_mixin.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> copying specutils/spectra/spectral_region.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> copying specutils/spectra/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> copying specutils/spectra/spectrum1d.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> copying specutils/spectra/spectrum_list.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> copying specutils/spectra/spectrum_collection.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> copying specutils/spectra/spectral_axis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/spectra
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/fitting
> copying specutils/fitting/continuum.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/fitting
> copying specutils/fitting/fitmodels.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/fitting
> copying specutils/fitting/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/fitting
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/utils
> copying specutils/utils/quantity_model.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/utils
> copying specutils/utils/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/utils
> copying specutils/utils/wcs_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/utils
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_manipulation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_spectrum1d.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_spectral_axis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_arithmetic.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_fitting.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_unc.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_smoothing.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_slicing.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/spectral_examples.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_io.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_analysis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_correlation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/setup_package.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_regions.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_region_extract.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/conftest.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_template_comparison.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_spectrum_collection.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_continuum.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_loaders.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> copying specutils/tests/test_resample.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/extern
> copying specutils/extern/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/extern
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/template_comparison.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/correlation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/location.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/flux.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/width.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> copying specutils/analysis/uncertainty.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> copying specutils/manipulation/estimate_uncertainty.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> copying specutils/manipulation/utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> copying specutils/manipulation/manipulation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> copying specutils/manipulation/smoothing.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> copying specutils/manipulation/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> copying specutils/manipulation/extract_spectral_region.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> copying specutils/manipulation/resample.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/hst_stis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/subaru_pfs_spec.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/muscles_sed.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/ascii.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/manga.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/generic_cube.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/hst_cos.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/sdss.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/jwst_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/twodfgrs_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/sixdfgs_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/apogee.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/wcs_fits.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/tabular_fits.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/generic_ecsv_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/twoslaq_lrg.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf
> copying specutils/io/asdf/extension.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf
> copying specutils/io/asdf/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf
> copying specutils/io/asdf/types.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders/tests
> copying specutils/io/default_loaders/tests/test_apogee.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders/tests
> copying specutils/io/default_loaders/tests/test_jwst_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders/tests
> copying specutils/io/default_loaders/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/default_loaders/tests
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf/tags
> copying specutils/io/asdf/tags/spectra.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf/tags
> copying specutils/io/asdf/tags/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf/tags
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf/tags/tests
> copying specutils/io/asdf/tags/tests/test_spectra.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf/tags/tests
> copying specutils/io/asdf/tags/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/io/asdf/tags/tests
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/extern/spectralcoord
> copying specutils/extern/spectralcoord/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/extern/spectralcoord
> copying specutils/extern/spectralcoord/spectral_quantity.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/extern/spectralcoord
> copying specutils/extern/spectralcoord/spectral_coordinate.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/extern/spectralcoord
> copying specutils/tests/coveragerc -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/tests
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:161: AstropyDeprecationWarning: The package argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The package argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:166: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:171: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:186: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:239: AstropyDeprecationWarning: The packagename argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The packagename argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:244: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:249: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:264: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> I: pybuild base:232: /usr/bin/python3 setup.py build --use-system-astropy-helpers
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:161: AstropyDeprecationWarning: The package argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The package argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:166: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:171: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/setup_helpers.py:186: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:239: AstropyDeprecationWarning: The packagename argument to generate_version_py has been deprecated and will be removed in future. Specify the package name in setup.cfg instead
> warnings.warn('The packagename argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:244: AstropyDeprecationWarning: The version argument to generate_version_py has been deprecated and will be removed in future. Specify the version number in setup.cfg instead
> warnings.warn('The version argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:249: AstropyDeprecationWarning: The release argument to generate_version_py has been deprecated and will be removed in future. We now use the presence of the "dev" string in the version to determine whether this is a release
> warnings.warn('The release argument to generate_version_py has '
> /usr/lib/python3/dist-packages/astropy_helpers/version_helpers.py:264: AstropyDeprecationWarning: Specifying the package name using the "package_name" option in setup.cfg is deprecated - use the "name" option instead.
> warnings.warn('Specifying the package name using the "package_name" '
> running build
> running build_py
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils
> copying specutils/version.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils
> copying specutils/_astropy_init.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils
> copying specutils/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils
> copying specutils/conftest.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io
> copying specutils/io/parsing_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io
> copying specutils/io/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io
> copying specutils/io/_list_of_loaders.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io
> copying specutils/io/registers.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> copying specutils/spectra/spectrum_mixin.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> copying specutils/spectra/spectral_region.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> copying specutils/spectra/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> copying specutils/spectra/spectrum1d.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> copying specutils/spectra/spectrum_list.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> copying specutils/spectra/spectrum_collection.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> copying specutils/spectra/spectral_axis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/spectra
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/fitting
> copying specutils/fitting/continuum.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/fitting
> copying specutils/fitting/fitmodels.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/fitting
> copying specutils/fitting/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/fitting
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/utils
> copying specutils/utils/quantity_model.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/utils
> copying specutils/utils/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/utils
> copying specutils/utils/wcs_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/utils
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_manipulation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_spectrum1d.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_spectral_axis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_arithmetic.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_fitting.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_unc.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_smoothing.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_slicing.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/spectral_examples.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_io.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_analysis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_correlation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/setup_package.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_regions.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_region_extract.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/conftest.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_template_comparison.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_spectrum_collection.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_continuum.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_loaders.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> copying specutils/tests/test_resample.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/extern
> copying specutils/extern/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/extern
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/template_comparison.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/correlation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/location.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/flux.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/width.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> copying specutils/analysis/uncertainty.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> copying specutils/manipulation/estimate_uncertainty.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> copying specutils/manipulation/utils.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> copying specutils/manipulation/manipulation.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> copying specutils/manipulation/smoothing.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> copying specutils/manipulation/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> copying specutils/manipulation/extract_spectral_region.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> copying specutils/manipulation/resample.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/hst_stis.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/subaru_pfs_spec.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/muscles_sed.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/ascii.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/manga.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/generic_cube.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/hst_cos.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/sdss.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/jwst_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/twodfgrs_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/sixdfgs_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/apogee.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/wcs_fits.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/tabular_fits.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/generic_ecsv_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> copying specutils/io/default_loaders/twoslaq_lrg.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf
> copying specutils/io/asdf/extension.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf
> copying specutils/io/asdf/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf
> copying specutils/io/asdf/types.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders/tests
> copying specutils/io/default_loaders/tests/test_apogee.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders/tests
> copying specutils/io/default_loaders/tests/test_jwst_reader.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders/tests
> copying specutils/io/default_loaders/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/default_loaders/tests
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf/tags
> copying specutils/io/asdf/tags/spectra.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf/tags
> copying specutils/io/asdf/tags/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf/tags
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf/tags/tests
> copying specutils/io/asdf/tags/tests/test_spectra.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf/tags/tests
> copying specutils/io/asdf/tags/tests/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/io/asdf/tags/tests
> creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/extern/spectralcoord
> copying specutils/extern/spectralcoord/__init__.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/extern/spectralcoord
> copying specutils/extern/spectralcoord/spectral_quantity.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/extern/spectralcoord
> copying specutils/extern/spectralcoord/spectral_coordinate.py -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/extern/spectralcoord
> copying specutils/tests/coveragerc -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/tests
> dh_auto_test -O--buildsystem=pybuild
> I: pybuild base:232: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build; python3.8 -m pytest --remote-data=none --doctest-rst
> ============================= test session starts ==============================
> platform linux -- Python 3.8.6, pytest-4.6.11, py-1.9.0, pluggy-0.13.0
> rootdir: /<<PKGBUILDDIR>>, inifile: setup.cfg
> plugins: cov-2.8.1, asdf-2.7.1, arraydiff-0.3, astropy-header-0.1.2, doctestplus-0.7.0, filter-subpackage-0.1.1, remotedata-0.3.2, openfiles-0.5.0, hypothesis-5.41.2
> collected 356 items
>
> specutils/io/asdf/tags/tests/test_spectra.py xxxx. [ 1%]
> specutils/io/default_loaders/tests/test_apogee.py sss [ 2%]
> specutils/io/default_loaders/tests/test_jwst_reader.py ..........sss [ 5%]
> specutils/manipulation/resample.py ... [ 6%]
> specutils/tests/test_analysis.py ....................................... [ 17%]
> .. [ 18%]
> specutils/tests/test_arithmetic.py ......... [ 20%]
> specutils/tests/test_continuum.py ....... [ 22%]
> specutils/tests/test_correlation.py .... [ 23%]
> specutils/tests/test_fitting.py ..................... [ 29%]
> specutils/tests/test_io.py ..... [ 31%]
> specutils/tests/test_loaders.py .ssss.ssssssssssssss...ssssss........... [ 42%]
> ............ssssssssssssss [ 49%]
> specutils/tests/test_manipulation.py ... [ 50%]
> specutils/tests/test_region_extract.py ......... [ 53%]
> specutils/tests/test_regions.py ......... [ 55%]
> specutils/tests/test_resample.py ..............x..... [ 61%]
> specutils/tests/test_slicing.py .... [ 62%]
> specutils/tests/test_smoothing.py FFF...FF...FF.......... [ 68%]
> specutils/tests/test_spectral_axis.py .................................. [ 78%]
> .................. [ 83%]
> specutils/tests/test_spectrum1d.py .................s..... [ 89%]
> specutils/tests/test_spectrum_collection.py ......... [ 92%]
> specutils/tests/test_template_comparison.py ........... [ 95%]
> specutils/tests/test_unc.py .x. [ 96%]
> specutils/tests/test_utils.py ............. [100%]
>
> =================================== FAILURES ===================================
> __________________________ test_smooth_custom_kernel ___________________________
>
> self = <Quantity [1131.01333332, 1366.39097043, 1380.73344458, 1315.70807832,
> 1218.18529306, 1225.68833337, 1264.9...557.36062977, 1565.6571005 , 1519.2402814 ,
> 1489.30273208, 1434.86908964, 1202.1970936 , 874.83988599] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff96e5a2b0>
>
> def test_smooth_custom_kernel(simulated_spectra):
> """
> Test CustomKernel smoothing with correct parmaeters.
> """
>
> # Create the original spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Create a custom kernel (some weird asymmetric-ness)
> numpy_kernel = np.array([0.5, 1, 2, 0.5, 0.2])
> numpy_kernel = numpy_kernel / np.sum(numpy_kernel)
>
> custom_kernel = convolution.CustomKernel(numpy_kernel)
> flux_smoothed_astropy = convolution.convolve(flux_original, custom_kernel)
>
> # Calculate the custom smoothed
> spec1_smoothed = convolution_smooth(spec1, custom_kernel)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:58:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> ___________________________ test_smooth_box_good[1] ____________________________
>
> self = <Quantity [1269.81604754, 1502.25541953, 1416.73697066, 1365.37248459,
> 1190.28624406, 1192.24629298, 1155.0...527.69269721, 1613.53838713, 1504.63945067,
> 1518.18404084, 1482.0770134 , 1323.19795373, 1358.1565708 ] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff96d3d640>
> width = 1
>
> @pytest.mark.parametrize("width", [1, 2.3])
> def test_smooth_box_good(simulated_spectra, width):
> """
> Test Box1DKernel smoothing with correct parmaeters.
>
> Width values need to be a number greater than 0.
> """
>
> # Create the original spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> box_kernel = convolution.Box1DKernel(width)
> flux_smoothed_astropy = convolution.convolve(flux_original, box_kernel)
>
> # Calculate the box smoothed
> spec1_smoothed = box_smooth(spec1, width)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:79:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> __________________________ test_smooth_box_good[2.3] ___________________________
>
> self = <Quantity [1010.47187865, 1422.76596432, 1425.27546136, 1334.44204597,
> 1234.54781642, 1182.45761418, 1245.6...568.61248055, 1564.85223054, 1535.25033233,
> 1505.77113644, 1451.38400534, 1371.65737291, 1009.87777383] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff96d65670>
> width = 2.3
>
> @pytest.mark.parametrize("width", [1, 2.3])
> def test_smooth_box_good(simulated_spectra, width):
> """
> Test Box1DKernel smoothing with correct parmaeters.
>
> Width values need to be a number greater than 0.
> """
>
> # Create the original spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> box_kernel = convolution.Box1DKernel(width)
> flux_smoothed_astropy = convolution.convolve(flux_original, box_kernel)
>
> # Calculate the box smoothed
> spec1_smoothed = box_smooth(spec1, width)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:79:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> _________________________ test_smooth_gaussian_good[1] _________________________
>
> self = <Quantity [ 952.78940003, 1328.53684936, 1397.34417997, 1331.95557926,
> 1246.15360935, 1209.55162516, 1258.7...568.25972393, 1560.04895519, 1533.9278687 ,
> 1499.93196811, 1440.71927016, 1303.98937136, 948.95257333] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff96e61130>
> stddev = 1
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_gaussian_good(simulated_spectra, stddev):
> """
> Test Gaussian1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> gaussian_kernel = convolution.Gaussian1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, gaussian_kernel)
>
> # Test gaussian smoothing
> spec1_smoothed = gaussian_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value, rtol=0.02)
>
> specutils/tests/test_smoothing.py:119:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> ________________________ test_smooth_gaussian_good[2.3] ________________________
>
> self = <Quantity [ 801.70374785, 1011.0102985 , 1158.29014523, 1238.11922915,
> 1271.00948456, 1285.23574021, 1299.6...534.36252206, 1518.20849916, 1476.51079901,
> 1395.86639817, 1262.06995395, 1068.91985306, 829.19665989] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff96caaf10>
> stddev = 2.3
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_gaussian_good(simulated_spectra, stddev):
> """
> Test Gaussian1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> gaussian_kernel = convolution.Gaussian1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, gaussian_kernel)
>
> # Test gaussian smoothing
> spec1_smoothed = gaussian_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value, rtol=0.02)
>
> specutils/tests/test_smoothing.py:119:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> ________________________ test_smooth_trapezoid_good[1] _________________________
>
> self = <Quantity [1010.47187865, 1422.76596432, 1425.27546136, 1334.44204597,
> 1234.54781642, 1182.45761418, 1245.6...568.61248055, 1564.85223054, 1535.25033233,
> 1505.77113644, 1451.38400534, 1371.65737291, 1009.87777383] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff975826d0>
> stddev = 1
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_trapezoid_good(simulated_spectra, stddev):
> """
> Test Trapezoid1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Create the flux_smoothed which is what we want to compare to
> trapezoid_kernel = convolution.Trapezoid1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, trapezoid_kernel)
>
> # Test trapezoid smoothing
> spec1_smoothed = trapezoid_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:160:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> _______________________ test_smooth_trapezoid_good[2.3] ________________________
>
> self = <Quantity [ 904.41879172, 1331.39827589, 1410.11521773, 1326.23362309,
> 1252.62827613, 1201.34205666, 1276.5...578.82854348, 1549.8263825 , 1541.76585916,
> 1498.60938062, 1440.26618521, 1330.65428608, 879.89881107] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff96e618e0>
> stddev = 2.3
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_trapezoid_good(simulated_spectra, stddev):
> """
> Test Trapezoid1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Create the flux_smoothed which is what we want to compare to
> trapezoid_kernel = convolution.Trapezoid1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, trapezoid_kernel)
>
> # Test trapezoid smoothing
> spec1_smoothed = trapezoid_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:160:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> =============================== warnings summary ===============================
> /usr/lib/python3/dist-packages/astropy/tests/plugins/display.py:16
> /usr/lib/python3/dist-packages/astropy/tests/plugins/display.py:16: AstropyDeprecationWarning: The astropy.tests.plugins.display plugin has been deprecated. See the pytest-astropy-header documentation for information on migrating to using pytest-astropy-header to customize the pytest header.
> warnings.warn('The astropy.tests.plugins.display plugin has been deprecated. '
>
> /usr/lib/python3/dist-packages/astropy/coordinates/baseframe.py:1207
> /usr/lib/python3/dist-packages/astropy/coordinates/baseframe.py:1207: AstropyDeprecationWarning: Transforming a frame instance to a frame class (as opposed to another frame instance) will not be supported in the future. Either explicitly instantiate the target frame, or first convert the source frame instance to a `astropy.coordinates.SkyCoord` and use its `transform_to()` method.
> warnings.warn("Transforming a frame instance to a frame class (as opposed to another "
>
> .pybuild/cpython3_3.8/build/specutils/manipulation/resample.py::specutils.manipulation.resample.FluxConservingResampler
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_line_flux_masked
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_equivalent_width_masked
> .pybuild/cpython3_3.8/build/specutils/tests/test_correlation.py::test_autocorrelation
> .pybuild/cpython3_3.8/build/specutils/tests/test_correlation.py::test_correlation
> .pybuild/cpython3_3.8/build/specutils/tests/test_correlation.py::test_correlation_zero_padding
> .pybuild/cpython3_3.8/build/specutils/tests/test_correlation.py::test_correlation_random_lines
> .pybuild/cpython3_3.8/build/specutils/tests/test_resample.py::test_expanded_grid_fluxconserving
> .pybuild/cpython3_3.8/build/specutils/tests/test_resample.py::test_resample_edges[FluxConservingResampler-nan_fill-nan]
> .pybuild/cpython3_3.8/build/specutils/tests/test_resample.py::test_resample_edges[FluxConservingResampler-zero_fill-0]
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_match_no_overlap
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_match_minimal_overlap
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_unknown_redshift
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_one_template_spectrum_in_match
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_multiple_template_spectra_in_match
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:477: RuntimeWarning: invalid value encountered in true_divide
> result = super().__array_ufunc__(function, method, *arrays, **kwargs)
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_equivalent_width_regions
> /usr/lib/python3/dist-packages/scipy/interpolate/interpolate.py:2532: RuntimeWarning: invalid value encountered in true_divide
> norm_distances.append((x - grid[i]) /
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width_masked
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width_regions
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width_multi_spectrum
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_fwhm
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_masked
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[5]
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[6]
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[7]
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_fwhm_masked
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_fwhm
> .pybuild/cpython3_3.8/build/specutils/tests/test_analysis.py::test_fwhm_multi_spectrum
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectrum1d.py::test_create_from_multidimensional_arrays
> /usr/lib/python3/dist-packages/astropy/units/equivalencies.py:125: RuntimeWarning: divide by zero encountered in true_divide
> (si.m, si.Hz, lambda x: _si.c.value / x),
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_continuum.py::test_continuum_fit
> .pybuild/cpython3_3.8/build/specutils/tests/test_continuum.py::test_continuum_calculation
> .pybuild/cpython3_3.8/build/specutils/tests/test_continuum.py::test_continuum_full_window
> .pybuild/cpython3_3.8/build/specutils/tests/test_continuum.py::test_continuum_spectral_region
> .pybuild/cpython3_3.8/build/specutils/tests/test_continuum.py::test_continuum_window_no_noise
> .pybuild/cpython3_3.8/build/specutils/tests/test_continuum.py::test_double_continuum_window
> .pybuild/cpython3_3.8/build/specutils/tests/test_continuum.py::test_double_continuum_window_alternate
> /usr/lib/python3/dist-packages/astropy/modeling/fitting.py:1708: AstropyUserWarning: Model is linear in parameters; consider using linear fitting methods.
> warnings.warn('Model is linear in parameters; '
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_fitting.py::test_find_lines_derivative
> .pybuild/cpython3_3.8/build/specutils/tests/test_fitting.py::test_find_lines_threshold
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/analysis/flux.py:272: AstropyUserWarning: Spectrum is not below the threshold signal-to-noise 0.01. This may indicate you have not continuum subtracted this spectrum (or that you have but it has high SNR features).
>
> If you want to suppress this warning either type 'specutils.conf.do_continuum_function_check = False' or see http://docs.astropy.org/en/stable/config/#adding-new-configuration-items for other ways to configure the warning.
> warnings.warn(message, AstropyUserWarning)
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_fitting.py::test_fit_subspectrum
> /usr/lib/python3/dist-packages/astropy/modeling/fitting.py:1166: AstropyUserWarning: The fit may be unsuccessful; check fit_info['message'] for more information.
> warnings.warn("The fit may be unsuccessful; check "
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_region_extract.py::test_linear_excise_invert_from_spectrum
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation/utils.py:119: AstropyUserWarning: A SpectralRegion with multiple subregions was provided as input. This may lead to undesired behavior with linear_exciser if the subregions overlap.
> warnings.warn("A SpectralRegion with multiple subregions was provided as "
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_spectral_axis
> /usr/lib/python3/dist-packages/astropy/utils/iers/iers.py:676: AstropyWarning: failed to download ftp://anonymous:mail%40astropy.org@gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all and https://datacenter.iers.org/data/9/finals2000A.all, using local IERS-B: <urlopen error Unable to open any source! Exceptions were {'ftp://anonymous:mail%40astropy.org@gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all': URLError("ftp error: OSError('An attempt was made to connect to the internet by a test that was not marked `remote_data`. The requested host was: 198.118.242.43')"), 'https://datacenter.iers.org/data/9/finals2000A.all': URLError(ConnectionRefusedError(111, 'Connection refused'))}>
> warn(AstropyWarning(
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target4]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target1]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target2]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target3]
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target4]
> /usr/lib/python3/dist-packages/astropy/coordinates/spectral_coordinate.py:292: NoVelocityWarning: No velocity defined on frame, assuming (0., 0., 0.) km / s.
> warnings.warn(
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_spectrum1d.py::test_wcs_transformations
> /usr/lib/python3/dist-packages/astropy/wcs/wcsapi/fitswcs.py:545: AstropyUserWarning: No observer defined on WCS, SpectralCoord will be converted without any velocity frame change
> warnings.warn('No observer defined on WCS, SpectralCoord '
>
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_match_no_overlap
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_match_minimal_overlap
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_unknown_redshift
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_one_template_spectrum_in_match
> .pybuild/cpython3_3.8/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_multiple_template_spectra_in_match
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/specutils/manipulation/resample.py:202: RuntimeWarning: invalid value encountered in true_divide
> out_variance = np.sum(pixel_uncer * resample_grid**2, axis=-1) / np.sum(
>
> -- Docs: https://docs.pytest.org/en/latest/warnings.html
> == 7 failed, 298 passed, 45 skipped, 6 xfailed, 91 warnings in 27.68 seconds ===
> E: pybuild pybuild:353: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build; python3.8 -m pytest --remote-data=none --doctest-rst
> I: pybuild base:232: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest --remote-data=none --doctest-rst
> ============================= test session starts ==============================
> platform linux -- Python 3.9.1rc1, pytest-4.6.11, py-1.9.0, pluggy-0.13.0
> rootdir: /<<PKGBUILDDIR>>, inifile: setup.cfg
> plugins: cov-2.8.1, asdf-2.7.1, arraydiff-0.3, astropy-header-0.1.2, doctestplus-0.7.0, filter-subpackage-0.1.1, remotedata-0.3.2, openfiles-0.5.0, hypothesis-5.41.2
> collected 356 items
>
> specutils/io/asdf/tags/tests/test_spectra.py xxxx. [ 1%]
> specutils/io/default_loaders/tests/test_apogee.py sss [ 2%]
> specutils/io/default_loaders/tests/test_jwst_reader.py ..........sss [ 5%]
> specutils/manipulation/resample.py ... [ 6%]
> specutils/tests/test_analysis.py ....................................... [ 17%]
> .. [ 18%]
> specutils/tests/test_arithmetic.py ......... [ 20%]
> specutils/tests/test_continuum.py ....... [ 22%]
> specutils/tests/test_correlation.py .... [ 23%]
> specutils/tests/test_fitting.py ..................... [ 29%]
> specutils/tests/test_io.py ..... [ 31%]
> specutils/tests/test_loaders.py .ssss.ssssssssssssss...ssssss........... [ 42%]
> ............ssssssssssssss [ 49%]
> specutils/tests/test_manipulation.py ... [ 50%]
> specutils/tests/test_region_extract.py ......... [ 53%]
> specutils/tests/test_regions.py ......... [ 55%]
> specutils/tests/test_resample.py ..............x..... [ 61%]
> specutils/tests/test_slicing.py .... [ 62%]
> specutils/tests/test_smoothing.py FFF...FF...FF.......... [ 68%]
> specutils/tests/test_spectral_axis.py .................................. [ 78%]
> .................. [ 83%]
> specutils/tests/test_spectrum1d.py .................s..... [ 89%]
> specutils/tests/test_spectrum_collection.py ......... [ 92%]
> specutils/tests/test_template_comparison.py ........... [ 95%]
> specutils/tests/test_unc.py .x. [ 96%]
> specutils/tests/test_utils.py ............. [100%]
>
> =================================== FAILURES ===================================
> __________________________ test_smooth_custom_kernel ___________________________
>
> self = <Quantity [1131.01333332, 1366.39097043, 1380.73344458, 1315.70807832,
> 1218.18529306, 1225.68833337, 1264.9...557.36062977, 1565.6571005 , 1519.2402814 ,
> 1489.30273208, 1434.86908964, 1202.1970936 , 874.83988599] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff99e829a0>
>
> def test_smooth_custom_kernel(simulated_spectra):
> """
> Test CustomKernel smoothing with correct parmaeters.
> """
>
> # Create the original spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Create a custom kernel (some weird asymmetric-ness)
> numpy_kernel = np.array([0.5, 1, 2, 0.5, 0.2])
> numpy_kernel = numpy_kernel / np.sum(numpy_kernel)
>
> custom_kernel = convolution.CustomKernel(numpy_kernel)
> flux_smoothed_astropy = convolution.convolve(flux_original, custom_kernel)
>
> # Calculate the custom smoothed
> spec1_smoothed = convolution_smooth(spec1, custom_kernel)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:58:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> ___________________________ test_smooth_box_good[1] ____________________________
>
> self = <Quantity [1269.81604754, 1502.25541953, 1416.73697066, 1365.37248459,
> 1190.28624406, 1192.24629298, 1155.0...527.69269721, 1613.53838713, 1504.63945067,
> 1518.18404084, 1482.0770134 , 1323.19795373, 1358.1565708 ] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff997f94c0>
> width = 1
>
> @pytest.mark.parametrize("width", [1, 2.3])
> def test_smooth_box_good(simulated_spectra, width):
> """
> Test Box1DKernel smoothing with correct parmaeters.
>
> Width values need to be a number greater than 0.
> """
>
> # Create the original spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> box_kernel = convolution.Box1DKernel(width)
> flux_smoothed_astropy = convolution.convolve(flux_original, box_kernel)
>
> # Calculate the box smoothed
> spec1_smoothed = box_smooth(spec1, width)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:79:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> __________________________ test_smooth_box_good[2.3] ___________________________
>
> self = <Quantity [1010.47187865, 1422.76596432, 1425.27546136, 1334.44204597,
> 1234.54781642, 1182.45761418, 1245.6...568.61248055, 1564.85223054, 1535.25033233,
> 1505.77113644, 1451.38400534, 1371.65737291, 1009.87777383] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff993199a0>
> width = 2.3
>
> @pytest.mark.parametrize("width", [1, 2.3])
> def test_smooth_box_good(simulated_spectra, width):
> """
> Test Box1DKernel smoothing with correct parmaeters.
>
> Width values need to be a number greater than 0.
> """
>
> # Create the original spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> box_kernel = convolution.Box1DKernel(width)
> flux_smoothed_astropy = convolution.convolve(flux_original, box_kernel)
>
> # Calculate the box smoothed
> spec1_smoothed = box_smooth(spec1, width)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:79:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> _________________________ test_smooth_gaussian_good[1] _________________________
>
> self = <Quantity [ 952.78940003, 1328.53684936, 1397.34417997, 1331.95557926,
> 1246.15360935, 1209.55162516, 1258.7...568.25972393, 1560.04895519, 1533.9278687 ,
> 1499.93196811, 1440.71927016, 1303.98937136, 948.95257333] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff99cba2e0>
> stddev = 1
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_gaussian_good(simulated_spectra, stddev):
> """
> Test Gaussian1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> gaussian_kernel = convolution.Gaussian1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, gaussian_kernel)
>
> # Test gaussian smoothing
> spec1_smoothed = gaussian_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value, rtol=0.02)
>
> specutils/tests/test_smoothing.py:119:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> ________________________ test_smooth_gaussian_good[2.3] ________________________
>
> self = <Quantity [ 801.70374785, 1011.0102985 , 1158.29014523, 1238.11922915,
> 1271.00948456, 1285.23574021, 1299.6...534.36252206, 1518.20849916, 1476.51079901,
> 1395.86639817, 1262.06995395, 1068.91985306, 829.19665989] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff99308af0>
> stddev = 2.3
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_gaussian_good(simulated_spectra, stddev):
> """
> Test Gaussian1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Calculate the smoothed flux using Astropy
> gaussian_kernel = convolution.Gaussian1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, gaussian_kernel)
>
> # Test gaussian smoothing
> spec1_smoothed = gaussian_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value, rtol=0.02)
>
> specutils/tests/test_smoothing.py:119:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> ________________________ test_smooth_trapezoid_good[1] _________________________
>
> self = <Quantity [1010.47187865, 1422.76596432, 1425.27546136, 1334.44204597,
> 1234.54781642, 1182.45761418, 1245.6...568.61248055, 1564.85223054, 1535.25033233,
> 1505.77113644, 1451.38400534, 1371.65737291, 1009.87777383] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff997ebd00>
> stddev = 1
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_trapezoid_good(simulated_spectra, stddev):
> """
> Test Trapezoid1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Create the flux_smoothed which is what we want to compare to
> trapezoid_kernel = convolution.Trapezoid1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, trapezoid_kernel)
>
> # Test trapezoid smoothing
> spec1_smoothed = trapezoid_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:160:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> _______________________ test_smooth_trapezoid_good[2.3] ________________________
>
> self = <Quantity [ 904.41879172, 1331.39827589, 1410.11521773, 1326.23362309,
> 1252.62827613, 1201.34205666, 1276.5...578.82854348, 1549.8263825 , 1541.76585916,
> 1498.60938062, 1440.26618521, 1330.65428608, 879.89881107] mJy>
> unit = Unit(dimensionless), equivalencies = []
>
> def to_value(self, unit=None, equivalencies=[]):
> """
> The numerical value, possibly in a different unit.
>
> Parameters
> ----------
> unit : `~astropy.units.UnitBase` instance or str, optional
> The unit in which the value should be given. If not given or `None`,
> use the current unit.
>
> equivalencies : list of equivalence pairs, optional
> A list of equivalence pairs to try if the units are not directly
> convertible (see :ref:`unit_equivalencies`). If not provided or
> ``[]``, class default equivalencies will be used (none for
> `~astropy.units.Quantity`, but may be set for subclasses).
> If `None`, no equivalencies will be applied at all, not even any
> set globally or within a context.
>
> Returns
> -------
> value : `~numpy.ndarray` or scalar
> The value in the units specified. For arrays, this will be a view
> of the data if no unit conversion was necessary.
>
> See also
> --------
> to : Get a new instance in a different unit.
> """
> if unit is None or unit is self.unit:
> value = self.view(np.ndarray)
> else:
> unit = Unit(unit)
> # We want a view if the unit does not change. One could check
> # with "==", but that calculates the scale that we need anyway.
> # TODO: would be better for `unit.to` to have an in-place flag.
> try:
> > scale = self.unit._to(unit)
>
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:738:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), other = Unit(dimensionless)
>
> def _to(self, other):
> """
> Returns the scale to the specified unit.
>
> See `to`, except that a Unit object should be given (i.e., no
> string), and that all defaults are used, i.e., no
> equivalencies and value=1.
> """
> # There are many cases where we just want to ensure a Quantity is
> # of a particular unit, without checking whether it's already in
> # a particular unit. If we're being asked to convert from a unit
> # to itself, we can short-circuit all of this.
> if self is other:
> return 1.0
>
> # Don't presume decomposition is possible; e.g.,
> # conversion to function units is through equivalencies.
> if isinstance(other, UnitBase):
> self_decomposed = self.decompose()
> other_decomposed = other.decompose()
>
> # Check quickly whether equivalent. This is faster than
> # `is_equivalent`, because it doesn't generate the entire
> # physical type list of both units. In other words it "fails
> # fast".
> if(self_decomposed.powers == other_decomposed.powers and
> all(self_base is other_base for (self_base, other_base)
> in zip(self_decomposed.bases, other_decomposed.bases))):
> return self_decomposed.scale / other_decomposed.scale
>
> > raise UnitConversionError(
> f"'{self!r}' is not a scaled version of '{other!r}'")
> E astropy.units.core.UnitConversionError: 'Unit("mJy")' is not a scaled version of 'Unit(dimensionless)'
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:950: UnitConversionError
>
> During handling of the above exception, another exception occurred:
>
> simulated_spectra = <specutils.tests.spectral_examples.SpectraExamples object at 0xffff9953eb50>
> stddev = 2.3
>
> @pytest.mark.parametrize("stddev", [1, 2.3])
> def test_smooth_trapezoid_good(simulated_spectra, stddev):
> """
> Test Trapezoid1DKernel smoothing with correct parmaeters.
>
> Standard deviation values need to be a number greater than 0.
> """
>
> # Create the spectrum
> spec1 = simulated_spectra.s1_um_mJy_e1
> flux_original = spec1.flux
>
> # Create the flux_smoothed which is what we want to compare to
> trapezoid_kernel = convolution.Trapezoid1DKernel(stddev)
> flux_smoothed_astropy = convolution.convolve(flux_original, trapezoid_kernel)
>
> # Test trapezoid smoothing
> spec1_smoothed = trapezoid_smooth(spec1, stddev)
> > compare_flux(spec1_smoothed.flux.value, flux_smoothed_astropy, flux_original.value)
>
> specutils/tests/test_smoothing.py:160:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> specutils/tests/test_smoothing.py:34: in compare_flux
> assert np.allclose(flux_smooth1, flux_smooth2)
> <__array_function__ internals>:5: in allclose
> ???
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1509: in __array_function__
> args, kwargs, unit, out = function_helper(*args, **kwargs)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:545: in close
> (a, b), unit = _quantities2arrays(a, b, unit_from_first=True)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in _quantities2arrays
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity_helper/function_helpers.py:345: in <genexpr>
> arrays = tuple((q._to_own_unit(arg)) for arg in args)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:1339: in _to_own_unit
> _value = value.to_value(self.unit)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:741: in to_value
> value = self._to_value(unit, equivalencies)
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:660: in _to_value
> return self.unit.to(unit, self.view(np.ndarray),
> /usr/lib/python3/dist-packages/astropy/units/core.py:987: in to
> return self._get_converter(other, equivalencies=equivalencies)(value)
> /usr/lib/python3/dist-packages/astropy/units/core.py:918: in _get_converter
> raise exc
> /usr/lib/python3/dist-packages/astropy/units/core.py:903: in _get_converter
> return self._apply_equivalencies(
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> self = Unit("mJy"), unit = Unit("mJy"), other = Unit(dimensionless)
> equivalencies = []
>
> def _apply_equivalencies(self, unit, other, equivalencies):
> """
> Internal function (used from `_get_converter`) to apply
> equivalence pairs.
> """
> def make_converter(scale1, func, scale2):
> def convert(v):
> return func(_condition_arg(v) / scale1) * scale2
> return convert
>
> for funit, tunit, a, b in equivalencies:
> if tunit is None:
> try:
> ratio_in_funit = (other.decompose() /
> unit.decompose()).decompose([funit])
> return make_converter(ratio_in_funit.scale, a, 1.)
> except UnitsError:
> pass
> else:
> try:
> scale1 = funit._to(unit)
> scale2 = tunit._to(other)
> return make_converter(scale1, a, scale2)
> except UnitsError:
> pass
> try:
> scale1 = tunit._to(unit)
> scale2 = funit._to(other)
> return make_converter(scale1, b, scale2)
> except UnitsError:
> pass
>
> def get_err_str(unit):
> unit_str = unit.to_string('unscaled')
> physical_type = unit.physical_type
> if physical_type != 'unknown':
> unit_str = "'{}' ({})".format(
> unit_str, physical_type)
> else:
> unit_str = f"'{unit_str}'"
> return unit_str
>
> unit_str = get_err_str(unit)
> other_str = get_err_str(other)
>
> > raise UnitConversionError(
> "{} and {} are not convertible".format(
> unit_str, other_str))
> E astropy.units.core.UnitConversionError: 'mJy' (spectral flux density) and '' (dimensionless) are not convertible
>
> /usr/lib/python3/dist-packages/astropy/units/core.py:886: UnitConversionError
> =============================== warnings summary ===============================
> /usr/lib/python3/dist-packages/astropy/tests/plugins/display.py:16
> /usr/lib/python3/dist-packages/astropy/tests/plugins/display.py:16: AstropyDeprecationWarning: The astropy.tests.plugins.display plugin has been deprecated. See the pytest-astropy-header documentation for information on migrating to using pytest-astropy-header to customize the pytest header.
> warnings.warn('The astropy.tests.plugins.display plugin has been deprecated. '
>
> /usr/lib/python3/dist-packages/astropy/coordinates/baseframe.py:1207
> /usr/lib/python3/dist-packages/astropy/coordinates/baseframe.py:1207: AstropyDeprecationWarning: Transforming a frame instance to a frame class (as opposed to another frame instance) will not be supported in the future. Either explicitly instantiate the target frame, or first convert the source frame instance to a `astropy.coordinates.SkyCoord` and use its `transform_to()` method.
> warnings.warn("Transforming a frame instance to a frame class (as opposed to another "
>
> .pybuild/cpython3_3.9/build/specutils/manipulation/resample.py::specutils.manipulation.resample.FluxConservingResampler
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_line_flux_masked
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_equivalent_width_masked
> .pybuild/cpython3_3.9/build/specutils/tests/test_correlation.py::test_autocorrelation
> .pybuild/cpython3_3.9/build/specutils/tests/test_correlation.py::test_correlation
> .pybuild/cpython3_3.9/build/specutils/tests/test_correlation.py::test_correlation_zero_padding
> .pybuild/cpython3_3.9/build/specutils/tests/test_correlation.py::test_correlation_random_lines
> .pybuild/cpython3_3.9/build/specutils/tests/test_resample.py::test_expanded_grid_fluxconserving
> .pybuild/cpython3_3.9/build/specutils/tests/test_resample.py::test_resample_edges[FluxConservingResampler-nan_fill-nan]
> .pybuild/cpython3_3.9/build/specutils/tests/test_resample.py::test_resample_edges[FluxConservingResampler-zero_fill-0]
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_match_no_overlap
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_match_minimal_overlap
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_unknown_redshift
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_one_template_spectrum_in_match
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_multiple_template_spectra_in_match
> /usr/lib/python3/dist-packages/astropy/units/quantity.py:477: RuntimeWarning: invalid value encountered in true_divide
> result = super().__array_ufunc__(function, method, *arrays, **kwargs)
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_equivalent_width_regions
> /usr/lib/python3/dist-packages/scipy/interpolate/interpolate.py:2532: RuntimeWarning: invalid value encountered in true_divide
> norm_distances.append((x - grid[i]) /
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width_masked
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width_regions
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_sigma_width_multi_spectrum
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_fwhm
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_masked
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[5]
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[6]
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_gaussian_fwhm_uncentered[7]
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_fwhm_masked
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_fwhm
> .pybuild/cpython3_3.9/build/specutils/tests/test_analysis.py::test_fwhm_multi_spectrum
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectrum1d.py::test_create_from_multidimensional_arrays
> /usr/lib/python3/dist-packages/astropy/units/equivalencies.py:125: RuntimeWarning: divide by zero encountered in true_divide
> (si.m, si.Hz, lambda x: _si.c.value / x),
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_continuum.py::test_continuum_fit
> .pybuild/cpython3_3.9/build/specutils/tests/test_continuum.py::test_continuum_calculation
> .pybuild/cpython3_3.9/build/specutils/tests/test_continuum.py::test_continuum_full_window
> .pybuild/cpython3_3.9/build/specutils/tests/test_continuum.py::test_continuum_spectral_region
> .pybuild/cpython3_3.9/build/specutils/tests/test_continuum.py::test_continuum_window_no_noise
> .pybuild/cpython3_3.9/build/specutils/tests/test_continuum.py::test_double_continuum_window
> .pybuild/cpython3_3.9/build/specutils/tests/test_continuum.py::test_double_continuum_window_alternate
> /usr/lib/python3/dist-packages/astropy/modeling/fitting.py:1708: AstropyUserWarning: Model is linear in parameters; consider using linear fitting methods.
> warnings.warn('Model is linear in parameters; '
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_fitting.py::test_find_lines_derivative
> .pybuild/cpython3_3.9/build/specutils/tests/test_fitting.py::test_find_lines_threshold
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/analysis/flux.py:272: AstropyUserWarning: Spectrum is not below the threshold signal-to-noise 0.01. This may indicate you have not continuum subtracted this spectrum (or that you have but it has high SNR features).
>
> If you want to suppress this warning either type 'specutils.conf.do_continuum_function_check = False' or see http://docs.astropy.org/en/stable/config/#adding-new-configuration-items for other ways to configure the warning.
> warnings.warn(message, AstropyUserWarning)
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_fitting.py::test_fit_subspectrum
> /usr/lib/python3/dist-packages/astropy/modeling/fitting.py:1166: AstropyUserWarning: The fit may be unsuccessful; check fit_info['message'] for more information.
> warnings.warn("The fit may be unsuccessful; check "
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_region_extract.py::test_linear_excise_invert_from_spectrum
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation/utils.py:119: AstropyUserWarning: A SpectralRegion with multiple subregions was provided as input. This may lead to undesired behavior with linear_exciser if the subregions overlap.
> warnings.warn("A SpectralRegion with multiple subregions was provided as "
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_spectral_axis
> /usr/lib/python3/dist-packages/astropy/utils/iers/iers.py:676: AstropyWarning: failed to download ftp://anonymous:mail%40astropy.org@gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all and https://datacenter.iers.org/data/9/finals2000A.all, using local IERS-B: <urlopen error Unable to open any source! Exceptions were {'ftp://anonymous:mail%40astropy.org@gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all': URLError("ftp error: OSError('An attempt was made to connect to the internet by a test that was not marked `remote_data`. The requested host was: 198.118.242.43')"), 'https://datacenter.iers.org/data/9/finals2000A.all': URLError(ConnectionRefusedError(111, 'Connection refused'))}>
> warn(AstropyWarning(
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[None-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer1-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer2-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer3-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_coord[observer4-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[None-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer1-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer2-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer3-target4]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target1]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target2]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target3]
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectral_axis.py::test_create_from_spectral_axis[observer4-target4]
> /usr/lib/python3/dist-packages/astropy/coordinates/spectral_coordinate.py:292: NoVelocityWarning: No velocity defined on frame, assuming (0., 0., 0.) km / s.
> warnings.warn(
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_spectrum1d.py::test_wcs_transformations
> /usr/lib/python3/dist-packages/astropy/wcs/wcsapi/fitswcs.py:545: AstropyUserWarning: No observer defined on WCS, SpectralCoord will be converted without any velocity frame change
> warnings.warn('No observer defined on WCS, SpectralCoord '
>
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_match_no_overlap
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_match_minimal_overlap
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_unknown_redshift
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_one_template_spectrum_in_match
> .pybuild/cpython3_3.9/build/specutils/tests/test_template_comparison.py::test_template_redshift_with_multiple_template_spectra_in_match
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build/specutils/manipulation/resample.py:202: RuntimeWarning: invalid value encountered in true_divide
> out_variance = np.sum(pixel_uncer * resample_grid**2, axis=-1) / np.sum(
>
> -- Docs: https://docs.pytest.org/en/latest/warnings.html
> == 7 failed, 298 passed, 45 skipped, 6 xfailed, 91 warnings in 25.45 seconds ===
> E: pybuild pybuild:353: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest --remote-data=none --doctest-rst
> dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.8 3.9" returned exit code 13
The full build log is available from:
http://qa-logs.debian.net/2020/12/05/specutils_1.1-2_unstable.log
A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!
If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects
If you fail to reproduce this, please provide a build log and diff it with me
so that we can identify if something relevant changed in the meantime.
About the archive rebuild: The rebuild was done on EC2 VM instances from
Amazon Web Services, using a clean, minimal and up-to-date chroot. Every
failed build was retried once to eliminate random failures.
More information about the Debian-astro-maintainers
mailing list