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

Mesh nonexperimental #6061

Merged
merged 7 commits into from
Jul 25, 2024
Merged

Mesh nonexperimental #6061

merged 7 commits into from
Jul 25, 2024

Conversation

pp-mo
Copy link
Member

@pp-mo pp-mo commented Jul 18, 2024

Addresses #6057

WIP will need some rebase when outstanding changes are merged :

Also remaining

tidying to-do :

  • re-integrate various 'extra' code elements back into legacy sourcefiles
    • ugrid.cf --> iris.fileformats.cf
    • ugrid.load --> iris.fileformats.netcdf.loader
    • ugrid.save --> iris.fileformats.netcdf.saver
    • ugrid.metadata--> iris.common.metadata
  • that leaves ugrid.mesh and ugrid.utils in place,
    • which we should probably rename as iris.mesh and iris.mesh.utils

For simplicity, I'm going to defer that to another PR : see #6073

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 16 lines in your changes missing coverage. Please review.

Project coverage is 89.69%. Comparing base (304c5e0) to head (f8b7644).
Report is 1 commits behind head on main.

Files Patch % Lines
lib/iris/experimental/ugrid.py 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6061      +/-   ##
==========================================
- Coverage   89.75%   89.69%   -0.07%     
==========================================
  Files          90       91       +1     
  Lines       22981    22997      +16     
  Branches     5026     5026              
==========================================
  Hits        20627    20627              
- Misses       1624     1640      +16     
  Partials      730      730              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pp-mo
Copy link
Member Author

pp-mo commented Jul 19, 2024

Status update 2024-07-19 ~15:30

lots of conflicts with main now.
above outstanding PRs to merge, will presumably create more, so holding off for now.

@pp-mo pp-mo linked an issue Jul 19, 2024 that may be closed by this pull request
@pp-mo
Copy link
Member Author

pp-mo commented Jul 19, 2024

Status update 2024-07-19 ~1900

rebased + resolved conflicts
needs to be reconciled with #6054 which is still outstanding

Status 2024-07-22

now up-to-date with latest main, and passing.
Still items to complete, as listed in header above. Deciding whether to split these subsequent changes into a separate PR for easier review.

@pp-mo pp-mo force-pushed the mesh_nonexperimental branch 4 times, most recently from 99308cd to 15d4f84 Compare July 22, 2024 14:53
@pp-mo pp-mo marked this pull request as ready for review July 22, 2024 16:12
@pp-mo pp-mo marked this pull request as draft July 22, 2024 16:52
@pp-mo
Copy link
Member Author

pp-mo commented Jul 22, 2024

Status 2024-07-22 ~17:30

Found that benchmark code also needs updating to new module path AND removal of PARSE_UGRID_ON_LOAD
Converted back to draft

What's left to do

  1. Reintegrate code which was separated for optional ugrid #6073 As explained at top, the original brief says to re-integrate all the bits of code which delivered the switchable UGRID support

    • probably do in separate PR
    • (and one more thing) this PR leaves code full of placeholders like:
      "TODO: rationalise UGRID/mesh handling once iris.ugrid is folded"
      "TODO: complete iris.ugrid replacement"
      so, remove all those
  2. but also, as just discovered, the benchmark code was missed out in Enable UGRID loading always; deprecate PARSE_UGRID_ON_LOAD. #6054, and also from the patch changes here

    • probably do that here

@bjlittle bjlittle self-assigned this Jul 23, 2024
@bjlittle bjlittle self-requested a review July 23, 2024 09:14
@pp-mo pp-mo marked this pull request as ready for review July 23, 2024 12:18
@pp-mo
Copy link
Member Author

pp-mo commented Jul 23, 2024

?ready for review?

This roughly hangs together + worth reviewing now.

Though notably, the benchmarks need updating, and I have plans to refactor + (further) rename the API.
(iris.ugrid --> iris.mesh; review what parts are public at top level, and what should be demoted to sub-modules)
Follow-on work is currently being prototyped in #6077

@pp-mo
Copy link
Member Author

pp-mo commented Jul 23, 2024

Hmm benchmarks show a worrying thing..
#6080 (comment)

It's not a fluke, I only did this because of #6075
As it seems to scale, we definitely need to investigate.

Copy link
Member

@bjlittle bjlittle left a comment

Choose a reason for hiding this comment

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

@pp-mo Awesome effort 👍

Just a few TODO comments as reminders to address afterwards 👍

As an aside, I noticed that we're pulling the use of the logger across from iris.experimental.ugrid into the iris core. Not sure about our current appetite on the use of logging ATM, but seems like tech debt to me, but that's an out of scope discussion.

Also, with regards to API, rebranding iris.ugrid as iris.mesh is fine from my perspective to be more future UGRID agnostic. However, that means we'd have iris.mesh.mesh which is less than ideal.

In this case, I'd recommend incorporating the iris.ugrid.mesh into __init__.py of iris.ugrid and then rebrand 👍

Otherwise, all good, but there is an iris.tests.stock.__init__ comment to check and service 👍

lib/iris/common/metadata.py Show resolved Hide resolved
lib/iris/coords.py Show resolved Hide resolved
lib/iris/experimental/ugrid.py Show resolved Hide resolved
lib/iris/fileformats/cf.py Show resolved Hide resolved
lib/iris/fileformats/cf.py Show resolved Hide resolved
lib/iris/tests/unit/ugrid/utils/__init__.py Show resolved Hide resolved
lib/iris/ugrid/load.py Show resolved Hide resolved
@pp-mo
Copy link
Member Author

pp-mo commented Jul 25, 2024

OK finally I pushed, think I have covered those changes.
I intend to fix all the "carried over" TODOs in a followup PR, and also add a whats-new entry.

@bjlittle please re-review !

@bjlittle bjlittle enabled auto-merge (squash) July 25, 2024 11:19
Replace experiment.ugrid, including docstrings and imports.

Fix test_ParseUgridOnLoad

Fix ugrid.load.

Remove PARSE_UGRID from t/i/ugrid/test_ugrid_save

Remove PARSE_UGRID from t/u/ff/nc/saver/test_save

Remove PARSE_UGRID from t/i/exp/geovista/(both)

Remove PARSE_UGRID from t/u/tests/stock/test_netcdf
Include alternative index workaround.
@bjlittle bjlittle merged commit 7c87fb2 into SciTools:main Jul 25, 2024
20 checks passed
@pp-mo
Copy link
Member Author

pp-mo commented Jul 25, 2024

Thanks so much @bjlittle

And the good news ... the next one might be worse !
(cos moving+renaming stuff is still so hard to manage)

@bjlittle
Copy link
Member

And the good news ... the next one might be worse !

@pp-mo Bring it! You da man 😄

pp-mo added a commit to pp-mo/iris that referenced this pull request Jul 25, 2024
@pp-mo pp-mo mentioned this pull request Jul 26, 2024
bjlittle pushed a commit that referenced this pull request Jul 26, 2024
* Move all iris.experimental.ugrid to iris.ugrid.

Replace experiment.ugrid, including docstrings and imports.

Fix test_ParseUgridOnLoad

Fix ugrid.load.

Remove PARSE_UGRID from t/i/ugrid/test_ugrid_save

Remove PARSE_UGRID from t/u/ff/nc/saver/test_save

Remove PARSE_UGRID from t/i/exp/geovista/(both)

Remove PARSE_UGRID from t/u/tests/stock/test_netcdf

* Fix type of mesh in iris.tests.stock

* Fix Mesh -> MeshXY in experimental.ugrid

* Remove PARSE_UGRID_ON_LOAD and ParseUGridOnLoad, leave in iris.experimental.ugrid only.

missed

* Replace old-style mesh api in benchmarks.

* Move misplaced test + fix obsolete PARSE_UGRID usage.

* Minimal doctest fixes

* Remove obsolete PARSE_UGRID in iris.ugrid

* Move all ugrid.metadata into common.metadata.

Removed obsolete tests.unit.metadata

* Rename iris.ugrid to iris.mesh

fix

Fix iris.mesh import in tests/stock/__init__

* Move all iris.mesh.save into iris.fileformats.netcdf.save

Fix experimental.ugrid import of save_mesh

* Fix docs for iris.ugrid -> iris.mesh

* Rename iris.mesh.mesh as iris.mesh.components

* Tidy imports in experimental.ugrid

* Rebrand so mesh.MeshXY is presented as experimental.ugrid.Mesh.

* Move ugrid loading support code from iris.mesh to iris.netcdf, and its tests likewise

* Fix circular import.

* Move mesh.cf code into fileformats.cf, and tests likewise

Fix imports in cf ugrid tests.

* Reinclude mesh-load functions in iris.mesh; break circular imports

* Small fixes to mesh documentation

* Added whatsnew

* Complete+remove remaining 'TODO's from #6061

* Odd docstring and comment corrections.
stephenworsley added a commit to stephenworsley/iris that referenced this pull request Jul 26, 2024
* main:
  Mesh nonexperimental extra (SciTools#6077)
  Mesh nonexperimental (SciTools#6061)

# Conflicts:
#	lib/iris/experimental/ugrid/cf.py
tkknight added a commit to tkknight/iris that referenced this pull request Jul 30, 2024
* upstream/main:
  Load performance improvement (ignoring UGRID) (SciTools#6088)
  Adding monthly and yearly arguments to `guess_bounds` (SciTools#6090)
  Mesh nonexperimental extra (SciTools#6077)
  Mesh nonexperimental (SciTools#6061)
  Bump scitools/workflows from 2024.07.4 to 2024.07.5 (SciTools#6076)
  Updated environment lockfiles (SciTools#6068)
  Enable UGRID loading always; deprecate PARSE_UGRID_ON_LOAD. (SciTools#6054)
  Bump scitools/workflows from 2024.07.3 to 2024.07.4 (SciTools#6071)
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.

remove ugrid from experimental
2 participants