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

Modifies LightningFromCapePrecip plugin to accept 3h precipitation-rate-max data #1568

Merged
merged 3 commits into from
Sep 28, 2021

Conversation

MoseleyS
Copy link
Contributor

Addresses #1518

We need this so we can generate data for days 6-8 when only 3h data are available.

Testing:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

…te-max data

- We need this so we can generate data for days 6-8 when only 3h data are available.
@MoseleyS MoseleyS added this to the 1.0.0 milestone Sep 27, 2021
@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #1568 (f337a01) into master (6310ed4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1568   +/-   ##
=======================================
  Coverage   97.96%   97.96%           
=======================================
  Files         107      107           
  Lines        9567     9567           
=======================================
  Hits         9372     9372           
  Misses        195      195           
Impacted Files Coverage Δ
improver/lightning.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6310ed4...f337a01. Read the comment docs.

@gavinevans gavinevans added the FY21/22 New Outputs Owned by Stephen with Katie and Kat as a buddies label Sep 27, 2021
Copy link
Contributor

@gavinevans gavinevans left a comment

Choose a reason for hiding this comment

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

Thanks @MoseleyS 👍

I've added a few minor comments.

improver_tests/lightning/test_LightningFromCapePrecip.py Outdated Show resolved Hide resolved
@@ -74,7 +74,8 @@ def _get_inputs(cubes: CubeList) -> Tuple[Cube, Cube]:
"""
Separates CAPE and precipitation rate cubes and checks that the following
match: forecast_reference_time, spatial coords, time-bound interval and
that CAPE time is exactly one hour older than precipitation rate time.
that CAPE time is at the lower bound of precipitation rate time.
Copy link
Contributor

Choose a reason for hiding this comment

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

As a note, and unrelated to this PR, the acceptance tests for the lightning_from_cape_and_precip.py CLI are currently failing due a mismatch in the units for the number_of_lightning_flashes_per_unit_area coordinate i.e. m-2 vs s-1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Final tweak from #1550 hadn't been committed and merged - it has now.

- Improves tests and doc-strings
@@ -142,6 +143,7 @@ def test_3d_cubes(cape_cube, precip_cube, expected_cube):
assert np.allclose(result.data, expected_cube.data)



Copy link
Contributor

Choose a reason for hiding this comment

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

Black is currently failing and it's probably because of this blank line.

Copy link
Contributor

@bayliffe bayliffe left a comment

Choose a reason for hiding this comment

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

This looks fine, and all the tests pass. I've nothing to add.

@bayliffe bayliffe merged commit 38b2ee5 into metoppv:master Sep 28, 2021
MoseleyS added a commit to MoseleyS/improver that referenced this pull request Oct 5, 2021
* bayliffe/mobt77:
  Review changes. Acceptance test added.
  Add type-hinting throughout.
  Formatting.
  Adding unit tests.
  Grouping solution and rename.
  First draft of a modal symbol plugin.
  Modifies LightningFromCapePrecip plugin to accept 3h precipitation-rate-max data (metoppv#1568)
  Moves position of land-sea-mask in threshold CLI (metoppv#1565)
  Re-label a diagnostic as a period diagnostic (metoppv#1561)
  Adds LatitudeThreshold plugin and lightning-filter CLI (metoppv#1550)
  Adds land-mask option to threshold CLI (metoppv#1559)
  Move statsmodels in environment yml files (metoppv#1556)
  rearranged args (metoppv#1558)
  Update Code-Style-Guide.rst (metoppv#1554)
  Updating timezone cli call (metoppv#1551)
@MoseleyS MoseleyS deleted the 1518_lightning_from_3h_data branch July 19, 2024 10:29
MoseleyS added a commit to MoseleyS/improver that referenced this pull request Aug 22, 2024
…te-max data (metoppv#1568)

* Modifies LightningFromCapePrecip plugin to accept 3h precipitation-rate-max data

- We need this so we can generate data for days 6-8 when only 3h data are available.

* First review

- Improves tests and doc-strings

* Black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY21/22 New Outputs Owned by Stephen with Katie and Kat as a buddies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants