Skip to content

Conversation

@sadielbartholomew
Copy link
Member

Closes #315. For the need for a quite specific dataset to test against and lack of bandwidth before we are due to do the new release set, I am not adding a test to capture the bug, which I appreciate is not ideal but there is a test in the new cf-plot suite which exposed this, which I think is good enough*.

*This involves updating the code snippet for the appropriate cf-plot example, where the field indexing seems to have changed so that I've matched the relevant fields like so to update it to work with this branch, whereas before it hit the error covered in the associated issue on the initial read:

>>> f = cf.read("/home/slb93/git-repos/cf-plot/cfplot/test/cfplot_data/lfric_initial.nc")
There was a problem parsing the UGRID mesh topology variable. Ignoring the UGRID mesh for 'u1'.
There was a problem parsing the UGRID mesh topology variable. Ignoring the UGRID mesh for 'u2'.
>>> pot = f.select_by_identity("air_potential_temperature")[0]
>>> lats = f.select_by_identity("latitude")[0]
>>> lons = f.select_by_identity("longitude")[0]
>>> faces = f.select_by_identity("cf_role=face_edge_connectivity")[1]  # try second of two
>>> pot_crop = pot[4,:]  # reduce
>>> cfp.con(f=pot_crop, face_lons=lons, face_lats=lats, face_connectivity=faces, lines=False)

Copy link
Contributor

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sadie. All good. Sorry for the delay, Please merge!

@davidhassell davidhassell added this to the NEXT RELEASE milestone Jan 29, 2025
@sadielbartholomew
Copy link
Member Author

No worries David. Thanks, merging..

@sadielbartholomew sadielbartholomew merged commit c35f1c7 into NCAS-CMS:main Jan 29, 2025
@sadielbartholomew sadielbartholomew deleted the ugrid-read branch January 29, 2025 11:47
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.

Unable to read some unstructured datasets (UnboundLocalError)

2 participants