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 skeleton for generation of derived solar fields for RainForests #1705

Merged

Conversation

benowen-bom
Copy link
Contributor

@benowen-bom benowen-bom commented Apr 28, 2022

This PR adds a skeleton for CLIs and plugins for generation of derived solar fields that are required as inputs for RainForests calibration of precipitation accumulations.

Future PRs following on from this will add in functionality and tests, however the CLI interfaces should remain unchanged from those presented herein.

Testing:

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

CLA

  • If a new developer, signed up to CLA

@benowen-bom benowen-bom changed the title Rainforest derived fields skeleton Add skeleton for generation of derived solar fields for RainForests Apr 28, 2022
@codecov
Copy link

codecov bot commented Apr 28, 2022

Codecov Report

Merging #1705 (25a1271) into master (51644de) will decrease coverage by 0.02%.
The diff coverage is 89.28%.

@@            Coverage Diff             @@
##           master    #1705      +/-   ##
==========================================
- Coverage   98.15%   98.13%   -0.03%     
==========================================
  Files         110      111       +1     
  Lines       10162    10190      +28     
==========================================
+ Hits         9975    10000      +25     
- Misses        187      190       +3     
Impacted Files Coverage Δ
...erate_ancillaries/generate_derived_solar_fields.py 89.28% <89.28%> (ø)

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 51644de...25a1271. Read the comment docs.

Copy link
Contributor

@tjtg tjtg left a comment

Choose a reason for hiding this comment

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

This is a good starting point for bringing these derived solar fields used by RainForests into IMPROVER. I've made a few comments, mostly around the CLI and plugin interface.

@tjtg tjtg added the MO review required PRs opened by non-Met Office developers that require a Met Office review label Apr 29, 2022
@tjtg
Copy link
Contributor

tjtg commented Apr 29, 2022

Codecov is currently "failing" as it expects every PR to have line coverage at least equal to the project-wide coverage (currently ~98%). Personally, I think that's an excessive requirement and would prefer codecov to present the information then let reviewers decide whether test coverage is appropriate or not.

There seems to be a way to configure a lower threshold - see codecov docs. I'll look at creating a PR for that configuration change next week.

@tjtg
Copy link
Contributor

tjtg commented May 4, 2022

I'm happy with this now - ready for a second reviewer to take a look.

@benowen-bom
Copy link
Contributor Author

I'm happy with this now - ready for a second reviewer to take a look.

Great. Thanks for help on improving this!

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.

A few comments to consider. Thanks.

improver/cli/generate_solar_time.py Show resolved Hide resolved
improver/cli/generate_clearsky_solar_radiation.py Outdated Show resolved Hide resolved
improver/cli/generate_clearsky_solar_radiation.py Outdated Show resolved Hide resolved
improver/cli/generate_clearsky_solar_radiation.py Outdated Show resolved Hide resolved
improver/cli/generate_clearsky_solar_radiation.py Outdated Show resolved Hide resolved
@benowen-bom benowen-bom force-pushed the rainforest_derived_fields_skeleton branch from 6ed1701 to 3fa2414 Compare May 5, 2022 04:25
@benowen-bom benowen-bom requested a review from tjtg May 5, 2022 04:25
@benowen-bom
Copy link
Contributor Author

@tjtg Based on @bayliffe review, a few things have changed (and been added), so I think it would be worthwhile for you to have another look at this.

@bayliffe
Copy link
Contributor

bayliffe commented May 5, 2022

A couple more tiny things, but I'm otherwise happy with this now. Thanks again.

Copy link
Contributor

@tjtg tjtg left a comment

Choose a reason for hiding this comment

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

I've had another look through and all looks good now. @bayliffe, please check you're happy with those last few remaining items and update your review status when you're ready.

@bayliffe bayliffe merged commit f52049f into metoppv:master May 6, 2022
MoseleyS pushed a commit to MoseleyS/improver that referenced this pull request Aug 22, 2024
…etoppv#1705)

* Add modules to evaluate the derived solar fields.

* Fill out Solar-time CLI, and add skeleton GenerateSolarTime Plugin.

* Fill out Clearsky solar-radiation CLI, and add skeleton GenerateClearskySolarRadiation Plugin.

* Update docstrings.

* Fix license.

* Assume single valid time for linke turbidity rather than climatology.

* Add modules to evaluate the derived solar fields.

* Fix license.

* Update typing in CLIs.

* Linting.

* Update temporal_spacing typing.

* Add datetime value converter.

* Update contributors list.

* Update interfaces to reflect logic around default values for alitude and linke-turbidity.

* Add function to create cube from target grid.

* Change to using create_new_diagnostic_cube.

* Formatting changes.

* Replace altitude by surface_altitude.

* Update docstring for temporal_spacing.

* Reorder args to ensure cubes are bucnhed together in the interface.

* Change time to named arg to bring into line with other CLIs.

* Move initialisation of default cubes into plugin.

* Add unit tests for _initialise_input_cubes.

* Typo and linting fix.

* Update docstrings and fix typo, as per reviewer comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MO review required PRs opened by non-Met Office developers that require a Met Office review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants