-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test newer Numpy versions #66
base: master
Are you sure you want to change the base?
Conversation
Summary:
It seems that 1.22 introduced changes (see e.g. numpy/numpy#20853 or numpy/numpy#21256). Looking at the latest documentation, the interface also changed a bit, especially with the keyword |
@gfabbian -- as a temporary fix, you can still use numpy 1.21 with python 3.9 ;-) |
If I look at the signature files generated with numpy 1.21 or 1.22, here is the difference: # do it with different version of numpy
python -m numpy.f2py tod_f.f90 -m tod -h tod_numpy21.pyf (base) peloton@peloton:~/codes/s4cmb/s4cmb$ diff tod_numpy21.pyf tod_numpy22.pyf
16,19c16,19
< integer(kind=4) dimension(npix*nt),intent(in),depend(npix,nt) :: waferi1d
< real(kind=8) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: waferpa
< real(kind=8) dimension(npix*nt*2-1+1),intent(in),depend(npix,nt) :: waferts
< real(kind=8) dimension(npix),intent(in) :: diff_weight
---
> integer(kind=4) dimension(npix * nt),intent(in) :: waferi1d
> real(kind=8) dimension(npix * nt),intent(in),depend(nt,npix) :: waferpa
> real(kind=8) dimension(2 * npix * nt),intent(in),depend(nt,npix) :: waferts
> real(kind=8) dimension(npix),intent(in),depend(npix) :: diff_weight
21,24c21,24
< integer(kind=4), optional,intent(in),check(len(diff_weight)>=npix),depend(diff_weight) :: npix=len(diff_weight)
< integer(kind=4) intent(in) :: nt
< integer(kind=4) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: wafermask_pixel
< integer(kind=4), optional,intent(in),check(len(d)>=nskypix),depend(d) :: nskypix=len(d)
---
> integer(kind=4), optional,intent(in),check(shape(waferi1d, 0) == npix * nt),depend(waferi1d,nt) :: npix=shape(waferi1d, 0) / nt
> integer(kind=4), optional,intent(in),check(shape(waferi1d, 0) == npix * nt),depend(waferi1d,npix) :: nt=shape(waferi1d, 0) / npix
> integer(kind=4) dimension(npix * nt),intent(in),depend(nt,npix) :: wafermask_pixel
> integer(kind=4), optional,intent(in),check(shape(d, 0) == nskypix),depend(d) :: nskypix=shape(d, 0)
39,42c39,42
< integer(kind=4) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: waferi1d
< real(kind=8) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: waferpa
< real(kind=8) dimension(npix*nt*2-1+1),intent(in),depend(npix,nt) :: waferts
< real(kind=8) dimension(npix),intent(in) :: diff_weight
---
> integer(kind=4) dimension(npix * nt),intent(in) :: waferi1d
> real(kind=8) dimension(npix * nt),intent(in),depend(nt,npix) :: waferpa
> real(kind=8) dimension(2 * npix * nt),intent(in),depend(nt,npix) :: waferts
> real(kind=8) dimension(npix),intent(in),depend(npix) :: diff_weight
44,47c44,47
< integer(kind=4), optional,intent(in),check(len(diff_weight)>=npix),depend(diff_weight) :: npix=len(diff_weight)
< integer(kind=4) intent(in) :: nt
< integer(kind=4) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: wafermask_pixel
< integer(kind=4), optional,intent(in),check(len(d)>=nskypix),depend(d) :: nskypix=len(d)
---
> integer(kind=4), optional,intent(in),check(shape(waferi1d, 0) == npix * nt),depend(waferi1d,nt) :: npix=shape(waferi1d, 0) / nt
> integer(kind=4), optional,intent(in),check(shape(waferi1d, 0) == npix * nt),depend(waferi1d,npix) :: nt=shape(waferi1d, 0) / npix
> integer(kind=4) dimension(npix * nt),intent(in),depend(nt,npix) :: wafermask_pixel
> integer(kind=4), optional,intent(in),check(shape(d, 0) == nskypix),depend(d) :: nskypix=shape(d, 0)
56,59c56,59
< integer(kind=4) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: waferi1d
< real(kind=8) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: waferpa
< real(kind=8) dimension(npix*nt*3*2-1+1),intent(in),depend(npix,nt) :: waferts
< real(kind=8) dimension(npix),intent(in) :: weight4
---
> integer(kind=4) dimension(npix * nt),intent(in) :: waferi1d
> real(kind=8) dimension(npix * nt),intent(in),depend(nt,npix) :: waferpa
> real(kind=8) dimension(6 * npix * nt),intent(in),depend(nt,npix) :: waferts
> real(kind=8) dimension(npix),intent(in),depend(npix) :: weight4
61,64c61,64
< integer(kind=4), optional,intent(in),check(len(weight4)>=npix),depend(weight4) :: npix=len(weight4)
< integer(kind=4) intent(in) :: nt
< integer(kind=4) dimension(npix*nt-1+1),intent(in),depend(npix,nt) :: wafermask_pixel
< integer(kind=4), optional,intent(in),check(len(d0)>=nskypix),depend(d0) :: nskypix=len(d0)
---
> integer(kind=4), optional,intent(in),check(shape(waferi1d, 0) == npix * nt),depend(waferi1d,nt) :: npix=shape(waferi1d, 0) / nt
> integer(kind=4), optional,intent(in),check(shape(waferi1d, 0) == npix * nt),depend(waferi1d,npix) :: nt=shape(waferi1d, 0) / npix
> integer(kind=4) dimension(npix * nt),intent(in),depend(nt,npix) :: wafermask_pixel
> integer(kind=4), optional,intent(in),check(shape(d0, 0) == nskypix),depend(d0) :: nskypix=shape(d0, 0)
70,71c70,72
< ! This file was auto-generated with f2py (version:1.21.5).
< ! See http://cens.ioc.ee/projects/f2py2e/
---
> ! This file was auto-generated with f2py (version:1.22.4).
> ! See:
> ! https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e
We can see that the dependency checks have disappeared in numpy 1.22 (green)! See also numpy/numpy#21892 |
Hum, there seems to be an error with the fortran constructor. If I write: - tod2map_pair_f(d, w, dc, ds, cc, cs, ss, nhit, waferi1d, &
- waferpa, waferts, diff_weight, sum_weight, npix, nt, &
- wafermask_pixel, nskypix)
+ tod2map_pair_f(d, w, dc, ds, cc, cs, ss, nhit, waferi1d, &
+ waferpa, waferts, diff_weight, sum_weight, nt, &
+ wafermask_pixel, npix nskypix) no more error (but the result is wrong...). To be continued... |
Test #65