Skip to content
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

Remove biggus test skipper: fix pp field data #2473

Merged
merged 2 commits into from
Apr 6, 2017

Conversation

lbdreyer
Copy link
Member

This PR removes a single skip_biggus test skipper.

Work done:

  • In the test I now set and check the fill_value on the cube rather on the cube.data.fill_value itself (the fill_value on the data is no longer considered by Iris).
  • I get/set the field bmdi using the cube.fill_value, regardless of whether or not it is masked data (someone may have real unmasked data but still want a bmdi set)
  • When realising a field's data it returns a masked array not an nd array with the nans filled with the bmdi
  • I also had to fix the reference text file of the pp file as the repr of a field's data has changed (it used to be this)

@lbdreyer
Copy link
Member Author

lbdreyer commented Mar 31, 2017

Tests are failing because, in those tests, the cube has a fill value of 9999.0 so iris is now setting the bmdi to be that rather than the default bmdi.

The failing tests were

  • iris.tests.test_cube_to_pp.TestPPSave.test_pp_append_singles
    ** uses stock.simple_pp() which uses filename = tests.get_data_path(['PP', 'simple_pp', 'global.pp'])

  • iris.tests.test_cube_to_pp.TestPPSave.test_pp_save_rules
    ** uses in_filename = tests.get_data_path(('PP', 'simple_pp', 'global.pp'))

  • iris.tests.test_cube_to_pp.TestPPSave.test_user_pp_save_rules
    ** uses in_filename = tests.get_data_path(('PP', 'simple_pp', 'global.pp'))

and using iris/master

>>> import iris.fileformats.pp as pp
>>> fields = list(pp.load(<path_to_test_data>/test_data/PP/simple_pp/global.pp'))
>>> print len(fields)
1
>>> print fields[0].bmdi
9999.0

@lbdreyer
Copy link
Member Author

lbdreyer commented Apr 5, 2017

@marqh @corinnebosley Could you take a look at this PR?

I would like this merged in as I have some upcoming PRs based off this work (but makes more sense to be in a separate PR)

@marqh
Copy link
Member

marqh commented Apr 6, 2017

@lbdreyer this makes sense to me, based on the updated fill_value handling in the Cube API

@marqh marqh merged commit c0a77b7 into SciTools:dask Apr 6, 2017
bjlittle pushed a commit to bjlittle/iris that referenced this pull request May 31, 2017
* pp save return field's data as masked array; fix test to check fill value of cube not data, and cube's dtype

* Fix bmdis of fields that were saved from global.pp test data
@QuLogic QuLogic modified the milestones: dask, v2.0 Aug 2, 2017
@lbdreyer lbdreyer deleted the biggus_skip_pp_save branch July 23, 2018 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants