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 histogram convenience for passing Iris objects to plt.hist #5189

Merged
merged 4 commits into from
Mar 17, 2023

Conversation

lbdreyer
Copy link
Member

@lbdreyer lbdreyer commented Mar 9, 2023

Closes #3330

This adds a simple convenience function for creating histograms with Iris objects.
iris.plot.hist and iris.quickplot.hist takes Iris objects (cube, coords, cell measures and ancil vars) extract the values from the objects and passes it onto plt.hist

Note most of our plotting stuff only handles cubes/coords, but I have included other dimensional metadata objects.

This PR requires the graphics tests results to be merged in: SciTools/iris-test-data#84

lib/iris/quickplot.py Outdated Show resolved Hide resolved
@trexfeathers
Copy link
Contributor

BTW @rcomer if you feel this is in scope for your work and you have time then we're a little short on reviewers this week... 🥰

But I understand if not.

@rcomer
Copy link
Member

rcomer commented Mar 9, 2023

Sorry I don’t have capacity for reviewing at the moment.

pp-mo added a commit to pp-mo/iris that referenced this pull request Mar 10, 2023
pp-mo added a commit to pp-mo/iris that referenced this pull request Mar 10, 2023
Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Great! Thanks @lbdreyer this is a neat addition to make users' lives easier.

A couple of iris-test-data references need changing to 2.19:

env:
IRIS_TEST_DATA_VERSION: "2.18"
ENV_NAME: "ci-tests"

env:
IRIS_TEST_DATA_LOC_PATH: benchmarks
IRIS_TEST_DATA_PATH: benchmarks/iris-test-data
IRIS_TEST_DATA_VERSION: "2.18"
# Lets us manually bump the cache to rebuild
ENV_CACHE_BUILD: "0"
TEST_DATA_CACHE_BUILD: "2"
PY_VER: 3.8

docs/src/whatsnew/latest.rst Outdated Show resolved Hide resolved
lib/iris/plot.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage: 95.00% and no project coverage change.

Comparison is base (e2dc89c) 89.26% compared to head (ba6fc7a) 89.27%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5189   +/-   ##
=======================================
  Coverage   89.26%   89.27%           
=======================================
  Files          88       88           
  Lines       22233    22253   +20     
  Branches     4863     4867    +4     
=======================================
+ Hits        19847    19866   +19     
  Misses       1641     1641           
- Partials      745      746    +1     
Impacted Files Coverage Δ
lib/iris/quickplot.py 89.58% <92.30%> (+0.27%) ⬆️
lib/iris/plot.py 87.10% <100.00%> (+0.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lbdreyer
Copy link
Member Author

Thanks for the review @trexfeathers !
I believe I have now actioned your comments

@trexfeathers trexfeathers merged commit d099f93 into SciTools:main Mar 17, 2023
@BenMGeo
Copy link

BenMGeo commented Mar 23, 2023

Thank you for adding this. ❤️

tkknight added a commit to tkknight/iris that referenced this pull request Apr 4, 2023
* upstream/main: (274 commits)
  Cf cell method (SciTools#5224)
  Bump scitools/workflows from 2023.03.3 to 2023.04.1 (SciTools#5231)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5230)
  Bump scitools/workflows from 2023.03.2 to 2023.03.3 (SciTools#5227)
  raise dask min pin (SciTools#5225)
  Enable lazy computation of wind vector rotation (SciTools#4972)
  Benchmark runner script (SciTools#5215)
  add locks readme (SciTools#5222)
  use explicit version for ci refresh-lockfiles gha (SciTools#5221)
  SciTools#5180 do not run publish-to-test-pypi on forks (SciTools#5220)
  Fix Makefile for consequences of SciTools#5204. (SciTools#5217)
  Bump actions/stale from 7 to 8 (SciTools#5208)
  Remove Iris' TestRunner (SciTools#5205)
  standardize requirements structure (SciTools#5204)
  Updated environment lockfiles (SciTools#5199)
  Add histogram convenience for passing Iris objects to plt.hist (SciTools#5189)
  Updated environment lockfiles (SciTools#5192)
  announce new contributor in whatsnew (SciTools#5198)
  iris.util.new_axis anonymous new dimension fix (SciTools#5194)
  Lockfiles and pydata-sphinx-theme fix (SciTools#5188)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Support iris.plot.hist and iris.quickplot.hist
4 participants