radio-astro-tools / casa-formats-io

Code to handle I/O from/to data in CASA format
Other
10 stars 7 forks source link

Test against oldest versions of dependencies #4

Closed e-koch closed 4 years ago

e-koch commented 4 years ago

Add oldest supported version tests. This is to check for failures in the tests, such as this one with old versions of numpy:

_________________________________________________________________ test_getdminfo[shape0] __________________________________________________________________
tmp_path = PosixPath('/tmp/pytest-of-ekoch/pytest-0/test_getdminfo_shape0_0'), shape = (3,)
    @pytest.mark.skipif('not CASATOOLS_INSTALLED')
    @pytest.mark.parametrize('shape', SHAPES)
    def test_getdminfo(tmp_path, shape):
        filename = str(tmp_path / 'test.image')
        data = np.random.random(shape)
        ia = image()
        ia.fromarray(outfile=filename, pixels=data, log=False)
        ia.close()
        tb = table()
        tb.open(filename)
        reference = tb.getdminfo()
        tb.close()
        actual = getdminfo(filename)
        # We include information about endian-ness in the dminfo but CASA doesn't
        actual['*1'].pop('BIGENDIAN')
        # The easiest way to compare the output is simply to compare the output
        # from pformat (checking for dictionary equality doesn't work because of
        # the Numpy arrays inside).
>       assert pformat(actual) == pformat(reference)
E       assert "{'*1': {'COL...dCellStMan'}}" == "{'*1': {'COLU...dCellStMan'}}"
E         Skipping 128 identical leading characters in diff, use -v to show
E         -  array([3]),
E         +  array([3], dtype=int32),
E                            'HYPERCUBES': {'*1': {'BucketSize': 12,
E         -                                        'CellShape': array([3]),
E         +                                        'CellShape': array([3], dtype=int32),
E         ?                                                              +++++++++++++...
E         
E         ...Full output truncated (12 lines hidden), use '-vv' to show
/home/ekoch/ownCloud/code_development/radio_astro_tools/casa-formats-io/casa_formats_io/tests/test_casa_low_level_io.py:51: AssertionError

Ping @astrofrog

astrofrog commented 4 years ago

@e-koch - weirdly I'm not seeing this error anymore, could you send the output of pip freeze for the environment in which you are getting the failures?

e-koch commented 4 years ago

@astrofrog This could just be the weird environment I'm using. Here's the output:

alabaster==0.7.12
APLpy==2.0.3
appdirs==1.4.3
asciitree==0.3.3
asteval==0.9.19
-e git+git@github.com:e-koch/astrodendro.git@9ebeac2384addb643eb70b87eaaf07062dbff016#egg=astrodendro
astropy==3.2.3
astropy-healpix==0.5
atomicwrites==1.3.0
attrs==19.3.0
Babel==2.8.0
backcall==0.1.0
bleach==3.1.0
bokeh==1.4.0
Bottleneck==1.3.2
casadata==2020.9.28
casatools==6.1.0.118
certifi==2019.11.28
chardet==3.0.4
Click==7.0
cloudpickle==1.2.2
cycler==0.10.0
Cython==0.29.21
cytoolz==0.10.1
dask==2.30.0
dask-image==0.4.0
decorator==4.4.1
defusedxml==0.6.0
distlib==0.3.0
distributed==2.9.0
docutils==0.16
entrypoints==0.3
fasteners==0.15
filelock==3.0.12
fsspec==0.6.0
future==0.18.2
-e git+git@github.com:mriener/gausspyplus.git@5b590b95fbaa57b5546eb786986093f8643eaf43#egg=gausspyplus
HeapDict==1.0.1
idna==2.10
imageio==2.6.1
imagesize==1.2.0
importlib-metadata==1.1.0
importlib-resources==1.0.2
ipykernel==5.1.3
ipython==7.10.1
ipython-genutils==0.2.0
ipywidgets==7.5.1
jedi==0.15.1
Jinja2==2.10.3
joblib==0.14.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==5.3.4
jupyter-console==6.1.0
jupyter-core==4.6.1
kiwisolver==1.1.0
livereload==2.6.3
lmfit==1.0.1
locket==0.2.0
MarkupSafe==1.1.1
matplotlib==3.1.2
mistune==0.8.4
mkl-fft==1.0.15
mkl-random==1.1.0
mkl-service==2.3.0
monotonic==1.5
more-itertools==7.2.0
msgpack==0.6.1
nbconvert==5.6.1
nbformat==4.4.0
networkx==2.4
notebook==6.0.2
numcodecs==0.7.2
numpy==1.17.4
olefile==0.46
packaging==19.2
pandas==0.25.3
pandocfilters==1.4.2
parso==0.5.1
partd==1.1.0
pexpect==4.7.0
pickleshare==0.7.5
Pillow==6.2.1
PIMS==0.5
pluggy==0.13.1
prometheus-client==0.7.1
prompt-toolkit==3.0.2
psutil==5.6.7
ptyprocess==0.6.0
py==1.8.0
PyAVM==0.9.5
Pygments==2.5.2
pyparsing==2.4.5
pyregion==2.0
pyrsistent==0.15.6
pytest==5.0.1
pytest-arraydiff==0.3
pytest-astropy==0.6.0
pytest-astropy-header==0.1.1
pytest-doctestplus==0.5.0
pytest-openfiles==0.4.0
pytest-remotedata==0.3.2
python-dateutil==2.8.1
pytz==2019.3
PyWavelets==1.1.1
PyYAML==5.1.2
pyzmq==18.1.0
qtconsole==4.6.0
-e git+git@github.com:e-koch/radio_beam.git@4c3f72c3de3ca35327d1890fdd02c734293e1af1#egg=radio_beam
reproject==0.7.1
requests==2.24.0
rstcheck==3.3.1
scikit-image==0.16.2
scikit-learn==0.22.1
scipy==1.3.3
seaborn==0.10.0
Send2Trash==1.5.0
Shapely==1.7.1
six==1.14.0
slicerator==1.0.0
snowballstemmer==2.0.0
sortedcontainers==2.1.0
-e git+git@github.com:e-koch/spectral-cube.git@71fd8e2c7251b46e2738af6fa3c0b78fd242260c#egg=spectral_cube
Sphinx==3.2.1
sphinx-autobuild==2020.9.1
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
tblib==1.5.0
terminado==0.8.3
testpath==0.4.4
toml==0.10.0
toolz==0.10.0
tornado==6.0.3
tox==3.14.5
tqdm==4.48.2
traitlets==4.3.3
uncertainties==3.1.4
urllib3==1.25.10
virtualenv==20.0.4
wcwidth==0.1.7
webencodings==0.5.1
widgetsnbextension==3.5.1
zarr==2.4.0
zict==1.0.0
zipp==0.6.0
astrofrog commented 4 years ago

@e-koch - the issue was that the test suite relied on a recent version of casatools. It should be fixed with #7.