Test newer Numpy versions#66
Open
JulienPeloton wants to merge 9 commits into
Open
Conversation
Owner
Author
|
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 |
Owner
Author
|
@gfabbian -- as a temporary fix, you can still use numpy 1.21 with python 3.9 ;-) |
Owner
Author
|
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 |
Owner
Author
|
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... |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test #65