Repository navigation
Critical and triple points, saturation scale, labels inside the dome; versions in the badge - #43
Merged
Merged
Conversation
DiagramSpec.marked_points and PropertyDiagram.marked_points take "critical" and or "triple". The engine computes the states once per fluid (thermo.provider.marked_point_states) and hands them to the composer with the domain. The triple point marks both ends of the saturation curve at the triple temperature; mixtures and pseudo-pure blends have none. Points outside the T-p box are not drawn, and the axes are widened a little so the dots are drawn whole. The dot takes the colour and casing of the saturation curve. coolplot-core 1.6 composes the same scene from the "points" of the compose record; the bridge refuses marked points for an older core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bsHH774XBx3sJCtfvvuGF
DiagramSpec.saturation_scale (a SaturationScale) and PropertyDiagram.saturation_scale draw a scale just inside the frame, right of the vertical axis: saturation temperatures next to a pressure axis, saturation pressures next to a temperature axis. Ticks land on round values in the chart's units, either a given step or chosen by the chart (1-2-5 per decade for pressures), up to the critical point. "Q" picks the dew (default) or bubble point of a blend. Values that would overlap are thinned from the top down. The scale takes the colour and length of the axis ticks; isoline labels, the legend and the badge keep clear of it, and it never widens the axes. The engine computes the ticks with the domain; coolplot-core 1.6 composes the same scene from the "scale" of the compose record, and the bridge refuses a scale for an older core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bsHH774XBx3sJCtfvvuGF
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bsHH774XBx3sJCtfvvuGF
LabelSettings.dome adds two labels to each labelled line of the family that crosses the two-phase region: the isotherms, or the isobars where temperature is an axis (spec.diagram.dome_key). They sit on the chord between the bubble and dew states, a few points inside each end and turned along it, so they follow the sloped isotherms of a blend. They come on top of the labels of the label mode and keep clear of those, the legend, the badge, the saturation scale and cycles; a label that does not fit is left out, which near the critical point leaves one label of a line, then none. The engine computes the bubble and dew states of the planned values with the domain; coolplot-core 1.6 places the same labels from the "dome" of the compose record, and the bridge refuses the setting for an older core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bsHH774XBx3sJCtfvvuGF
BrandingSettings.versions is True by default, so the badge of a new
chart holds the versions line ("CoolProp 8.0.0, CoolPlot 1.6.0") below
the equation of state. Specs saved since 1.2 hold "versions": false and
keep their badge; a spec from before 1.2 still reads without badge. A
chart without badge now takes references "none" and versions False;
the docs, the upgrade guide and the tests say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013bsHH774XBx3sJCtfvvuGF
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Both sides add to DiagramSpec, the composer and coolplot-core 1.6. The single lines draw at z 3.0; the marked critical and triple points move to z 3.5, above them and below the labels (one golden case written again). The single lines go after the labels inside the dome. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bsHH774XBx3sJCtfvvuGF
CHANGELOG: the examples join the Added list; the units entry was already under Changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bsHH774XBx3sJCtfvvuGF
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.
Addresses #39: three optional additions to property diagrams, and one changed default.
Summary
Critical and triple points (
diagram.marked_points = ("critical", "triple"))set_line_style("saturation", ...)."DEF"starts 1 % above the triple point, so the triple point needstp_limits=[None, None, None, None]. When a point is drawn, the axes widen by 1.5 % of the span so the dot is not cut off at the frame.Saturation scale (
diagram.saturation_scale = True, or{"step": 10, "Q": 0})Qpicks the dew point (the default) or the bubble point of a blend.Labels inside the dome (
settings.with_(labels={"dome": True}))Changed default: versions in the badge
BrandingSettings.versionsis nowTrue, so the badge of a new chart also says "CoolProp x, CoolPlot y"."versions": falseand keep their badge as it was.{"references": "none", "versions": False};"references": "none"alone leaves the versions line. The upgrade guide has a 1.5 to 1.6 section on this.How it is built
Markers,Line,Text), so no renderer needed a change."points","scale"and"dome"keys of the compose record. The bridge refuses these features for an older core, so the Python composer draws them, with a warning.marked_points,saturation_scale,labels.dome) are written to the record only when set, so records of 1.5 read and draw as before.DiagramSpec, the composer and coolplot-core 1.6.Tests
tests/test_marked_points.py,tests/test_saturation_scale.py,tests/test_dome_labels.py.tests/test_native_core.pycompares the Python composer with the C++ port for each feature and checks that an older core is refused.make_data.py(compose_rails_*marked_points*,*scale*,*dome_labels*). After the merge of Highlighting single isolines #32, 53 C++ test cases pass, and the JS SVG writer check reports all files identical.CoreFallbackWarningas an error. CI was green there, includingcoreanddocs.CHANGELOG.mdconflicted): the phase diagram examples pass both ways, the feature, branding and port tests pass through coolplot-core (120), and mypy is clean. CI is running on that head.Docs:
how_to/isolines.md(marked points, saturation scale),how_to/labels.md(labels inside the dome),how_to/branding.md,upgrade.md,reference/contracts.md,CHANGELOG.md.Generated by Claude Code