-
Notifications
You must be signed in to change notification settings - Fork 89
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
Calc temperature after latent heat release #1739
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1739 +/- ##
==========================================
+ Coverage 98.17% 98.22% +0.05%
==========================================
Files 113 115 +2
Lines 10347 10699 +352
==========================================
+ Hits 10158 10509 +351
- Misses 189 190 +1
Continue to review full report at Codecov.
|
…ts, but this needs more work to get the right answers.
…est results accordingly
…perature and uses it.
…d renames test modules to match.
…rations as required for global data
53f5812
to
88f3984
Compare
- Ensures saturated_humidity returns input dtype - Describes behaviour for subsaturated data in doc-strings - Renamed new method to `adjust_for_latent_heat` (much more descriptive) - Inproves doc-string for `qsat_differential` method - Asserts new tests check for float32 data - Parametrizes tests for `calculate_latent_heat`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few requests. I might play with this some more when it comes back to me, but I think it is working as expected. Extended documentation around any new methods would be great; we could really improve the docs around psychrometric calculations more generally, but that's future work.
improver/psychrometric_calculations/psychrometric_calculations.py
Outdated
Show resolved
Hide resolved
improver/psychrometric_calculations/psychrometric_calculations.py
Outdated
Show resolved
Hide resolved
improver_tests/psychrometric_calculations/test_psychrometric_calculations.py
Outdated
Show resolved
Hide resolved
improver_tests/psychrometric_calculations/test_psychrometric_calculations.py
Show resolved
Hide resolved
…Makes tiny change to expected values.
@MoseleyS can you fix the broken unit tests please, and generate a ticket about extending the psychrometric calculations documentation for future work. |
- Ensures tests from the old method are copied to the new, even though one of them wasn't useful. - Existing test results slightly changed due to use of `np.maximum(svp, pressure)`
…point is unchanged
…maximum(svp, pressure)`
295c34b
to
eae5cf6
Compare
self.temperature, pressure | ||
) | ||
self.assertArrayAlmostEqual(result, expected, decimal=7) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem with this section of code, but I was checking the rest of it had everything removed that needed to be (couldn't comment on that line). On line 94, the mixing ratio cube is set for the new Test_WetBulbTemperature class and I don't think it's ever used in that class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. This is never used. I've removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the code/documentation and unit tests and ran all tests.
Happy to approve.
* master: Calc temperature after latent heat release (metoppv#1739) Fixed broken links (metoppv#1745) Vicinity processing CLI (metoppv#1749) Rainforest minor fixes (metoppv#1751) Implement expected value via integration over probability thresholds (metoppv#1734) Exclude hidden directories and their sub-directories from the init check test. This accommodates IDEs that store information in hidden directories, i.e. vscode. (metoppv#1748) # Conflicts: # improver/psychrometric_calculations/psychrometric_calculations.py # improver_tests/acceptance/test_vicinity.py
* Adds initial version of saturated latent heat release methods and tests, but this needs more work to get the right answers. * Uses correct value for latent heat of condensation and updates unit test results accordingly * Refactors method for modifying latent heat of condensation w.r.t. temperature and uses it. * Uses imported ndarray rather than np.ndarray * Refactors latent heat test to mirror refactor of the method * Refactors wet-bulb temperature plugins into separate module. Moves and renames test modules to match. * Adds test for unsaturated case, and makes code work for it * Reduces iterations to 5 (4 is sufficient for the unit tests) * Adds a test using some real tropical data and increases number of iterations as required for global data * Tweaks - Ensures saturated_humidity returns input dtype - Describes behaviour for subsaturated data in doc-strings - Renamed new method to `adjust_for_latent_heat` (much more descriptive) - Inproves doc-string for `qsat_differential` method - Asserts new tests check for float32 data - Parametrizes tests for `calculate_latent_heat` * isort * Replaces local epsilon (0.622) value with consts.REPSILON (0.62198). Makes tiny change to expected values. * Updates results for saturated latent heat following tiny epsilon change * Refactors mixing ratio methods to remove duplication. - Ensures tests from the old method are copied to the new, even though one of them wasn't useful. - Existing test results slightly changed due to use of `np.maximum(svp, pressure)` * Adds test to show that the latent heat of condensation at the triple point is unchanged * Black * Improves doc-string * Updates results for saturated latent heat following inclusion of `np.maximum(svp, pressure)` * Removes unused mixing_ratio from a WetBulbTemperature test
Closes #1738
Adds method to adjust temperature and humidity for latent heat release.
WetBulbTemperature
andWetBulbTemperatureIntegral
plugins into a newwet_bulb_temperature.py
module aspsychrometric_calculations
is getting too big._calculate_latent_heat
method fromWetBulbTemperature
plugin topsychrometric_calculations
so that it can be used in latent heat release calculations.Testing: