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

Corrects example of a CLI in the Read the Doc documentation #1673

Merged
merged 5 commits into from
Feb 21, 2022

Conversation

mspelman07
Copy link
Contributor

Addresses https://github.com/metoppv/mo-blue-team/issues/237

Description Corrects the Example of a CLI on the Read the docs page to be a working CLI. Also updates the text below to reflect these changes.

Testing:

  • Ran tests and they passed OK

CLA

  • If a new developer, signed up to CLA

@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #1673 (93aca96) into master (242ce32) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1673   +/-   ##
=======================================
  Coverage   98.19%   98.20%           
=======================================
  Files         110      110           
  Lines       10151    10173   +22     
=======================================
+ Hits         9968     9990   +22     
  Misses        183      183           
Impacted Files Coverage Δ
improver/wxcode/modal_code.py 100.00% <0.00%> (ø)
improver/blending/utilities.py 100.00% <0.00%> (ø)
improver/utilities/cube_checker.py 100.00% <0.00%> (ø)
improver/blending/weighted_blend.py 100.00% <0.00%> (ø)
improver/wxcode/weather_symbols.py 98.47% <0.00%> (+0.02%) ⬆️

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 242ce32...93aca96. Read the comment docs.

Copy link
Contributor

@fionaRust fionaRust left a comment

Choose a reason for hiding this comment

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

A couple of minor comments

* for each threshold specified (5, 10, 15, 20 m/s) a new x-y grid of data will be created. Each point in the grid will contain a 0 if the input wind speed at that point was below the threshold, or 1 if it was above the threshold.
* output_file.nc will be a new netCDF file containing the resulting data cube with an additional leading dimension that corresponds to the given thresholds (5, 10, 15, 20 m/s).
* the threshold units specifies the units of the provided thresholds (m/s) and these will be converted to match the units of the original cube before calculating the probability space.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this quite makes sense. What do you think of the suggestion below instead?

Suggested change
* the threshold units specifies the units of the provided thresholds (m/s) and these will be converted to match the units of the original cube before calculating the probability space.
* the threshold units specifies the units of the provided thresholds (m/s) and these will be converted to match the units of the original cube before thresholding the input cube.

* for each threshold specified (5, 10, 15, 20 m/s) a new x-y grid of data will be created. Each point in the grid will contain a 0 if the input wind speed at that point was below the threshold, or 1 if it was above the threshold.
* output_file.nc will be a new netCDF file containing the resulting data cube with an additional leading dimension that corresponds to the given thresholds (5, 10, 15, 20 m/s).
* the threshold units specifies the units of the provided thresholds (m/s) and these will be converted to match the units of the original cube before calculating the probability space.
* output.nc will be a new netCDF file containing the resulting data cube with an additional leading dimension that corresponds to the given thresholds (5, 10, 15, 20 m/s).

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed when I built the docs that the --help part of this line renders a bit odd. I think it only needs one \ rather than \. Could you fix that too?

@mspelman07 mspelman07 force-pushed the mobt237-ExampleUseofCLIUpdate branch from fc8b98f to 00c4cd8 Compare February 17, 2022 09:53
fionaRust
fionaRust previously approved these changes Feb 17, 2022
Copy link
Contributor

@fionaRust fionaRust left a comment

Choose a reason for hiding this comment

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

Thanks Marcus, this looks good now :)

@@ -67,14 +67,15 @@ Here we give a simple example of using an IMPROVER CLI to threshold data, moving

.. code:: console

bin/improver threshold input_file.nc output_file.nc 5 10 15 20 --threshold_units m/s
bin/improver threshold input.nc --threshold-values 5,10,15,20 --threshold-units m/s --output output.nc


Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth being explicit about the fact that we need to use hyphens in the CLI name instead of underscores? You can't tell with the threshold CLI as it's only one word, but if we took apply_lapse_rate.py then as far as I'm aware we would need to write it as:
bin/improver apply-lapse-rate apply_lapse_rate.py --ouput output.nc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for mention this. I hadn't considered it. I've updated the doc to include a bullet point covering this.

doc/source/about.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@Kat-90 Kat-90 left a comment

Choose a reason for hiding this comment

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

Thanks for the update. Happy to approve

@gavinevans gavinevans merged commit c630416 into metoppv:master Feb 21, 2022
MoseleyS added a commit to MoseleyS/improver that referenced this pull request Mar 2, 2022
* master:
  MOBT127 tiny tweak to filter_realizations (metoppv#1682)
  Mobt 160 ecc masked data (metoppv#1662)
  Convert test_ManipulateReliabilityTable to pytest (metoppv#1678)
  Alter spot extract cli (metoppv#1666)
  Enable site cube input to ConstructReliabilityCalibrationTables (metoppv#1667)
  Corrects example of a CLI in the Read the Doc documentation (metoppv#1673)
  MOBT-211: mosg__model_run attribute handling in weather symbols (metoppv#1670)

# Conflicts:
#	improver_tests/wxcode/wxcode/test_WeatherSymbols.py
fionaRust added a commit that referenced this pull request Mar 9, 2022
* master:
  Remove flawed interpretation of the blend_time coordinate. (#1690)
  DOC: Removal of unnecessary exclusions in sphinx apidoc build (#1689)
  MOBT127 tiny tweak to filter_realizations (#1682)
  Mobt 160 ecc masked data (#1662)
  Convert test_ManipulateReliabilityTable to pytest (#1678)
  Alter spot extract cli (#1666)
  Enable site cube input to ConstructReliabilityCalibrationTables (#1667)
  Corrects example of a CLI in the Read the Doc documentation (#1673)
  MOBT-211: mosg__model_run attribute handling in weather symbols (#1670)
MoseleyS pushed a commit to MoseleyS/improver that referenced this pull request Aug 22, 2024
…1673)

* Update to the Example use of a CLI on ReadtheDocs

* Adding name to Contributing file

* Updates to CLI Example in Read the Docs

* Updates to CLI example

* Updates to CLI example

Co-authored-by: Marcus Spelman <marcus.spelman@metoffice.gov.uk>
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.

4 participants