Skip to content

String stash code silently ignored on pp-save #6239

@rcomer

Description

@rcomer

🐛 Bug Report

Before saving to pp-file, a user may have reason to modify or add a stash code. If the code is added in the string form, it is silently ignored.

How To Reproduce

Steps to reproduce the behaviour:

  1. Run code
import iris

fname = iris.sample_data_path('air_temp.pp')
cube = iris.load_cube(fname)

cube.attributes['STASH'] = 'm01s34i001'

iris.save(cube, 'test.pp')
  1. Inspect the file test.pp.

  2. The stash code in the file is zero.

Expected behaviour

Either the stash code in the file is 34001 or I get a type error because I should have used a STASH object instead of a string.

Screenshots

Environment

  • OS & Version: RHEL9 🎉
  • Iris Version: 3.11

Additional context

Click to expand this section...
Please add additional verbose information in this section e.g., code, output, tracebacks, screenshots etc

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions