Repository navigation
Load CoolProp without its superancillaries #49
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
69b77b2
Load CoolProp without its superancillaries
jtravs 553ae58
Merge main into perf/coolprop-no-superancillaries
jtravs 7043d9b
Keep CoolProp's switch out of child processes, and earlier C output i…
jtravs 12b467c
Raise the equation-of-state EVALUATION_VERSION: critical temperatures…
jtravs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| CoolProp is loaded without the superancillaries it builds for all of its fluids, unless | ||
| `COOLPROP_DISABLE_SUPERANCILLARIES_ENTIRELY` is already set or CoolProp was imported | ||
| first: the first real-gas density takes 0.07 s instead of 0.46 s. No density at a given | ||
| state changed and no recommended value moved, but the identity of every equation of | ||
| state, and of the mixture, transport and air models built on one, changes: the | ||
| equation-of-state `EVALUATION_VERSION` is now 2. A gas's critical temperature is now its | ||
| equation's stated value (oxygen 154.581 K instead of 154.599 K; others within 2e-5), and | ||
| saturation pressures, so where a gas's domain ends, move by at most 7e-11 more than 1 K | ||
| below the critical point and by up to 7e-8 within it (TC-1096). |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
When stdout is redirected to a pipe or file, native libraries can have buffered output pending before the first real-gas call.
sys.stdout.flush()only flushes Python's stream, so that native output remains buffered until_flush_c_streams()runs while descriptor 1 points to/dev/null, silently discarding the caller's output along with CoolProp's notice. This is reproducible by calling libcprintfbefore entering_quiet_stdout(). Flush the native streams before redirecting descriptor 1 as well as before restoring it.Useful? React with 👍 / 👎.
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.
Fixed in 7043d9b:
_quiet_stdoutnow flushes C's buffers before redirecting descriptor 1 as well as before restoring it.test_native_output_written_before_the_block_is_keptchecks it with libcprintf; it fails without the fix.