From aec5c3817005b554a94e05638300d969cee4068a Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Tue, 3 Nov 2026 13:02:43 +0000 Subject: [PATCH 1/2] Release 1.5.0 with everything on master, coolplot-core back to 1.5 1.5.0 was never tagged or published, but the merge of master into the single lines (000a2eb) took it as released and moved the new features to 1.6. Python stayed at 1.5.0 while coolplot-core went to 1.6.0. Now both are 1.5.0 and the single lines, marked points, saturation scale, labels inside the dome and the versions line of the badge are 1.5 features: - coolplot-core 1.5.0 (CMakeLists, its version test, compose.h); - the bridge asks for a core of 1.5 for those features, and the tests of the refusal fake a core of 1.4; - docstrings, how-tos and contracts say "since 1.5"; - the upgrade guide folds "From 1.5 to 1.6" into "From 1.4 to 1.5"; - the changelog moves Unreleased into 1.5.0, dated 2026-11-03. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013bsHH92mrBKAQF1qBN3yhe --- CHANGELOG.md | 90 ++++++++++++++++------------------ cpp/CMakeLists.txt | 2 +- cpp/include/coolplot/compose.h | 6 +-- cpp/tests/test_svg.cpp | 2 +- docs/how_to/branding.md | 4 +- docs/how_to/isolines.md | 6 +-- docs/how_to/labels.md | 2 +- docs/reference/contracts.md | 16 +++--- docs/upgrade.md | 38 ++++++-------- src/coolplot/corelib.py | 8 +-- src/coolplot/spec/diagram.py | 4 +- src/coolplot/spec/settings.py | 8 +-- tests/test_native_core.py | 40 +++++++-------- 13 files changed, 106 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea5e1e..f351f7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,18 +6,38 @@ guide in the documentation says what to change in your code. ## [Unreleased] -### Changed -- The badge names the CoolProp and CoolPlot versions by default - (`BrandingSettings.versions=True`), below the equation of state, so a - chart says what drew it. Specs saved before hold `"versions": false` - and keep their badge; `{"references": "none", "versions": False}` - draws a chart without badge. -- `cycle_states`, `state`, `state_at` and `mix` say which way `units=` - works: on `cycle_states` it converts the states returned (as dicts), - on the others it only sets the units of the input and the StatePoint - returned stays in SI units. The how-to on units explains why (#33). +## [1.5.0] - 2026-11-03 ### Added +- coolplot-core 1.5 composes and writes the badge of the branding when it + holds text lines only (references, versions, lines of your own): the + compose record takes the source lines as `"sources"`, the scene record + carries the badge, and the SVG and PDF writers draw it as the Python SVG + writer does. A branded chart without logo or watermark therefore takes + the native path; one with pictures still takes Python. The bridge + refuses a badge for a core older than 1.5, so the Python composer draws + it, with a warning. +- The plotly backend and the JavaScript writer (`scene_page`) draw the + badge of text lines too; only a logo or a watermark is left out, with a + warning. `PdfRenderer` draws it through coolplot-core 1.5, also on a + chart with a logo or a watermark, which it leaves out with a warning. +- Theme "coolpack": the look of the log(p),h-diagrams of CoolPack (DTU, + "Refrigeration Utilities", late 1990s). Times on white with a dense + light grey grid (major and minor ticks), a black saturation curve, red + isotherms, blue isentropes, green isochores and navy lines of constant + quality in the colours of the 16 colour Windows palette, every label in + the colour of its line, no legend. Purple isobars and magenta + isenthalps for the other charts. coolplot-core has the same preset. +- Documentation: a theme catalog with every theme on a log(p)-h and a T-s + chart, its isoline colours as seen with each kind of colour vision + deficiency and in greyscale, contrast and separation numbers, and why + its colours are what they are. Pictures and numbers are generated when + the documentation is built. +- Documentation: "Colour and accessibility", the rules the themes are + measured against (WCAG 2.2 AA, the colour science literature), who they + are for, and how the default colours were chosen. +- Gallery example "A CoolPack chart, for old times' sake": the R290 chart + of the CoolPack tutorial with its one stage cycle, in the new theme. - `Chart.add_line` and `Chart.remove_line` (issue #32): single lines of constant value drawn on top of the families, each with its own name, legend entry, label and style, such as a highlighted isotherm among @@ -27,7 +47,7 @@ guide in the documentation says what to change in your code. style a line takes its family's at twice the width. The lines are stored in `DiagramSpec.lines` (`coolplot.LineSpec`, the spec record's `lines`), drawn with the scene roles `line` and `line_label`, and - composed the same by coolplot-core 1.6; an older core leaves charts + composed the same by coolplot-core 1.5; an older core leaves charts with single lines to the Python composer. - The critical point and the triple point can be marked with a dot in the colour of the saturation curve: `diagram.marked_points = ("critical", @@ -36,7 +56,7 @@ guide in the documentation says what to change in your code. chart is not drawn, and the axes are widened a little to show the dots whole. Mixtures and pseudo-pure blends mark the critical point only. The spec record holds `marked_points` only when it is set, so records - of 1.5 read as before. + of 1.4 read as before. - A saturation scale just inside the frame, right of the vertical axis (#39): `diagram.saturation_scale = True`, or `{"step": 10, "Q": 0}` for a tick every 10 K at the bubble points of a blend. Next to a @@ -53,10 +73,10 @@ guide in the documentation says what to change in your code. saturation scale and cycles, and are left out where they do not fit, as near the critical point. `LabelSettings.dome` is written to the record only when true. -- coolplot-core 1.6 composes the marked points, the saturation scale and +- coolplot-core 1.5 composes the marked points, the saturation scale and the labels inside the dome; the compose record carries their states as `"points"`, `"scale"` and `"dome"` of the domain. The bridge refuses - any of them for a core older than 1.6, so the Python composer draws + any of them for a core older than 1.5, so the Python composer draws them, with a warning. - Example `examples/co2_phase_diagram.py`: a full phase diagram of CO2 on the p-T chart. CoolPlot draws the vapour pressure curve; the example @@ -67,39 +87,6 @@ guide in the documentation says what to change in your code. melting line of the ices from CoolProp and the sublimation line of ice Ih from IAPWS R14-08 (2011). -## [1.5.0] - 2026-10-30 - -### Added -- coolplot-core 1.5 composes and writes the badge of the branding when it - holds text lines only (references, versions, lines of your own): the - compose record takes the source lines as `"sources"`, the scene record - carries the badge, and the SVG and PDF writers draw it as the Python SVG - writer does. A branded chart without logo or watermark therefore takes - the native path; one with pictures still takes Python. The bridge - refuses a badge for a core older than 1.5, so the Python composer draws - it, with a warning. -- The plotly backend and the JavaScript writer (`scene_page`) draw the - badge of text lines too; only a logo or a watermark is left out, with a - warning. `PdfRenderer` draws it through coolplot-core 1.5, also on a - chart with a logo or a watermark, which it leaves out with a warning. -- Theme "coolpack": the look of the log(p),h-diagrams of CoolPack (DTU, - "Refrigeration Utilities", late 1990s). Times on white with a dense - light grey grid (major and minor ticks), a black saturation curve, red - isotherms, blue isentropes, green isochores and navy lines of constant - quality in the colours of the 16 colour Windows palette, every label in - the colour of its line, no legend. Purple isobars and magenta - isenthalps for the other charts. coolplot-core has the same preset. -- Documentation: a theme catalog with every theme on a log(p)-h and a T-s - chart, its isoline colours as seen with each kind of colour vision - deficiency and in greyscale, contrast and separation numbers, and why - its colours are what they are. Pictures and numbers are generated when - the documentation is built. -- Documentation: "Colour and accessibility", the rules the themes are - measured against (WCAG 2.2 AA, the colour science literature), who they - are for, and how the default colours were chosen. -- Gallery example "A CoolPack chart, for old times' sake": the R290 chart - of the CoolPack tutorial with its one stage cycle, in the new theme. - ### Changed - Every chart names the equation of state of its fluid by default: `BrandingSettings.references` is "short" instead of "none", so the @@ -128,6 +115,15 @@ guide in the documentation says what to change in your code. is gone: the company chart of Clean Heat Partners shows the same (logo, references, versions, a line of text and a watermark) on a real chart. +- The badge names the CoolProp and CoolPlot versions by default + (`BrandingSettings.versions=True`), below the equation of state, so a + chart says what drew it. Specs saved before hold `"versions": false` + and keep their badge; `{"references": "none", "versions": False}` + draws a chart without badge. +- `cycle_states`, `state`, `state_at` and `mix` say which way `units=` + works: on `cycle_states` it converts the states returned (as dicts), + on the others it only sets the units of the input and the StatePoint + returned stays in SI units. The how-to on units explains why (#33). ### Removed - Theme "classic" (and `coolplot.style.CLASSIC`). Its idea, a colour per diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index d473e22..247ab37 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -10,7 +10,7 @@ # Catch2 is fetched for the tests; set FETCHCONTENT_SOURCE_DIR_CATCH2 to a # local checkout to build offline. cmake_minimum_required(VERSION 3.16) -project(coolplot_core VERSION 1.6.0 LANGUAGES CXX) +project(coolplot_core VERSION 1.5.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/cpp/include/coolplot/compose.h b/cpp/include/coolplot/compose.h index 6264329..68d3e85 100644 --- a/cpp/include/coolplot/compose.h +++ b/cpp/include/coolplot/compose.h @@ -9,11 +9,11 @@ // // {"spec": , // "domain": {"tp_box": [T_min, T_max, p_min, p_max], "ranges_SI": {key: [min, max]}, -// "points": {name: {key: value}} (optional, since 1.6), -// "scale": [[saturation_SI, axis_SI], ...] (optional, since 1.6)}, +// "points": {name: {key: value}} (optional, since 1.5), +// "scale": [[saturation_SI, axis_SI], ...] (optional, since 1.5)}, // "curves": [{"request": {"item_id", "key", "value_SI", "points", "labels", "anchor_SI"}, "curve": }], // (anchor_SI, since 1.1: the saturation temperature or pressure the line passes through when its -// family is placed by saturation states, null otherwise; the label shows it. Since 1.6 the curves +// family is placed by saturation states, null otherwise; the label shows it. Since 1.5 the curves // of the single lines of the spec come here too, with the item id "line/") // "cycles": [{"states": {"1": {key: value}}, "chains": [[{key: value}, ...]]}], // "plot_size_pt": [width, height] or null, diff --git a/cpp/tests/test_svg.cpp b/cpp/tests/test_svg.cpp index 67fcee7..d4d8a76 100644 --- a/cpp/tests/test_svg.cpp +++ b/cpp/tests/test_svg.cpp @@ -168,7 +168,7 @@ TEST_CASE("The C ABI composes, writes SVG and reports errors", "[svg][capi]") { CHECK(std::string(error).find("not valid JSON") != std::string::npos); coolplot_free(error); CHECK(coolplot_compose(nullptr, &scene_json, nullptr) == 1); - CHECK(std::string(coolplot_version()) == "1.6.0"); + CHECK(std::string(coolplot_version()) == "1.5.0"); } TEST_CASE("The writers ignore the C locale", "[svg][pdf][locale]") { diff --git a/docs/how_to/branding.md b/docs/how_to/branding.md index 976e1d5..f77f116 100644 --- a/docs/how_to/branding.md +++ b/docs/how_to/branding.md @@ -7,8 +7,8 @@ plot area and, if you like, a faint picture behind the lines. Since 1.5 every chart names its equation of state by default (`references="short"`), so a chart never reaches a reader without its -source, and since 1.6 the versions of CoolProp and CoolPlot that drew it -(`versions=True`, "CoolProp 8.0.0, CoolPlot 1.6.0"). To draw a chart +source, and the versions of CoolProp and CoolPlot that drew it +(`versions=True`, "CoolProp 8.0.0, CoolPlot 1.5.0"). To draw a chart without the badge: ```python diff --git a/docs/how_to/isolines.md b/docs/how_to/isolines.md index 829820c..77c1fdd 100644 --- a/docs/how_to/isolines.md +++ b/docs/how_to/isolines.md @@ -23,7 +23,7 @@ is in {doc}`../reference/tables`. ## Single lines -Since 1.6 `add_line` draws one line of constant value on top of the +Since 1.5 `add_line` draws one line of constant value on top of the families, for a design temperature or the pressure at which a relief valve or burst disk opens. Each line has a name, shows in the legend and is independent of the families: `set_lines` and `set_default_lines` @@ -72,7 +72,7 @@ values decide, as they did then. ## Mark the critical and triple points -Since 1.6 a chart of a fluid can mark the critical point and the triple +Since 1.5 a chart of a fluid can mark the critical point and the triple point with a dot in the colour of the saturation curve: ```python @@ -102,7 +102,7 @@ follows `set_line_style("saturation", ...)`. ## A saturation scale next to the axis -Since 1.6 a chart with pressure on the vertical axis can show the +Since 1.5 a chart with pressure on the vertical axis can show the saturation temperature at each pressure on a scale just inside the frame, right of the axis; a chart with temperature on the vertical axis shows the saturation pressure at each temperature: diff --git a/docs/how_to/labels.md b/docs/how_to/labels.md index 1b227cf..9a1e31f 100644 --- a/docs/how_to/labels.md +++ b/docs/how_to/labels.md @@ -45,7 +45,7 @@ n-th line), `digits`, `show_units`, `tick_digits`. ## Labels inside the dome -Since 1.6 each labelled line that runs through the two-phase region can +Since 1.5 each labelled line that runs through the two-phase region can carry two more labels inside the dome, one just right of the bubble line and one just left of the dew line, as on the printed refrigerant charts: diff --git a/docs/reference/contracts.md b/docs/reference/contracts.md index 3bdf774..15c5a11 100644 --- a/docs/reference/contracts.md +++ b/docs/reference/contracts.md @@ -86,7 +86,7 @@ One record describes a property diagram and a psychrometric chart alike; `symbols`, "unicode" (the default: rho, deg C and m3 written with their own characters) or "ascii"; a `labels` record without it was written before 1.4 and reads as "ascii", so it draws as before. Since - 1.6 `labels` may hold `dome`, `true` for labels inside the dome; it is + 1.5 `labels` may hold `dome`, `true` for labels inside the dome; it is written only when true, so a record without it reads as `false`. * `isolines`: one entry per family, in drawing order. `values_SI` lists explicit values; `anchor` (since 1.1) places the lines through @@ -123,21 +123,21 @@ One record describes a property diagram and a psychrometric chart alike; 0 and 1, or 100 % relative humidity) whatever lines are set, `false` hides it, `null` leaves it to the values of the family. A record of 1.1 has no such field and reads as `null`, so it draws as it did. -* `lines` (since 1.6): single lines of constant `key` at `value_SI`, +* `lines` (since 1.5): single lines of constant `key` at `value_SI`, each under its own `name` (`coolplot.spec.LineSpec`). `key` is a quantity with a family in the diagram, or one of its two axes: such a line is straight and spans the plot, and the axes widen to show it. `label` is `true` (the value), `false` (none) or a text; `line_style` `null` takes the family's style at twice the width (the colour of the saturation curve for an axis quantity). The key is left out when a - chart has no single lines, so records of 1.5 read as they were; a - coolplot-core older than 1.6 is not asked to compose a spec with lines. -* `marked_points` (since 1.6, charts of a fluid only): the special states + chart has no single lines, so records of 1.4 read as they were; a + coolplot-core older than 1.5 is not asked to compose a spec with lines. +* `marked_points` (since 1.5, charts of a fluid only): the special states marked with a dot, `"critical"` and or `"triple"` (the two ends of the saturation curve at the triple point). A point outside the chart's T-p box is not drawn. The key is left out when nothing is marked, so a - record of 1.5 reads as it was. -* `saturation_scale` (since 1.6, charts of a fluid with pressure or + record of 1.4 reads as it was. +* `saturation_scale` (since 1.5, charts of a fluid with pressure or temperature on the vertical axis): `{"step_SI": 10.0, "Q": 1.0}` draws a scale of saturation temperatures next to a pressure axis, or of saturation pressures next to a temperature axis, with a tick every @@ -260,7 +260,7 @@ and 1, relative humidity 100 %), `quality` (the other lines of the boundary family), `isoline_label`, `label_tick` (since 1.2: the short line on the frame where a line with an outer rail label leaves, id `iso///tick`, in the group of the labels), `cycle`, `process`, `state_points`, -`state_number`, `annotation`, and since 1.6 `line` and `line_label` (a +`state_number`, `annotation`, and since 1.5 `line` and `line_label` (a single line and its label, in the groups `line/` and `line//label`). Z order: isolines 1, saturation 2, single lines 3, labels 4, cycles and processes 5, state diff --git a/docs/upgrade.md b/docs/upgrade.md index 0e876d6..310a3ef 100644 --- a/docs/upgrade.md +++ b/docs/upgrade.md @@ -35,39 +35,29 @@ starting with an underscore, the helpers in `coolplot.core`, `coolplot.testing`, the scene item ids, and the exact coordinates of a chart (better numerics may move points). -## From 1.5 to 1.6 - -Nothing to change in your code. The badge of a new chart has one more -line: the versions of CoolProp and CoolPlot that drew it ("CoolProp -8.0.0, CoolPlot 1.6.0"), below the equation of state. For the badge of -1.5, without that line: - -```python -diagram.settings = diagram.settings.with_(branding={"versions": False}) -``` - -and for no badge at all, `{"references": "none", "versions": False}` -(`"references": "none"` alone now leaves the versions line). Specs saved -before 1.6 hold `"versions": false` and keep their badge as it was. - ## From 1.4 to 1.5 Nothing to change in your code, but new charts look different in two ways. -**A badge with the equation of state.** New charts carry a small badge in -one corner that names the equation of state of the fluid ("R290: Lemmon -et al. (2009)"), so that a chart always says where its properties come -from. It takes the emptiest corner, and labels on rails or at the edges -keep clear of it (inline labels and labels in the margin do not). For -charts without it, as in 1.4 (since 1.6 with `"versions": False` as well): +**A badge with the equation of state and the versions.** New charts +carry a small badge in one corner that names the equation of state of +the fluid ("R290: Lemmon et al. (2009)") and, below it, the versions of +CoolProp and CoolPlot that drew the chart ("CoolProp 8.0.0, CoolPlot +1.5.0"), so that a chart always says where its properties come from and +what drew it. It takes the emptiest corner, and labels on rails or at +the edges keep clear of it (inline labels and labels in the margin do +not). For charts without it, as in 1.4: ```python -diagram.settings = diagram.settings.with_(branding={"references": "none"}) +diagram.settings = diagram.settings.with_(branding={"references": "none", "versions": False}) ``` -Specs saved before 1.2 (without a branding part) keep drawing without -badge; specs saved by 1.2 to 1.4 hold `"references": "none"` and keep it. +`"references": "none"` alone leaves the versions line, and +`"versions": False` alone the equation of state. Specs saved before 1.2 +(without a branding part) keep drawing without badge; specs saved by 1.2 +to 1.4 hold `"references": "none"` and `"versions": false` and keep +their chart as it was. **One colour per quantity.** In the `default` and `dark` themes every quantity now has a colour of its own, the same on every chart. In diff --git a/src/coolplot/corelib.py b/src/coolplot/corelib.py index a551091..76d72e8 100644 --- a/src/coolplot/corelib.py +++ b/src/coolplot/corelib.py @@ -172,10 +172,10 @@ def _restyles_the_dome(spec) -> bool: ((1, 4), lambda spec: spec.settings.labels.symbols == "unicode", "write symbols and units with their own " "characters (rho, deg C, m3)"), ((1, 5), lambda spec: spec.settings.branding.has_badge, "draw the badge of the branding"), - ((1, 6), lambda spec: bool(spec.lines), "draw single lines (add_line)"), - ((1, 6), lambda spec: bool(spec.marked_points), "mark the critical and triple points"), - ((1, 6), lambda spec: spec.saturation_scale is not None, "draw a saturation scale"), - ((1, 6), lambda spec: spec.settings.labels.dome, "label lines inside the dome"), + ((1, 5), lambda spec: bool(spec.lines), "draw single lines (add_line)"), + ((1, 5), lambda spec: bool(spec.marked_points), "mark the critical and triple points"), + ((1, 5), lambda spec: spec.saturation_scale is not None, "draw a saturation scale"), + ((1, 5), lambda spec: spec.settings.labels.dome, "label lines inside the dome"), ) diff --git a/src/coolplot/spec/diagram.py b/src/coolplot/spec/diagram.py index a4b1530..3fe9c0a 100644 --- a/src/coolplot/spec/diagram.py +++ b/src/coolplot/spec/diagram.py @@ -611,10 +611,10 @@ def to_dict(self) -> dict: if self.lines: # left out when empty, so records without single lines stay as they were record["lines"] = [line.to_dict() for line in self.lines] if self.marked_points: - # Only written when set, so the record of a chart without them is the same as before 1.6 + # Only written when set, so the record of a chart without them is the same as before 1.5 record["marked_points"] = list(self.marked_points) if self.saturation_scale is not None: - record["saturation_scale"] = self.saturation_scale.to_dict() # the same (1.6) + record["saturation_scale"] = self.saturation_scale.to_dict() # the same (1.5) return record @classmethod diff --git a/src/coolplot/spec/settings.py b/src/coolplot/spec/settings.py index cd22db1..eb3cc07 100644 --- a/src/coolplot/spec/settings.py +++ b/src/coolplot/spec/settings.py @@ -158,7 +158,7 @@ class LabelSettings: Significant digits of tick labels; every backend writes them with :func:`coolplot.core.numbers.format_number`. dome : bool - Since 1.6: label each labelled line that crosses the two-phase + Since 1.5: label each labelled line that crosses the two-phase region once more inside the dome, just right of the bubble line and just left of the dew line, in addition to the labels of ``mode``. The isotherms of a chart without temperature on an axis @@ -258,7 +258,7 @@ class BrandingSettings: By default the badge names the equation of state of the fluid (``references="short"``) and the CoolProp and CoolPlot versions - (``versions=True``, since 1.6), so that a chart says where its + (``versions=True``, since 1.5), so that a chart says where its properties come from and what drew it; everything else is off. ``references="none"`` with ``versions=False`` removes the badge. A change only affects the layout of the page, like :class:`PageSettings`; nothing is recalculated. @@ -286,7 +286,7 @@ class BrandingSettings: humid air that of ASHRAE RP-1485. versions : bool Add a line with the CoolProp and CoolPlot versions (the default - since 1.6). + since 1.5). lines : tuple of str Further lines, for example a web address and a date. location : str @@ -404,7 +404,7 @@ def to_dict(self) -> dict: """The settings record of docs/reference/contracts.md.""" labels = asdict(self.labels) if not labels["dome"]: - del labels["dome"] # written only when set, so a record without it is the same as before 1.6 + del labels["dome"] # written only when set, so a record without it is the same as before 1.5 return {"calc": asdict(self.calc), "look": self.look.to_dict(), "labels": labels, "page": asdict(self.page), "branding": asdict(self.branding)} diff --git a/tests/test_native_core.py b/tests/test_native_core.py index 4301a30..caaecaa 100644 --- a/tests/test_native_core.py +++ b/tests/test_native_core.py @@ -480,8 +480,8 @@ def test_unicode_symbols_compose_the_same_through_the_port(): @needs_core def test_single_lines_compose_the_same_through_the_port(): pytest.importorskip("CoolProp") - if native.core_version() < (1, 6): - pytest.skip("coolplot-core 1.6 draws single lines; an older one is refused (next test)") + if native.core_version() < (1, 5): + pytest.skip("coolplot-core 1.5 draws single lines; an older one is refused (next test)") from coolplot import LineStyle, PropertyDiagram, PsychrometricChart diagram = PropertyDiagram("R290", "ph", tp_limits="ACHP", settings="interactive") diagram.set_default_lines(labels=True) @@ -508,7 +508,7 @@ def test_single_lines_compose_the_same_through_the_port(): @needs_core def test_an_older_core_refuses_single_lines(monkeypatch): - """A core from before 1.6 would ignore the single lines and draw the chart without them.""" + """A core from before 1.5 would ignore the single lines and draw the chart without them.""" pytest.importorskip("CoolProp") from coolplot import PropertyDiagram from coolplot.compose import compose @@ -519,9 +519,9 @@ def test_an_older_core_refuses_single_lines(monkeypatch): spec = chart.spec domain = chart.engine.domain(spec) curves = chart.engine.curves(spec, domain, plan(spec, domain)) - monkeypatch.setattr(native, "core_version", lambda: (1, 5, 0)) + monkeypatch.setattr(native, "core_version", lambda: (1, 4, 0)) monkeypatch.setenv("COOLPLOT_NATIVE", "1") - with pytest.warns(native.CoreFallbackWarning, match="older than 1.6"): + with pytest.warns(native.CoreFallbackWarning, match="older than 1.5"): items, _ = compose(spec, domain, curves) assert any(i.id == "line/Relief valve" for i in items) # drawn by the Python composer @@ -748,8 +748,8 @@ def test_the_pdf_page_draws_the_badge_without_a_warning(tmp_path): ]) def test_marked_points_compose_the_same_through_the_port(fluid, diagram_type, limits): pytest.importorskip("CoolProp") - if native.core_version() < (1, 6): - pytest.skip("coolplot-core 1.6 marks the critical and triple points; an older one is refused (next test)") + if native.core_version() < (1, 5): + pytest.skip("coolplot-core 1.5 marks the critical and triple points; an older one is refused (next test)") from coolplot import PropertyDiagram chart = PropertyDiagram(fluid, diagram_type, tp_limits=limits, settings="interactive") chart.set_default_lines(labels=True) @@ -764,7 +764,7 @@ def test_marked_points_compose_the_same_through_the_port(fluid, diagram_type, li @needs_core def test_an_older_core_refuses_marked_points(monkeypatch): - """A core from before 1.6 would ignore the marked points and draw the chart without them.""" + """A core from before 1.5 would ignore the marked points and draw the chart without them.""" pytest.importorskip("CoolProp") from coolplot import PropertyDiagram from coolplot.compose import compose @@ -774,9 +774,9 @@ def test_an_older_core_refuses_marked_points(monkeypatch): spec = chart.spec domain = chart.engine.domain(spec) curves = chart.engine.curves(spec, domain, plan(spec, domain)) - monkeypatch.setattr(native, "core_version", lambda: (1, 5, 0)) + monkeypatch.setattr(native, "core_version", lambda: (1, 4, 0)) monkeypatch.setenv("COOLPLOT_NATIVE", "1") - with pytest.warns(native.CoreFallbackWarning, match="older than 1.6"): + with pytest.warns(native.CoreFallbackWarning, match="older than 1.5"): items, _ = compose(spec, domain, curves) assert [i.id for i in items if i.role == "marked_point"] == ["point/critical"] # drawn by Python @@ -789,8 +789,8 @@ def test_an_older_core_refuses_marked_points(monkeypatch): ]) def test_a_saturation_scale_composes_the_same_through_the_port(fluid, diagram_type, scale): pytest.importorskip("CoolProp") - if native.core_version() < (1, 6): - pytest.skip("coolplot-core 1.6 draws the saturation scale; an older one is refused (next test)") + if native.core_version() < (1, 5): + pytest.skip("coolplot-core 1.5 draws the saturation scale; an older one is refused (next test)") from coolplot import PropertyDiagram chart = PropertyDiagram(fluid, diagram_type, tp_limits="ACHP", settings="interactive") chart.set_default_lines(labels=True) @@ -803,7 +803,7 @@ def test_a_saturation_scale_composes_the_same_through_the_port(fluid, diagram_ty @needs_core def test_an_older_core_refuses_a_saturation_scale(monkeypatch): - """A core from before 1.6 would ignore the scale and draw the chart without it.""" + """A core from before 1.5 would ignore the scale and draw the chart without it.""" pytest.importorskip("CoolProp") from coolplot import PropertyDiagram from coolplot.compose import compose @@ -813,9 +813,9 @@ def test_an_older_core_refuses_a_saturation_scale(monkeypatch): spec = chart.spec domain = chart.engine.domain(spec) curves = chart.engine.curves(spec, domain, plan(spec, domain)) - monkeypatch.setattr(native, "core_version", lambda: (1, 5, 0)) + monkeypatch.setattr(native, "core_version", lambda: (1, 4, 0)) monkeypatch.setenv("COOLPLOT_NATIVE", "1") - with pytest.warns(native.CoreFallbackWarning, match="older than 1.6"): + with pytest.warns(native.CoreFallbackWarning, match="older than 1.5"): items, _ = compose(spec, domain, curves) assert any(i.id == "scale/title" for i in items) # drawn by Python @@ -828,8 +828,8 @@ def test_an_older_core_refuses_a_saturation_scale(monkeypatch): ]) def test_dome_labels_compose_the_same_through_the_port(fluid, diagram_type, family, mode): pytest.importorskip("CoolProp") - if native.core_version() < (1, 6): - pytest.skip("coolplot-core 1.6 labels lines inside the dome; an older one is refused (next test)") + if native.core_version() < (1, 5): + pytest.skip("coolplot-core 1.5 labels lines inside the dome; an older one is refused (next test)") from coolplot import PropertyDiagram chart = PropertyDiagram(fluid, diagram_type, tp_limits="ACHP", settings="interactive") chart.set_lines(family, num=10, rounding=True, labels=True) @@ -842,7 +842,7 @@ def test_dome_labels_compose_the_same_through_the_port(fluid, diagram_type, fami @needs_core def test_an_older_core_refuses_dome_labels(monkeypatch): - """A core from before 1.6 would ignore the setting and draw the chart without the labels inside the dome.""" + """A core from before 1.5 would ignore the setting and draw the chart without the labels inside the dome.""" pytest.importorskip("CoolProp") from coolplot import PropertyDiagram from coolplot.compose import compose @@ -853,8 +853,8 @@ def test_an_older_core_refuses_dome_labels(monkeypatch): spec = chart.spec domain = chart.engine.domain(spec) curves = chart.engine.curves(spec, domain, plan(spec, domain)) - monkeypatch.setattr(native, "core_version", lambda: (1, 5, 0)) + monkeypatch.setattr(native, "core_version", lambda: (1, 4, 0)) monkeypatch.setenv("COOLPLOT_NATIVE", "1") - with pytest.warns(native.CoreFallbackWarning, match="older than 1.6"): + with pytest.warns(native.CoreFallbackWarning, match="older than 1.5"): items, _ = compose(spec, domain, curves) assert any("/dome/" in i.id for i in items) # drawn by Python From 1cf23ebe544160e9d68422d2ff2a070cb8f9c492 Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Tue, 3 Nov 2026 13:31:23 +0000 Subject: [PATCH 2/2] The last notes of 1.6 say 1.5: contracts table, bridge comment, test data Review comment on #45. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013bsHH92mrBKAQF1qBN3yhe --- cpp/tests/data/make_data.py | 8 ++++---- docs/reference/contracts.md | 2 +- src/coolplot/corelib.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/tests/data/make_data.py b/cpp/tests/data/make_data.py index d05b658..ee7a3bb 100644 --- a/cpp/tests/data/make_data.py +++ b/cpp/tests/data/make_data.py @@ -185,7 +185,7 @@ def main(): restyled.set_line_style("Q", color="#7a3cc8", dash="dotted") compose_case("compose_r290_ph_restyled_dome", restyled) - # Single lines (1.6): a highlighted isotherm and quality line in the + # Single lines (1.5): a highlighted isotherm and quality line in the # style of their families, a line of each axis quantity, one with its own # style and text, one without a label; labels in the colour of the lines single = PropertyDiagram("R290", "ph", tp_limits="ACHP", settings="interactive") @@ -216,7 +216,7 @@ def main(): def marked_point_cases(): - """The critical and triple points marked with a dot (1.6), the axes widened to show the triple points whole.""" + """The critical and triple points marked with a dot (1.5), the axes widened to show the triple points whole.""" water = PropertyDiagram("Water", "Ts", tp_limits=[None, None, None, None], settings="interactive") water.set_lines("p", num=5, labels=True) water.marked_points = ("critical", "triple") @@ -224,7 +224,7 @@ def marked_point_cases(): def saturation_scale_cases(): - """The saturation scale (1.6): T_sat on a pressure axis with a cycle, p_sat on a temperature axis, crowded.""" + """The saturation scale (1.5): T_sat on a pressure axis with a cycle, p_sat on a temperature axis, crowded.""" r290 = PropertyDiagram("R290", "ph", tp_limits="ACHP", settings="interactive") r290.set_default_lines(labels=True) r290.add_cycle("heat pump", [{"p": 3.0, "T": 0.0}, {"p": 15.0, "via": "compression", "eta_is": 0.7}, @@ -328,7 +328,7 @@ def badge_cases(): def dome_label_cases(): - """Labels inside the dome (1.6): isotherms of a p-h chart with a cycle and the scale, isobars of a T-s chart, + """Labels inside the dome (1.5): isotherms of a p-h chart with a cycle and the scale, isobars of a T-s chart, the sloped isotherms of a blend in edge mode.""" r290 = PropertyDiagram("R290", "ph", tp_limits="ACHP", settings="interactive") r290.set_default_lines(labels=True) diff --git a/docs/reference/contracts.md b/docs/reference/contracts.md index 15c5a11..6455ee5 100644 --- a/docs/reference/contracts.md +++ b/docs/reference/contracts.md @@ -249,7 +249,7 @@ an item in place: | `cycle//states` | the markers of all states of a cycle, in ascending state number | | `cycle//number/` | the number of state n | | `process//line`, `process//points` | a legacy process | -| `line/` | a single line (1.6), also the item id of its curve request | +| `line/` | a single line (1.5), also the item id of its curve request | | `line//label` | its label | Groups collect what is styled and toggled together (`iso/T`, diff --git a/src/coolplot/corelib.py b/src/coolplot/corelib.py index 76d72e8..6e8b869 100644 --- a/src/coolplot/corelib.py +++ b/src/coolplot/corelib.py @@ -118,7 +118,7 @@ def compose_record(spec, domain, curves, plot_size_pt=None, previous_labels=None # Only written when there are some, so the record of a chart without badge is the same as before 1.5 record["sources"] = list(sources) if spec.marked_points and domain.points: - # The same for the states of the marked critical and triple points (1.6) + # The same for the states of the marked critical and triple points (1.5) record["domain"]["points"] = {name: dict(values) for name, values in domain.points} if spec.saturation_scale is not None and domain.scale: record["domain"]["scale"] = [list(pair) for pair in domain.scale]