Created
July 13, 2019 14:47
-
-
Save cdeil/8d6f5aa6e13baa2f5b634b50cafc0205 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(base) hfm-1804a:tmp deil$ pypy3 | |
Python 3.6.1 (784b254d669919c872a505b807db8462b6140973, Jun 18 2019, 05:54:52) | |
[PyPy 7.1.1-beta0 with GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
And now for something completely different: ``We are not heroes, just very | |
patient.'' | |
>>>> import astropy | |
>>>> astropy.test() | |
==================================================================== test session starts ==================================================================== | |
platform darwin -- Python 3.6.1[pypy-7.1.1-beta], pytest-5.0.1, py-1.8.0, pluggy-0.12.0 | |
Running tests with Astropy version 4.0.dev25215. | |
Running tests in /usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy. | |
Date: 2019-07-13T14:30:51 | |
Platform: Darwin-18.6.0-x86_64-i386-64bit | |
Executable: /usr/local/bin/pypy3 | |
Full Python Version: | |
3.6.1 (784b254d669919c872a505b807db8462b6140973, Jun 18 2019, 05:54:52) | |
[PyPy 7.1.1-beta0 with GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] | |
encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8 | |
byteorder: little | |
float info: dig: 15, mant_dig: 15 | |
Numpy: 1.16.4 | |
Scipy: not available | |
Matplotlib: not available | |
h5py: not available | |
Pandas: not available | |
Cython: not available | |
Scikit-image: not available | |
asdf: not available | |
astropy_helpers: 3.0.2 | |
Using Astropy options: remote_data: none. | |
rootdir: /usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy | |
plugins: doctestplus-0.3.0, arraydiff-0.3, openfiles-0.3.2, remotedata-0.3.1 | |
collected 12361 items / 26 skipped / 12335 selected | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/_erfa/tests/test_erfa.py ........ [ 0%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/config/tests/test_configs.py ............... [ 0%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/constants/tests/test_constant.py ........ [ 0%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/constants/tests/test_pickle.py xxxxxxxxx [ 0%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/constants/tests/test_prior_version.py ......... [ 0%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/constants/tests/test_sciencestate.py .. [ 0%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 0%] | |
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 2%] | |
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF..FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 3%] | |
FFFFFxFxFxFxFxFxFxFxFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFss.FFFFFFFFFFFF [ 4%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve_fft.py ............................................. [ 4%] | |
....................................................................................................................................................F [ 5%] | |
..................................................................................................................................................... [ 7%] | |
................................................................................................................................................... [ 8%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve_kernels.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 8%] | |
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.F.F.F.FFFFFFF [ 9%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve_models.py ssssss.F.Fss [ 9%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve_nddata.py FF. [ 9%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_discretize.py ...s...........s........sss....... [ 9%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_kernel_class.py ssssssssFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFssssF [ 9%] | |
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFssssFFFFFFFF....FF..................FF............FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFssssFFFF........... [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_pickle.py .xx.xx.xx [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_angles.py .......................................... [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_angular_separation.py .... [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_api_ape5.py ....s [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_arrays.py ............. [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_atc_replacements.py .... [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_celestial_transformations.py ............ss.. [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_distance.py .s........ [ 11%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_earth.py ..............s.. [ 12%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_finite_difference_velocities.py ......s..xx [ 12%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_formatting.py .......... [ 12%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_frames.py ..........................s............. [ 12%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_frames_with_velocity.py ..................................... [ 12%] | |
.......... [ 12%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_funcs.py ..... [ 12%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_iau_fullstack.py ssssssssssssssssssssssssssssssssssssssssssss [ 13%] | |
sssssss. [ 13%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_intermediate_transformations.py .....ssssssssssssssssssssssss [ 13%] | |
sssssss..........ssssssssss.s [ 13%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_matching.py sssssssssss [ 13%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_matrix_utilities.py .. [ 13%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_name_resolve.py s.ss [ 13%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_pickle.py ...xxx.x..xxx.x..xxx.x. [ 14%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_regression.py .ss.ss....s.sss.s.ss.ss...s... [ 14%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_representation.py ........................................... [ 14%] | |
.....................................s................. [ 15%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_representation_arithmetic.py ................................ [ 15%] | |
......................................................... [ 15%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_representation_methods.py ............ [ 15%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_shape_manipulation.py sssssssss [ 16%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_sites.py .ss.s... [ 16%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_sky_coord.py ................................................ [ 16%] | |
..................................................................................................................................................... [ 17%] | |
........................................................................s............................................................................ [ 18%] | |
.................................x........s......s........... [ 19%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_sky_coord_velocities.py .........xs......s...x.xs......s... [ 19%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_skyoffset_transformations.py ...........s................. [ 19%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_solar_system.py s....ssssssssssssss....ssssssss [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_transformations.py ..........................s... [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_unit_representation.py s [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/test_velocity_corrs.py ssssss [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/accuracy/test_altaz_icrs.py ssss [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/accuracy/test_ecliptic.py ......... [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/accuracy/test_fk4_no_e_fk4.py . [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/accuracy/test_fk4_no_e_fk5.py . [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/accuracy/test_galactic_fk4.py . [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/coordinates/tests/accuracy/test_icrs_fk5.py . [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/cosmology/tests/test_cosmology.py ..sss..s.ssssssss.ssssss.sssssssssssssssss [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/cosmology/tests/test_pickle.py ... [ 20%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_c_reader.py ...............FFEEEEEEEEEEE.EE..............EEEEEEE [ 21%] | |
EEEEEEEFEEEEEEEEEEEEEEEEEEEEEEEEEEEEssssss..ssFFFFxxFF..FF..FF......F. [ 21%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_cds_header_from_readme.py ..... [ 22%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_compressed.py ...FFFF [ 22%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_connect.py FFFFFEFFFFFEEssEEFFEEFEs [ 22%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_ecsv.py ssssssssssssssssssssssssssssssssssssssFss [ 22%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_fixedwidth.py ............................... [ 22%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_html.py s.ssssssFssss.s.sss.....s [ 23%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_ipac_definitions.py .................F... [ 23%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_read.py ............FFFFFFFFFFFFFFFFFFFFFF...................... [ 23%] | |
......................................................................... [ 24%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_rst.py ......... [ 24%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_types.py ... [ 24%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/ascii/tests/test_write.py ....................................................... [ 24%] | |
.................................. [ 25%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_checksum.py FFFFFFFFFFFF.FF.F.FFF [ 25%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_compression_failures.py ..................................... [ 25%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_connect.py .............F.F..................................FF.. [ 25%] | |
sssssssssssssssssssssss..ssss [ 26%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_convenience.py F.....FFFF....F [ 26%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_core.py ...FF.F..F..........FF..FFF....s.......................F. [ 26%] | |
FFFF.FF....F...FF [ 26%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_diff.py ......................F.........F........ [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_division.py F.... [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_fitscheck.py ..F..F [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_fitsdiff.py ..FFFFFFFF.FFFF. [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_fitsheader.py ....... [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_fitsinfo.py .. [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_fitstime.py ................... [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_groups.py F.FFFFF. [ 27%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_hdulist.py .FF...F.FF...F.FF..FF.......F.....FFFFFFFFFF......... [ 28%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_header.py ..................F.................................... [ 28%] | |
...........................................................F...................................... [ 29%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_image.py ......FF.F..FFFFFFFF.FFFFFFFFFFFFF...FFFFFFFFFFFFs.FF..F [ 29%] | |
FFFF........F..F.FFFFFFF.F.F [ 30%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_nonstandard.py FF. [ 30%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_structured.py F [ 30%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_table.py .FFFFFFFFFFF.F.FFF..FFF.....FFFFFFFFFFFFFFF...F.FFF.FFFF [ 30%] | |
F.FFFssFFFF.FFFFFF.F...F..........F [ 30%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_uint.py FFFFFFFFF [ 30%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/fits/tests/test_util.py ...s..... [ 31%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/misc/tests/test_hdf5.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 31%] | |
ssssssssssssssss [ 31%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/misc/tests/test_pickle_helpers.py .... [ 31%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/misc/tests/test_yaml.py ssssssssssssssssssssssssssssss [ 31%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/tests/test_registry.py ................................... [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/tests/test_registry_help.py ......... [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/converter_test.py ....................... [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/exception_test.py .. [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/resource_test.py . [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/table_test.py ..................... [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/tree_test.py ... [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/ucd_test.py ..... [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/util_test.py ........... [ 32%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/io/votable/tests/vo_test.py ........................................................ [ 33%] | |
...................................................................................................F....... [ 34%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_blackbody.py ..ss.... [ 34%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_compound.py .................................................... [ 34%] | |
.........s [ 34%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_constraints.py ssssssssF..........ssss. [ 34%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_core.py ................ [ 35%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_fitters.py FFsF.ssss.FFFFFFFFsssssssss....ssFFsssssssssss [ 35%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_functional_models.py ..............sFFF.ss [ 35%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_input.py ........FFFFF.Fssss................................... [ 35%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_mappings.py ......s [ 36%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_model_sets.py ....... [ 36%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_models.py s..........s................s..........s.s..sss.ssssss [ 36%] | |
ssssssssssssssssssssssssssssssssssss........s..s........s..s.s..sss.s.sssssssssssssssssssssssss....sss. [ 37%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_models_quantities.py .s.................s.s......s.............. [ 37%] | |
...s.s......s.................s.s......s.................s.s......s.................s.s.....sssssssssssssssssssssssssss [ 38%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_parameters.py ............F..................................... [ 39%] | |
... [ 39%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_polynomial.py sssssssssssssssssssssssssssssssssssss...FFFFFFs [ 39%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_projections.py ................................................. [ 39%] | |
........................................................................................... [ 40%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_quantities_evaluation.py .................... [ 40%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_quantities_fitting.py sssssssss [ 40%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_quantities_model.py ............................................ [ 41%] | |
......................................................................................................................................... [ 42%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_quantities_parameters.py ............. [ 42%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_quantities_rotations.py ............... [ 42%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_rotations.py .................... [ 42%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_separable.py .......... [ 42%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/modeling/tests/test_utils.py ... [ 42%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/mixins/tests/test_ndarithmetic.py ........................................... [ 43%] | |
...................................................................................................................................... [ 44%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/mixins/tests/test_ndio.py . [ 44%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/mixins/tests/test_ndslicing.py ........... [ 44%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_bitmask.py ....................................................... [ 44%] | |
............. [ 44%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_ccddata.py ......FFFFFF..F..F..................................... [ 45%] | |
......FFFFF.F......F....FFFFFFFFFF.F..F [ 45%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_compat.py ................. [ 45%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_decorators.py ............................ [ 46%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_flag_collection.py .......... [ 46%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_nddata.py ...................F................... [ 46%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_nddata_base.py . [ 46%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_nduncertainty.py ................................................. [ 46%] | |
.......................... [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/tests/test_utils.py .............................sssssssssssss............... [ 47%] | |
. [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/samp/tests/test_client.py .... [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/samp/tests/test_errors.py ... [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/samp/tests/test_hub.py ... [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/samp/tests/test_hub_proxy.py ..... [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/samp/tests/test_hub_script.py . [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/samp/tests/test_standard_profile.py . [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/samp/tests/test_web_profile.py .. [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_bayesian_blocks.py ....... [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_biweight.py .......................... [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_circstats.py ..s....s. [ 47%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_funcs.py .....ss..s.x.........ssss.s..sssssssssssssss.sssssssssssss [ 48%] | |
ssssssssssssssssssss [ 48%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_histogram.py ..ss..........s.. [ 48%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_info_theory.py .... [ 48%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_jackknife.py .ss [ 48%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_sigma_clipping.py .s.............. [ 48%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/stats/tests/test_spatial.py ............ [ 49%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_array.py ... [ 49%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_bst.py ....... [ 49%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_column.py ......................................................... [ 49%] | |
....................................................... [ 50%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_groups.py ....................................... [ 50%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_index.py .......................................................... [ 50%] | |
........................................................................................................FF..........FF............................... [ 52%] | |
........................................................................................................................................... [ 53%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_info.py .............F.. [ 53%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_init_table.py ..................................................... [ 53%] | |
............................................................................................................ [ 54%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_item_access.py ...................................... [ 54%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_jsviewer.py .s.s [ 54%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_masked.py ........................................ [ 55%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_mixin.py .......................................sss.s.............. [ 55%] | |
.................................................... [ 56%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_np_utils.py . [ 56%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_operations.py .......x...x.x.x............x.....x.................. [ 56%] | |
...............x...x...x...........................x...................... [ 57%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_pickle.py .............................. [ 57%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_pprint.py ......................................................... [ 57%] | |
... [ 57%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_row.py ..................................... [ 58%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_showtable.py ............ [ 58%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_subclass.py .. [ 58%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/table/tests/test_table.py .......................................................... [ 58%] | |
..................................................................................................................................................... [ 59%] | |
..............................................................................................................................FFF......x............. [ 61%] | |
..............sssssss.......................FFF......... [ 61%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/tests/test_logger.py ............s................ [ 61%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/tests/tests/test_imports.py s. [ 61%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/tests/tests/test_quantity_helpers.py . [ 61%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/tests/tests/test_run_tests.py .... [ 61%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/tests/tests/test_runner.py ...... [ 61%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_basic.py .............................................s..........s.. [ 62%] | |
............................... [ 62%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_comparisons.py ... [ 62%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_corrs.py ...s [ 62%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_delta.py ........................................................... [ 63%] | |
.................................. [ 63%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_guess.py .... [ 63%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_mask.py .......ss [ 63%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_methods.py ......................................................... [ 64%] | |
........................................ [ 64%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_pickle.py . [ 64%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_precision.py ........x.. [ 64%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_quantity_interaction.py ..................... [ 64%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_sidereal.py ................... [ 64%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/time/tests/test_ut1.py s..ss [ 64%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/io/tests/test_kepler.py .....ss [ 64%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/periodograms/bls/tests/test_bls.py ...................................... [ 65%] | |
................. [ 65%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_mle.py .............. [ 65%] | |
.......... [ 65%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/periodograms/lombscargle/implementations/tests/test_utils.py ............ [ 65%] | |
................................. [ 65%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/periodograms/lombscargle/tests/test_lombscargle.py ...................... [ 66%] | |
..................................................................................................................................................... [ 67%] | |
..................................................................................................................................................... [ 68%] | |
..................................................................................................................................................... [ 69%] | |
..................................................................................................................................................... [ 70%] | |
..................................................................................................................................................... [ 72%] | |
..................................................................................................................................................... [ 73%] | |
..................................................................................................................................................... [ 74%] | |
................................................................................. [ 75%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/periodograms/lombscargle/tests/test_statistics.py ....................... [ 75%] | |
.....ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..ss..s.s..s.s..s.s..s.s..s.s..s.s..s.s..s.s..s.s..s.s [ 76%] | |
.. [ 76%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/periodograms/lombscargle/tests/test_utils.py ................ [ 76%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/tests/test_binned.py ....................... [ 76%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/tests/test_common.py ...................... [ 77%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/tests/test_downsample.py ... [ 77%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/timeseries/tests/test_sampled.py ...............s...ss... [ 77%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/uncertainty/tests/test_distribution.py .............s......ss........... [ 77%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_deprecated.py .. [ 77%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_equivalencies.py .................................................. [ 78%] | |
.............. [ 78%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_format.py ......................................................... [ 78%] | |
..................................................................................................................................................... [ 79%] | |
..................................................................................................................................................... [ 80%] | |
..................................................................................................................................................... [ 82%] | |
................................................................................................................................................. [ 83%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_logarithmic.py .................................................... [ 83%] | |
..................................................................................................................................................... [ 84%] | |
...... [ 85%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_photometric.py .. [ 85%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_physical.py ........... [ 85%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_quantity.py ............................x.......................... [ 85%] | |
................................ [ 85%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_quantity_annotations.py ........................... [ 86%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_quantity_array_methods.py ......................................... [ 86%] | |
.................. [ 86%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_quantity_decorator.py ............................................. [ 86%] | |
..................................................................................................................................................... [ 88%] | |
....................................................................................................................... [ 89%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_quantity_helpers.py .... [ 89%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_quantity_non_ufuncs.py ............................x.ss..xxx.....xx [ 89%] | |
...x..........xxx...xxxxxxxxxxx........................xxxxxxxx.x.....x.....xx.x..xx............xxxxxxxxxx...x.x.xxxxxxxxxxxxxx.x..xxxxxxxx.......... [ 90%] | |
..xxxxxxxxxx.....x......xx [ 90%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_quantity_ufuncs.py sss............................................. [ 91%] | |
....................................................................................................................................sssssss...... [ 92%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_units.py .......................................................... [ 92%] | |
..................................................................................................................................................... [ 94%] | |
.......................................... [ 94%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/units/tests/test_utils.py .. [ 94%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/iers/tests/test_iers.py ....s...ss [ 94%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_codegen.py . [ 94%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_collections.py ......... [ 94%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_console.py ............................ [ 94%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_data.py ss.sssss...........s.....s.s... [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_data_info.py ............ [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_decorators.py ......................... [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_diff.py .................. [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_introspection.py ..... [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_metadata.py ................... [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_misc.py ..s...... [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_timer.py F [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/tests/test_xml.py .........s [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/utils/xml/tests/test_iterparse.py . [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/scripts/tests/test_fits2bitmap.py sssssss [ 95%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_histogram.py sss. [ 96%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_interval.py ........................... [ 96%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py ....EEEEEsEEEEE [ 96%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_norm.py .sssssssssssssssssss [ 96%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_stretch.py ................................................ [ 96%] | |
........................................................... [ 97%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_units.py sssss [ 97%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/tests/test_pickle.py ...... [ 97%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/tests/test_profiling.py .................................... [ 97%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/tests/test_utils.py ....F.......................................... [ 98%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/tests/test_wcs.py .......................F......F.......................F....... [ 98%] | |
[ 98%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/tests/test_wcsprm.py ........................................................... [ 99%] | |
............................................................................... [ 99%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/tests/extension/test_extension.py . [ 99%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/wcsapi/tests/test_fitswcs.py ....F.... [ 99%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/wcsapi/tests/test_high_level_api.py ... [ 99%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/wcsapi/tests/test_high_level_wcs_wrapper.py .. [ 99%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/wcsapi/tests/test_low_level_api.py . [ 99%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/wcsapi/tests/test_sliced_low_level_wcs.py ........... [ 99%] | |
../../usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/wcs/wcsapi/tests/test_utils.py ... [100%] | |
========================================================================== ERRORS =========================================================================== | |
__________________________________________________________ ERROR at setup of test_conversion[True] __________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_conversion[False] __________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________________ ERROR at setup of test_delimiter[True] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________________ ERROR at setup of test_delimiter[False] __________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_include_names[True] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_include_names[False] ________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_exclude_names[True] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_exclude_names[False] ________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
____________________________________________________ ERROR at setup of test_include_exclude_names[True] _____________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
____________________________________________________ ERROR at setup of test_include_exclude_names[False] ____________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_doubled_quotes ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_quoted_fields[True] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_quoted_fields[False] ________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_______________________________________________________ ERROR at setup of test_not_enough_cols[True] ________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_______________________________________________________ ERROR at setup of test_not_enough_cols[False] _______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_data_end[True] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________________ ERROR at setup of test_data_end[False] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_inf_nan[True] ____________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_inf_nan[False] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_fill_values[True] __________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_fill_values[False] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________ ERROR at setup of test_fill_include_exclude_names[True] __________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________ ERROR at setup of test_fill_include_exclude_names[False] __________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________________ ERROR at setup of test_many_rows[True] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________________ ERROR at setup of test_many_rows[False] __________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_many_columns[True] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_many_columns[False] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_read_tab[True] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________________ ERROR at setup of test_read_tab[False] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
______________________________________________________ ERROR at setup of test_default_data_start[True] ______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________ ERROR at setup of test_default_data_start[False] ______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_______________________________________________________ ERROR at setup of test_commented_header[True] _______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
______________________________________________________ ERROR at setup of test_commented_header[False] _______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________________ ERROR at setup of test_rdb[True] ______________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________________ ERROR at setup of test_rdb[False] _____________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________________ ERROR at setup of test_data_start[True] __________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_data_start[False] __________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________ ERROR at setup of test_quoted_empty_values[True] ______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________ ERROR at setup of test_quoted_empty_values[False] _____________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________ ERROR at setup of test_csv_comment_default[True] ______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________ ERROR at setup of test_csv_comment_default[False] _____________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________ ERROR at setup of test_whitespace_before_comment[True] ___________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
__________________________________________________ ERROR at setup of test_whitespace_before_comment[False] __________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________ ERROR at setup of test_strip_line_trailing_whitespace[True] ________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_______________________________________________ ERROR at setup of test_strip_line_trailing_whitespace[False] ________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_no_data[True] ____________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_no_data[False] ___________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_line_endings[True] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_line_endings[False] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_store_comments[True] ________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_______________________________________________________ ERROR at setup of test_store_comments[False] ________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_empty_quotes[True] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_empty_quotes[False] _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________ ERROR at setup of test_fast_tab_with_names[True] ______________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________ ERROR at setup of test_fast_tab_with_names[False] _____________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
___________________________________________________________ ERROR at setup of test_write_generic ____________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
____________________________________________________________ ERROR at setup of test_write_latex _____________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_write_latex_noformat ________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________________ ERROR at setup of test_write_html _____________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of test_write_html_noformat _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________________ ERROR at setup of test_write_rdb ______________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_________________________________________________________ ERROR at setup of test_write_rdb_noformat _________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
_____________________________________________________________ ERROR at setup of test_write_csv ______________________________________________________________ | |
self = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1') | |
> ??? | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:1062: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pathobj = PosixPath('/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1'), args = () | |
> ??? | |
E OSError: [Errno 24] Too many open files: '/private/var/folders/t_/_mywtcj146lbk2c99bnxw7z40000gp/T/pytest-of-deil/pytest-1' | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib-python/3/pathlib.py:390: OSError | |
________________________________________________________ ERROR at setup of TestLuptonRgb.test_Asinh _________________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000124875718> | |
method = <bound method TestLuptonRgb.test_Asinh of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000124875718>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_____________________________________________________ ERROR at setup of TestLuptonRgb.test_AsinhZscale ______________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000121604800> | |
method = <bound method TestLuptonRgb.test_AsinhZscale of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000121604800>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_________________________________________________ ERROR at setup of TestLuptonRgb.test_AsinhZscaleIntensity _________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000117d09d00> | |
method = <bound method TestLuptonRgb.test_AsinhZscaleIntensity of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000117d09d00>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_____________________________________________ ERROR at setup of TestLuptonRgb.test_AsinhZscaleIntensityPedestal _____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x000000012564b280> | |
method = <bound method TestLuptonRgb.test_AsinhZscaleIntensityPedestal of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x000000012564b280>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
________________________________________________ ERROR at setup of TestLuptonRgb.test_AsinhZscaleIntensityBW ________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000114258020> | |
method = <bound method TestLuptonRgb.test_AsinhZscaleIntensityBW of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000114258020>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
________________________________________________ ERROR at setup of TestLuptonRgb.test_make_rgb_saturated_fix ________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000114234058> | |
method = <bound method TestLuptonRgb.test_make_rgb_saturated_fix of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000114234058>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
________________________________________________________ ERROR at setup of TestLuptonRgb.test_linear ________________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000118dc4e20> | |
method = <bound method TestLuptonRgb.test_linear of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000118dc4e20>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
____________________________________________________ ERROR at setup of TestLuptonRgb.test_linear_min_max ____________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000122d25a60> | |
method = <bound method TestLuptonRgb.test_linear_min_max of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x0000000122d25a60>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________________ ERROR at setup of TestLuptonRgb.test_saturated _______________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x000000011ce5b168> | |
method = <bound method TestLuptonRgb.test_saturated of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x000000011ce5b168>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ ERROR at setup of TestLuptonRgb.test_different_shapes_asserts _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
obj = array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
..., | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.]]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x000000012411d0f8> | |
method = <bound method TestLuptonRgb.test_different_shapes_asserts of <astropy.visualization.tests.test_lupton_rgb.TestLuptonRgb object at 0x000000012411d0f8>> | |
def setup_method(self, method): | |
np.random.seed(1000) # so we always get the same images. | |
self.min_, self.stretch_, self.Q = 0, 5, 20 # asinh | |
width, height = 85, 75 | |
self.width = width | |
self.height = height | |
shape = (width, height) | |
image_r = np.zeros(shape) | |
image_g = np.zeros(shape) | |
image_b = np.zeros(shape) | |
# pixel locations, values and colors | |
points = [[15, 15], [50, 45], [30, 30], [45, 15]] | |
values = [1000, 5500, 600, 20000] | |
g_r = [1.0, -1.0, 1.0, 1.0] | |
r_i = [2.0, -0.5, 2.5, 1.0] | |
# Put pixels in the images. | |
for p, v, gr, ri in zip(points, values, g_r, r_i): | |
image_r[p[0], p[1]] = v*pow(10, 0.4*ri) | |
image_g[p[0], p[1]] = v*pow(10, 0.4*gr) | |
image_b[p[0], p[1]] = v | |
# convolve the image with a reasonable PSF, and add Gaussian background noise | |
def convolve_with_noise(image, psf): | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
randomImage = np.random.normal(0, 2, image.shape) | |
return randomImage + convolvedImage | |
psf = Gaussian2DKernel(2.5) | |
> self.image_r = convolve_with_noise(image_r, psf) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:123: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/visualization/tests/test_lupton_rgb.py:118: in convolve_with_noise | |
convolvedImage = convolve(image, psf, boundary='extend', normalize_kernel=True) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
[0., 0., 0., ..., 0., 0., 0.], | |
...407e-07, 1.69492268e-07, 5.10500900e-08, 1.31025558e-08, | |
2.86568469e-09]]), array([21, 21], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
========================================================================= FAILURES ========================================================================== | |
_________________________________________________________________ TestConvolve1D.test_list __________________________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001199d3a28> | |
def test_list(self): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
x = [1, 4, 5, 6, 5, 7, 8] | |
y = [0.2, 0.6, 0.2] | |
> z = convolve(x, y, boundary=None) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:51: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_________________________________________________________________ TestConvolve1D.test_tuple _________________________________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000119780170> | |
def test_tuple(self): | |
""" | |
Test that convolve works correctly when inputs are tuples | |
""" | |
x = (1, 4, 5, 6, 5, 7, 8) | |
y = (0.2, 0.6, 0.2) | |
> z = convolve(x, y, boundary=None) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:62: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-True->f4] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000116e7e480>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-True-<f4] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011b15ab10>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-True->f8] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011ae0a950>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-True-<f8] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011cfeb130>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-False->f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011aa79c58>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-False-<f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001170182f8>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-False->f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000112403e18>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-True-False-<f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000114720608>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-True->f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000114ce8fa8>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-True-<f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011457afa8>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-True->f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000113b791a0>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-True-<f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000118ec4720>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-False->f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000119a04330>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-False-<f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011a857638>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-False->f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011a16c528>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[None-interpolate-False-False-<f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001168dc6b0>, boundary = None, nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-True->f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011ed58758>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-True-<f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011b9653d0>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-True->f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000116668a30>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-True-<f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001124297f8>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-False->f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001158110c0>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-False-<f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001166de1a8>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-False->f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011556d398>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-True-False-<f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000117c7e838>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-True->f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001165f5520>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-True-<f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000119d297c0>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-True->f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000118f281a8>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = True, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-True-<f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011a46c1a8>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = True, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-False->f4] ______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011b808598>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = False, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-False-<f4] ______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011c9bf408>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = False, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-False->f8] ______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001192b74e8>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = False, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[None-fill-False-False-<f8] ______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000119da7638>, boundary = None, nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = False, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([1., 4., 5., 6., 5., 7., 8.]), 1, array([7], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-True->f4] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000114e228a8>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-True-<f4] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000112288b10>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-True->f8] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000112f28090>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-True-<f8] ____________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001154d17f8>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-False->f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001176fdc90>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-False-<f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000113b7cfe0>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-False->f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000118a05e18>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-True-False-<f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000119a04758>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-True->f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011a6f64b8>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-True-<f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011a16d600>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-True->f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011ce3b328>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
___________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-True-<f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000116d03130>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = True, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-False->f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001190f6218>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-False-<f4] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000119e04fa8>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-False->f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001134ba8a8>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
__________________________________________ TestConvolve1D.test_input_unmodified[fill-interpolate-False-False-<f8] ___________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000112289f68>, boundary = 'fill', nan_treatment = 'interpolate' | |
normalize_kernel = False, preserve_nan = False, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-True->f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001149a5910>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-True-<f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x00000001143fbe18>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-True->f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000114400d78>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
_______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-True-<f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011945d8a0>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = True, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-False->f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000118915910>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-False-<f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011868d670>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-False->f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011a3788e0>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '>f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-True-False-<f8] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000119063c20>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = True, preserve_nan = False, dtype = '<f8' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2, 0.6, 0.2]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-False-True->f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x0000000116be8918>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = True, dtype = '>f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, | |
normalize_kernel, preserve_nan, dtype): | |
""" | |
Test that convolve works correctly when inputs are lists | |
""" | |
array = [1., 4., 5., 6., 5., 7., 8.] | |
kernel = [0.2, 0.6, 0.2] | |
x = np.array(array, dtype=dtype) | |
y = np.array(kernel, dtype=dtype) | |
# Make pseudoimmutable | |
x.flags.writeable = False | |
y.flags.writeable = False | |
z = convolve(x, y, boundary=boundary, nan_treatment=nan_treatment, | |
> normalize_kernel=normalize_kernel, preserve_nan=preserve_nan) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/tests/test_convolve.py:89: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/nddata/decorators.py:246: in wrapper | |
result = func(data, *args, **kwargs) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/astropy/convolution/convolve.py:332: in convolve | |
n_threads | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:350: in __call__ | |
self._convert_args(argtypes, args, kwargs)) | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
except (UnicodeError, TypeError, ValueError) as e: | |
> raise ArgumentError(str(e)) | |
E _ctypes.basics.ArgumentError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:584: ArgumentError | |
______________________________________________ TestConvolve1D.test_input_unmodified[fill-fill-False-True-<f4] _______________________________________________ | |
self = <ctypes.CDLL.__init__.<locals>._FuncPtr object at 0x0000000111196440> | |
argtypes = [<class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'...S'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS'>, ...] | |
args = (array([0., 0., 0., 0., 0., 0., 0.]), array([0., 1., 4., 5., 6., 5., 7., 8., 0.]), 1, array([9], dtype=object), array([0.2 , 0.60000002, 0.2 ]), array([3], dtype=object), ...) | |
kwargs = {}, marker = <object object at 0x000000010d267a30> | |
def _convert_args(self, argtypes, args, kwargs, marker=object()): | |
newargs = [] | |
outargs = [] | |
keepalives = [] | |
newargtypes = [] | |
total = len(args) | |
paramflags = self._paramflags | |
if not paramflags and total < len(argtypes): | |
raise TypeError("not enough arguments") | |
if paramflags: | |
errcheckargs = [] | |
inargs_idx = 0 | |
for i, argtype in enumerate(argtypes): | |
flag = 0 | |
defval = marker | |
paramflag = paramflags[i] | |
paramlen = len(paramflag) | |
name = None | |
if paramlen == 1: | |
flag = paramflag[0] | |
elif paramlen == 2: | |
flag, name = paramflag | |
elif paramlen == 3: | |
flag, name, defval = paramflag | |
flag = flag & PARAMFLAG_COMBINED | |
if flag == PARAMFLAG_FIN | PARAMFLAG_FLCID: | |
val = defval | |
if val is marker: | |
val = 0 | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag in (0, PARAMFLAG_FIN): | |
if inargs_idx < total: | |
val = args[inargs_idx] | |
inargs_idx += 1 | |
elif kwargs and name in kwargs: | |
val = kwargs[name] | |
inargs_idx += 1 | |
elif defval is not marker: | |
val = defval | |
elif name: | |
raise TypeError("required argument '%s' missing" % name) | |
else: | |
raise TypeError("not enough arguments") | |
errcheckargs.append(val) | |
keepalive, newarg, newargtype = self._conv_param(argtype, val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
elif flag == PARAMFLAG_FOUT: | |
if defval is not marker: | |
val = defval | |
keepalive, newarg, newargtype = self._conv_param(argtype, defval) | |
else: | |
import ctypes | |
val = argtype._type_._newowninstance_() | |
keepalive = None | |
newarg = ctypes.byref(val) | |
newargtype = type(newarg) | |
errcheckargs.append(val) | |
outargs.append(val) | |
keepalives.append(keepalive) | |
newargs.append(newarg) | |
newargtypes.append(newargtype) | |
else: | |
raise ValueError("paramflag %d not yet implemented" % flag) | |
else: | |
errcheckargs = args | |
for i, argtype in enumerate(argtypes): | |
try: | |
> keepalive, newarg, newargtype = self._conv_param(argtype, args[i]) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:582: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class 'ctypes.CDLL.__init__.<locals>._FuncPtr'>, argtype = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'> | |
arg = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def _conv_param(cls, argtype, arg): | |
if argtype is not None: | |
> arg = argtype.from_param(arg) | |
/usr/local/Cellar/pypy3/7.1.1/libexec/lib_pypy/_ctypes/function.py:465: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
cls = <class '_ctypes.primitive.ndpointer_|O_C_CONTIGUOUS_WRITEABLE'>, obj = array([0., 0., 0., 0., 0., 0., 0.]) | |
@classmethod | |
def from_param(cls, obj): | |
if not isinstance(obj, ndarray): | |
raise TypeError("argument must be an ndarray") | |
if cls._dtype_ is not None \ | |
and obj.dtype != cls._dtype_: | |
> raise TypeError("array must have data type %s" % cls._dtype_) | |
E TypeError: array must have data type object | |
/usr/local/Cellar/pypy3/7.1.1/libexec/site-packages/numpy/ctypeslib.py:186: TypeError | |
During handling of the above exception, another exception occurred: | |
self = <astropy.convolution.tests.test_convolve.TestConvolve1D object at 0x000000011eebdec0>, boundary = 'fill', nan_treatment = 'fill' | |
normalize_kernel = False, preserve_nan = True, dtype = '<f4' | |
@pytest.mark.parametrize(('boundary', 'nan_treatment', | |
'normalize_kernel', 'preserve_nan', 'dtype'), | |
itertools.product(BOUNDARY_OPTIONS, | |
NANHANDLING_OPTIONS, | |
NORMALIZE_OPTIONS, | |
PRESERVE_NAN_OPTIONS, | |
VALID_DTYPES)) | |
def test_input_unmodified(self, boundary, nan_treatment, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment