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

Add planar horizontal viz #33

Merged
merged 9 commits into from
Apr 14, 2023
Merged

Conversation

cbegeman
Copy link
Collaborator

@cbegeman cbegeman commented Apr 11, 2023

This PR ports the plot_horiz_field function from compass/ocean/tests/isomip_plus/viz/__init__.py into a shared viz folder. There are relatively minor changes related to this being used outside plot_horiz_series and making the figure size match the domain aspect ratio. To demonstrate its functionality, it is added to the initial_state step of the baroclinic_channel test case.

Two functions are also needed:

  • _remove_boundary_edges_from_mask makes sure that the periodic edges are not included (those polygons would span from one edge of the periodic domain to the other and obscure the other polygons)
  • _compute_cell_patches is a direct port from compass/ocean/tests/isomip_plus/viz/__init__.py
  • _compute_edge_patches is a new function analogous to _compute_cell_patches

Checklist

  • Developer's Guide has been updated
  • API documentation in the Developer's Guide (api.md) has any new or modified class, method and/or functions listed
  • Documentation has been built locally and changes look as expected
  • Testing comment in the PR documents testing used to verify the changes

@cbegeman
Copy link
Collaborator Author

cbegeman commented Apr 11, 2023

Testing

I have run the baroclinic_channel/10km/default test case on compy.

Initial temperature

Final normalVelocity (when test is run for 1 day)

@cbegeman
Copy link
Collaborator Author

@xylar You can review the scripts now if you like. I'm sure there are ways that we could make them better, but I think this is a reasonable level of effort given that these are temporary files for the hackathon. Let me know if you feel differently. I haven't added the documentation yet, but will.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Yep, this is fantastic! A few more tiny changes.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

A few more. Sorry these keep coming in in small batches. I just keep thinking I'm done and then playing with the code a bit more.

@cbegeman
Copy link
Collaborator Author

@xylar I added some text to the developer's guide. I'm not sure whether/how to update the api though when the function is located in polaris/viz/__init__.py. It doesn't appear to recognize polaris.viz as a module

@xylar
Copy link
Collaborator

xylar commented Apr 14, 2023

Great! The API needs to be added in an appropriate spot (maybe alphabetically somehow) here https://github.com/E3SM-Project/polaris/blob/main/docs/developers_guide/api.md

@xylar
Copy link
Collaborator

xylar commented Apr 14, 2023

I should go after validate and before yaml here:
https://github.com/E3SM-Project/polaris/blob/main/docs/developers_guide/api.md?plain=1#L328-L355
Maybe you can fix the second validate, which should be yaml while you're there?

@cbegeman
Copy link
Collaborator Author

@xylar Thanks! That did the trick

@cbegeman
Copy link
Collaborator Author

@xylar Now that the docs are done it is ready to be merged, unless you have more feedback.

@xylar xylar added enhancement New feature or request framework Changes relating to the polaris framework as opposed to individual tests or analysis labels Apr 14, 2023
Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Looks great! Go ahead and merge with the green button!

@cbegeman cbegeman merged commit 843f7f1 into E3SM-Project:main Apr 14, 2023
@xylar
Copy link
Collaborator

xylar commented Apr 15, 2023

@cbegeman, I missed this in my review but it looks like the 2 images you refer to in the docs didn't actually get added. Could you make a quick PR to add them when you get a chance?

@xylar
Copy link
Collaborator

xylar commented Apr 15, 2023

Never mind, I just added them in #38. I used the 2 images above. I hope that's what you had in mind.

@cbegeman cbegeman deleted the add-planar-viz branch May 16, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request framework Changes relating to the polaris framework as opposed to individual tests or analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants