lightly refactor calculate_temperature.c tweaks#36
Closed
mabruzzo wants to merge 709 commits into
Closed
Conversation
In these cases, we only run a subset of the test-suite (the much faster component). This seems reasonable since we are already running the answer-tests with the version of pygrackle configured that automatically compiled the core-library as part of the build process. This should save a lot of time
Optimize circleci workflows
remove 2 unneeded files
…sting-without-editable-install Support running subset of pygrackle test without a an editable install
remove a line that was made obsolete by PR grackle-project#224
…tweak cython does not need to be a runtime-dependency
…nstruction-tweaks Pygrackle test instruction tweaks
fix a typo in a CMake variable name
Tweak cython-handling in build-system
…Warnings Enable Compiler Warnings in a CI job
…lding_length_fix H2 self shielding length scale factor fix
Superficial Website Documentation Tweaks
[newchem-cpp] Minor model test refactor and adding model comparison option
…eaks fixing up config.yml
…e/internal_types_updates [newchem-cpp] internal scratch-buffer interface update
…e/Implement-SpLUT-with-XMacros [newchem-cpp] Refactor such that SpLUT is implemented with XMacros
…e/SpeciesLUTFieldAdaptor [newchem-cpp] Introduce `SpeciesLutFieldAdaptor`
The *Great Renaming:* `gracklepy` edition
…e/initial-step_rate_newton_raphson [newchem-cpp] initial transcription of `step_rate_newton_raphson`
…phson-cleanup-1of2
…phson-cleanup-1of2
…' into gen2024transcribe/lookup_cool_rates0d
…scribe/lookup_cool_rates0d_cleanup
…2024transcribe/calc_temp_cloudy_g I needed to introduce the bugfix from PR grackle-project#367.
…cribe/scale_fields_table
…cribe/calculate_temperature_tweaks
Author
|
superseded by grackle-project#382 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This must be reviewed after #34.
This PR does some (largely superficial) refactoring of the
calculate_temperature.cfile.There were 3 commits:
SUCCESSandFAILwithGR_SUCCESSandGR_FAIL. I also slightly rearranged a little logic withinlocal_calculate_temperature(in preparation for the next commit)local_calculate_temperature_tablehelper function directly inside oflocal_calculate_temperature(this allowed me to deletelocal_calculate_temperature_table). For additional context:calc_temp_cloudy_gin PR transcribecalc_temp_cloudy_g#34, the definition oflocal_calculate_temperature_tablegot a lot shorter. With those changes,local_calculate_temperature_tableperformed an error-check thatprimordial_chemistry==0and simply called `calc_temp_cloudy_glocal_calculate_temperatureonly calledlocal_calculate_temperature_tablewhenprimordial_chemistry==0, inlining the definition oflocal_calculate_temperature_tablewithinlocal_calculate_temperaturelet us eliminate all associated error-handling logiclocal_calculate_temperature(or make the logic any harder to follow). At the same time, it allowed us to remove all of the lines of code where we had previously declared/definedlocal_calculate_temperature_tablemaxmacro with C'sfmaxfunction. At this point, I was able to remove theinclude "grackle_macros.h"lineI manually confirmed that all tests pass for this PR