Repository navigation
Description
This is maybe related to the use of scipy 1.3.0rc2, I don't see this failure on another computer with scipy 1.2.1.
===================================== test session starts =====================================
platform linux -- Python 3.7.2, pytest-4.4.2, py-1.8.0, pluggy-0.11.0
Running tests with Astropy version 4.0.dev24575.
Running tests in astropy docs.
Date: 2019-05-10T10:13:56
Platform: Linux-5.0.13-arch1-1-ARCH-x86_64-with-arch
Executable: /home/simon/.pyenv/versions/3.7.2/bin/python
Full Python Version:
3.7.2 (default, Jan 18 2019, 23:38:59)
[GCC 8.2.1 20181127]
encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15
Numpy: 1.16.3
Scipy: 1.3.0rc2
Matplotlib: 3.0.3
h5py: 2.9.0
Pandas: 0.24.2
Cython: 0.29.7
Scikit-image: 0.15.0
astropy_helpers: 3.1rc1
Using Astropy options: remote_data: any.
_____________________________ [doctest] docs/timeseries/index.rst _____________________________
[gw2] linux -- Python 3.7.2 /home/simon/.pyenv/versions/3.7.2/bin/python
263 from astropy.stats import sigma_clipped_stats
264 mean, median, stddev = sigma_clipped_stats(ts_folded['sap_flux'])
265 ts_folded['sap_flux_norm'] = ts_folded['sap_flux'] / median
266
267 and we can downsample the time series by binning the points into bins of equal
268 time - this returns a |BinnedTimeSeries|::
269
270 >>> from astropy.timeseries import aggregate_downsample
271 >>> ts_binned = aggregate_downsample(ts_folded, time_bin_size=0.03 * u.day) # doctest: +REMOTE_DATA
272 >>> ts_binned # doctest: +FLOAT_CMP +REMOTE_DATA
Differences (unified diff with -expected +actual):
@@ -1,25 +1,48 @@
<BinnedTimeSeries length=74>
- time_bin_start time_bin_size ... sap_flux_norm
- s ...
- object float64 ... float64
-------------------- ------------------ ... ------------------
--1.1022116370482966 2592.0 ... 0.9998741745948792
--1.0722116370482966 2592.0 ... 0.9999074339866638
--1.0422116370482966 2592.0 ... 0.999972939491272
--1.0122116370482965 2592.0 ... 1.0000077486038208
--0.9822116370482965 2592.0 ... 0.9999921917915344
--0.9522116370482965 2592.0 ... 1.0000101327896118
--0.9222116370482966 2592.0 ... 1.0000121593475342
--0.8922116370482965 2592.0 ... 0.9999905228614807
--0.8622116370482965 2592.0000000000023 ... 1.0000263452529907
- ... ... ... ...
- 0.8177883629517035 2591.9999999999977 ... 1.0000624656677246
- 0.8477883629517035 2592.0000000000014 ... 1.0000633001327515
- 0.8777883629517035 2592.000000000019 ... 1.0000433921813965
- 0.9077883629517037 2591.9999999999814 ... 1.000024676322937
- 0.9377883629517034 2592.00000000002 ... 1.0000224113464355
- 0.9677883629517037 2591.999999999981 ... 1.0000698566436768
- 0.9977883629517035 2592.0 ... 0.9999606013298035
- 1.0277883629517035 2592.0 ... 0.9999635815620422
- 1.0577883629517035 2592.0 ... 0.9999105930328369
- 1.0877883629517036 2592.0000000000095 ... 0.9998687505722046
+ time_bin_start time_bin_size ... pos_corr2 sap_flux_norm
+ s ... pix
+ object float64 ... float64 float64
+------------------- ------------------ ... ----------------------- ------------------
+-1.1022116370482966 2592.0 ... 0.00031207725987769663 0.9998741745948792
+-1.0722116370482966 2592.0 ... 0.00041217938996851444 0.9999074339866638
+-1.0422116370482966 2592.0 ... 0.00039273229776881635 0.999972939491272
+-1.0122116370482965 2592.0 ... 0.0002928022004198283 1.0000077486038208
+-0.9822116370482965 2592.0 ... 0.0003891147789545357 0.9999921917915344
+-0.9522116370482965 2592.0 ... 0.0003491091774776578 1.0000101327896118
+-0.9222116370482966 2592.0 ... 0.0002824827388394624 1.0000121593475342
+-0.8922116370482965 2592.0 ... 0.00016335179680027068 0.9999905228614807
+-0.8622116370482965 2592.0000000000023 ... 0.0001397567830281332 1.0000263452529907
+-0.8322116370482965 2591.9999999999977 ... -0.00014221783203538507 1.000070333480835
+-0.8022116370482966 2592.0000000000023 ... -9.427832264918834e-05 1.0000371932983398
+-0.7722116370482965 2592.0 ... -0.00017664248298387975 1.0000463724136353
+-0.7422116370482965 2592.0000000000023 ... -0.00012228667037561536 1.0000810623168945
+-0.7122116370482965 2591.9999999999927 ... -0.0001244118611793965 1.0000311136245728
+-0.6822116370482966 2592.0000000000023 ... -8.055769285419956e-05 1.0000026226043701
+-0.6522116370482965 2592.0000000000023 ... -0.0001010842970572412 1.000022530555725
+-0.6222116370482965 2592.0000000000023 ... -7.21014293958433e-06 1.000044822692871
+-0.5922116370482965 2591.9999999999927 ... 8.348121627932414e-05 0.9999921917915344
+-0.5622116370482966 2592.0000000000023 ... 9.918524301610887e-05 0.9999784827232361
+-0.5322116370482965 2592.0000000000023 ... 6.90473461872898e-05 1.0000337362289429
+-0.5022116370482965 2592.0000000000023 ... 0.00013223491259850562 1.0000052452087402
+ ... ... ... ... ...
+0.48778836295170347 2592.0000000000023 ... 0.00011087083112215623 1.0000249147415161
+ 0.5177883629517035 2592.0000000000023 ... 0.0001466787070967257 1.0000004768371582
+ 0.5477883629517035 2591.9999999999927 ... 0.00022175510821398348 1.0000418424606323
+ 0.5777883629517034 2592.0000000000023 ... 0.0001385248324368149 1.0000243186950684
+ 0.6077883629517035 2592.0000000000023 ... 7.515603647334501e-05 1.0000287294387817
+ 0.6377883629517035 2591.9999999999977 ... 0.0001684143499005586 1.0000258684158325
+ 0.6677883629517034 2591.9999999999977 ... 0.00011036244541173801 1.0000230073928833
+ 0.6977883629517034 2592.0000000000023 ... 0.00012551579857245088 1.0000182390213013
+ 0.7277883629517035 2592.0 ... 0.0002313474251423031 1.0000282526016235
+ 0.7577883629517035 2592.0 ... 0.00027140387101098895 1.0000109672546387
+ 0.7877883629517035 2592.0000000000023 ... 0.00011987287871306762 1.0000824928283691
+ 0.8177883629517035 2591.9999999999977 ... -2.2798192730988376e-05 1.0000624656677246
+ 0.8477883629517035 2592.0000000000014 ... 0.00022221534163691103 1.0000633001327515
+ 0.8777883629517035 2592.000000000019 ... 0.00019213277846574783 1.0000433921813965
+ 0.9077883629517037 2591.9999999999814 ... 0.0002187517675338313 1.000024676322937
+ 0.9377883629517034 2592.00000000002 ... 0.00016979355132207274 1.0000224113464355
+ 0.9677883629517037 2591.999999999981 ... 0.00014231358363758773 1.0000698566436768
+ 0.9977883629517035 2592.0 ... 0.0001224415173055604 0.9999606013298035
+ 1.0277883629517035 2592.0 ... 0.00027701034559868276 0.9999635815620422
+ 1.0577883629517035 2592.0 ... 0.0003093520936090499 0.9999105930328369
+ 1.0877883629517036 2592.0000000000095 ... 0.00022884277859702706 0.9998687505722046
/tmp/simon/astropy-test-beh0dhqh/lib/python3.7/site-packages/docs/timeseries/index.rst:272: DocTestFailure
Activity
pllim commentedon May 10, 2019
The number of displayed columns is also different -- is this why doctest is failing? Can
scipyinfluence the number of display columns?pllim commentedon May 10, 2019
bsipocz commentedon May 10, 2019
What happens if the line
>>> ts_binned # doctest: +FLOAT_CMP +REMOTE_DATAis changed to>>> ts_binned # doctest: +FLOAT_CMP +REMOTE_DATA +ELLIPSIS?pllim commentedon May 11, 2019
@saimn , I am unable to reproduce the reported failure in CI. Are you sure
scipyis the culprit and not screen resolution or something else? In #8695 , I forced the first job to installscipy1.3.0rc2 and run with--remote-databut that job passed (https://travis-ci.org/astropy/astropy/jobs/531030649).bsipocz commentedon May 11, 2019
@saimn - what is the version of your
pytest-doctestplus?saimn commentedon May 11, 2019
Hmm, I cannot reproduce with another laptop, I will try with the other one tomorrow or Monday.
astrofrog commentedon May 11, 2019
@saimn - in the past, some of your test failures have been due to custom config in the astropy config file. Could you check whether there is anything in there related to terminal width?
saimn commentedon May 12, 2019
So I can reproduce only when using pytest-xdist, with
python setup.py test -R -j 2 -t docs/timeseries/index.rst. Without the-jthe test pass.I can reproduce the same output in both cases with
ts_binned.pprint(show_unit=True, show_dtype=True, max_width=80, max_lines=25), but it's a bit annoying to have in the docs ?bsipocz commentedon May 13, 2019
@saimn - can you confirm that adding
+ELLIPSISis not helping?saimn commentedon May 13, 2019
@bsipocz - Yes indeed, it is not helping.
bsipocz commentedon May 13, 2019
that's then worth a bugreport to
pytest-doctestplus2 remaining items
saimn commentedon May 18, 2019
So the failure is because
os.environ.get('COLUMNS')returns the real terminal size when running with xdist:astropy/astropy/utils/console.py
Lines 200 to 202 in 8a59b16
It seems that COLUMNS and LINES are set by the shell, but I still do not understand why this happens only for me and on this specific laptop ...
astrofrog commentedon May 19, 2019
@saimn - I know you mentioned that in your case COLUMNS and LINES are not environment variables, just shell variables, but the fact that we do check the environment variables suggests to me that when running the tests we should make sure we temporarily remove these variables from the environment in case users did set them directly? (which would also incidentally fix your issue, though this wouldn't address the root cause)
astrofrog commentedon May 19, 2019
I'm removing the milestone since this isn't a regression as such, and not critical for v3.2
saimn commentedon May 19, 2019
I agree it is not critical. These variables were added to handle the terminal resizing for the progress bar, so this must be useful at some point but I don't understand how it is supposed to happen. It may be a good idea to set these variables to the default values, indeed.
astrofrog commentedon Jun 18, 2019
For anyone interested in working on this, the idea is to edit the
conftest.pyfile(s) to temporarily unsetCOLUMNSandLINES(environment variables) during the tests.aarchiba commentedon Oct 18, 2019
I believe I'm seeing the same error. On a wide terminal I see:
The version actually observed is different depending on the width of my terminal when I run
python setup.py test.pllim commentedon Mar 29, 2022
Can someone update the title? I almost closed it because the version reported is too old but looks like this is still a problem?