GithubHelp home page GithubHelp logo

Fix iris (>2) warnings about esmvalcore HOT 10 CLOSED

esmvalgroup avatar esmvalgroup commented on August 27, 2024 2
Fix iris (>2) warnings

from esmvalcore.

Comments (10)

schlunma avatar schlunma commented on August 27, 2024 1

Right now I'm using numpy 1.16.4 and iris 2.2.1, but I suppose this has changed since I initially created this issue.

from esmvalcore.

stefsmeets avatar stefsmeets commented on August 27, 2024 1

Is this still relevant when we are now working on iris3? #378 #819

from esmvalcore.

zklaus avatar zklaus commented on August 27, 2024 1

Cheers for the heads-up, @bjlittle

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on August 27, 2024

here's one more

WARNING /home/users/valeriu/anaconda3Feb19/envs/esmvaltool/lib/python3.7/site-packages/ESMValTool-2.0a1-py3.7.egg/esmvaltool/preprocessor/_regrid.py:355: FutureWarning: Conversion of the second argument of issubdtype from `int` to `np.signedinteger` is deprecated. In future, it will be treated as `np.int64 == np.dtype(int).type`.
  extrapolation=extrapolation)

from esmvalcore.

bascrezee avatar bascrezee commented on August 27, 2024

/numpy/ma/core.py:3174: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result.

Some additional information on this warning, that you reported already. I also came across it while working on: ESMValGroup/ESMValTool#1200
This warning can be reproduced easily like this (taken from Stackoverflow )

x = np.zeros((4,2))
x[slice(None),1]    # works
x[[slice(None),1]]  # raises Warning

It should be fixed in latest Iris, see SciTools/iris#3212.

from esmvalcore.

bjlittle avatar bjlittle commented on August 27, 2024

@schlunma What versions of iris and numpy are you guys using?

I'm looking to re-haul the amount of warnings that iris generates, which is over verbose as far as I'm concerned.

from esmvalcore.

bascrezee avatar bascrezee commented on August 27, 2024

Warnings like this appear very often in the preprocessor. Most likely it's because of the cell_measures attribute in the raw cubes (e.g. tas:cell_measures = "area: areacella"). Would it break something if we removed this attribute?

@bouweandela what do you think? Removing this attribute? Or maybe filtering out the warnings at the top level (is that possible?), since according to @schlunma ESMValTool is designed like this on purpose and the warning is therefore not relevant at any level within ESMValTool. Is that correct?

from esmvalcore.

bouweandela avatar bouweandela commented on August 27, 2024

@bjlittle is planning to build support for it into iris, see SciTools/iris#3329.

If that works out, the solution should be as simple as loading both files at the same time:

>>> import iris
>>> iris.load(["/badc/cmip5/data/cmip5/output1/BCC/bcc-csm1-1/historical/fx/atmos/fx/r0i0p0/latest/areacella/areacella_fx_bcc-csm1-1_historical_r0i0p0.nc", "/badc/cmip5/data/cmip5/output1/BCC/bcc-csm1-1/historical/mon/atmos/Amon/r1i1p1/latest/tas/tas_Amon_bcc-csm1-1_historical_r1i1p1_185001-201212.nc"])
/group_workspaces/jasmin2/cp4cds1/magic-test/tmp-bandela/version2_development/conda/envs/esmvaltool/lib/python3.6/site-packages/iris/fileformats/cf.py:798: UserWarning: Missing CF-netCDF measure variable 'areacella', referenced by netCDF variable 'tas'
  warnings.warn(message % (variable_name, nc_var_name))
[<iris 'Cube' of air_temperature / (K) (time: 1956; latitude: 64; longitude: 128)>,
<iris 'Cube' of cell_area / (m2) (latitude: 64; longitude: 128)>]

(note that this currently does not work yet).

Maybe we could filter the warning until support is implemented?

from esmvalcore.

zklaus avatar zklaus commented on August 27, 2024

I think this issue is obsolete now; closing. @schlunma, please reopen if you feel otherwise.

from esmvalcore.

bjlittle avatar bjlittle commented on August 27, 2024

BTW we're going to be moving to logging for iris 3.1, which will silence, finally, all/most of the warning messages 👍

from esmvalcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.